summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcem.kocagil@gmail.com <cem.kocagil@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-08 21:56:50 +0000
committercem.kocagil@gmail.com <cem.kocagil@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-08 21:56:50 +0000
commitfae7753433ce0fff8e5f28bedde84f7b164bc422 (patch)
tree97202dc59f150b226c961603e5594e46189f6666
parent954de8fed2ce9bd897dcb991e1527407e74a8494 (diff)
downloadchromium_src-fae7753433ce0fff8e5f28bedde84f7b164bc422.zip
chromium_src-fae7753433ce0fff8e5f28bedde84f7b164bc422.tar.gz
chromium_src-fae7753433ce0fff8e5f28bedde84f7b164bc422.tar.bz2
Add a command-line switch "disable-desktop-shortcuts" to disable profile desktop shortcuts handling
BUG=110206 TEST=Running chrome on Win with --disable-desktop-shortcuts and adding a new user shouldn't create a desktop shortcut Review URL: http://codereview.chromium.org/9363010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121063 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/profiles/profile_manager.cc4
-rw-r--r--chrome/common/chrome_switches.cc6
-rw-r--r--chrome/common/chrome_switches.h4
3 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 8f54325..2b9f9e9 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -699,7 +699,9 @@ ProfileInfoCache& ProfileManager::GetProfileInfoCache() {
#if defined(OS_WIN)
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
ProfileShortcutManagerWin* shortcut_manager = CreateShortcutManager();
- if (dist && dist->CanCreateDesktopShortcuts() && shortcut_manager) {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (dist && dist->CanCreateDesktopShortcuts() && shortcut_manager &&
+ !command_line.HasSwitch(switches::kDisableDesktopShortcuts)) {
profile_shortcut_manager_.reset(shortcut_manager);
profile_info_cache_->AddObserver(profile_shortcut_manager_.get());
}
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 9ae5be1..21d58a6 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -1246,6 +1246,12 @@ const char kKioskMode[] = "kiosk";
const char kKioskModePrinting[] = "kiosk-printing";
#endif
+#if defined(OS_WIN)
+// Disables profile desktop shortcuts handling, preventing their creation,
+// modification or removal.
+const char kDisableDesktopShortcuts[] = "disable-desktop-shortcuts";
+#endif
+
#if defined(TOOLKIT_VIEWS)
// Enables debug paint in views framework. Enabling this causes the damaged
// region being painted to flash in red.
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 14e557b..0a6eaff 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -355,6 +355,10 @@ extern const char kKioskMode[];
extern const char kKioskModePrinting[];
#endif
+#if defined(OS_WIN)
+extern const char kDisableDesktopShortcuts[];
+#endif
+
#if defined(TOOLKIT_VIEWS)
extern const char kDebugViewsPaint[];
extern const char kTouchDevices[];