diff options
author | munjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 01:33:18 +0000 |
---|---|---|
committer | munjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 01:33:18 +0000 |
commit | ac9263642922463a82cb02f1ecd06c9536cc83e7 (patch) | |
tree | 8cf8349ee13e5f15f2c50d4437d8d7ecdb9a6752 /chrome/browser | |
parent | 0191afb579f359623cf31a956ec8d602057ffdcb (diff) | |
download | chromium_src-ac9263642922463a82cb02f1ecd06c9536cc83e7.zip chromium_src-ac9263642922463a82cb02f1ecd06c9536cc83e7.tar.gz chromium_src-ac9263642922463a82cb02f1ecd06c9536cc83e7.tar.bz2 |
Hide profiles behind a command-line switch since the user-data-dir stuff
wouldn't work on Mac.
See bug http://code.google.com/p/chromium/issues/detail?id=7987
Review URL: http://codereview.chromium.org/28093
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10432 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser.cc | 6 | ||||
-rw-r--r-- | chrome/browser/user_data_manager.cc | 1 | ||||
-rw-r--r-- | chrome/browser/views/toolbar_view.cc | 11 |
3 files changed, 15 insertions, 3 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index b9c5a56..7e386f2 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -637,6 +637,9 @@ void Browser::NewIncognitoWindow() { void Browser::NewProfileWindowByIndex(int index) { #if defined(OS_WIN) + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + if (!command_line.HasSwitch(switches::kEnableUserDataDirProfiles)) + return; UserMetrics::RecordAction(L"NewProfileWindowByIndex", profile_); UserDataManager::Get()->LaunchChromeForProfile(index); #endif @@ -942,6 +945,9 @@ void Browser::OpenSelectProfileDialog() { } void Browser::OpenNewProfileDialog() { + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + if (!command_line.HasSwitch(switches::kEnableUserDataDirProfiles)) + return; UserMetrics::RecordAction(L"CreateProfile", profile_); window_->ShowNewProfileDialog(); } diff --git a/chrome/browser/user_data_manager.cc b/chrome/browser/user_data_manager.cc index 2aa4d78..e066cf1 100644 --- a/chrome/browser/user_data_manager.cc +++ b/chrome/browser/user_data_manager.cc @@ -182,6 +182,7 @@ void UserDataManager::LaunchChromeForProfile( std::wstring command; PathService::Get(base::FILE_EXE, &command); CommandLine command_line(command); + command_line.AppendSwitch(switches::kEnableUserDataDirProfiles); command_line.AppendSwitchWithValue(switches::kUserDataDir, user_data_dir); std::wstring local_state_path; diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index 56195b4..2dc3858 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -6,6 +6,7 @@ #include <string> +#include "base/command_line.h" #include "base/logging.h" #include "base/path_service.h" #include "chrome/app/chrome_dll_resource.h" @@ -27,6 +28,7 @@ #include "chrome/browser/views/toolbar_star_toggle.h" #include "chrome/browser/view_ids.h" #include "chrome/common/chrome_constants.h" +#include "chrome/common/chrome_switches.h" #include "chrome/common/drag_drop_types.h" #include "chrome/common/l10n_util.h" #include "chrome/common/notification_service.h" @@ -582,9 +584,12 @@ void BrowserToolbarView::RunAppMenu(const CPoint& pt, HWND hwnd) { // Enumerate profiles asynchronously and then create the parent menu item. // We will create the child menu items for this once the asynchronous call is // done. See OnGetProfilesDone(). - profiles_helper_->GetProfiles(NULL); - profiles_menu_ = menu.AppendSubMenu(IDC_PROFILE_MENU, - l10n_util::GetString(IDS_PROFILE_MENU)); + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + if (command_line.HasSwitch(switches::kEnableUserDataDirProfiles)) { + profiles_helper_->GetProfiles(NULL); + profiles_menu_ = menu.AppendSubMenu(IDC_PROFILE_MENU, + l10n_util::GetString(IDS_PROFILE_MENU)); + } menu.AppendSeparator(); menu.AppendMenuItemWithLabel(IDC_SHOW_BOOKMARK_BAR, |