summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/chrome_dll.rc23
-rw-r--r--chrome/app/chrome_dll_resource.h15
-rw-r--r--chrome/app/generated_resources.grd45
-rw-r--r--chrome/app/resources/locale_settings.grd14
-rw-r--r--chrome/browser/app_menu_model.cc66
-rw-r--r--chrome/browser/app_menu_model.h10
-rw-r--r--chrome/browser/browser.cc55
-rw-r--r--chrome/browser/browser.h3
-rw-r--r--chrome/browser/browser_init.cc9
-rw-r--r--chrome/browser/browser_main.cc4
-rw-r--r--chrome/browser/browser_window.h6
-rw-r--r--chrome/browser/cocoa/browser_window_cocoa.h2
-rw-r--r--chrome/browser/cocoa/browser_window_cocoa.mm8
-rw-r--r--chrome/browser/dom_ui/ntp_resource_cache.cc18
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc8
-rw-r--r--chrome/browser/gtk/browser_window_gtk.h2
-rw-r--r--chrome/browser/renderer_host/test/test_render_view_host.cc2
-rw-r--r--chrome/browser/renderer_host/test/test_render_view_host.h3
-rw-r--r--chrome/browser/user_data_manager.cc382
-rw-r--r--chrome/browser/user_data_manager.h159
-rw-r--r--chrome/browser/views/browser_dialogs.h3
-rw-r--r--chrome/browser/views/dialog_stubs_gtk.cc6
-rw-r--r--chrome/browser/views/frame/browser_view.cc8
-rw-r--r--chrome/browser/views/frame/browser_view.h2
-rw-r--r--chrome/browser/views/new_profile_dialog.cc136
-rw-r--r--chrome/browser/views/new_profile_dialog.h60
-rw-r--r--chrome/browser/views/select_profile_dialog.cc146
-rw-r--r--chrome/browser/views/select_profile_dialog.h84
-rw-r--r--chrome/browser/views/toolbar_view.cc2
-rw-r--r--chrome/browser/views/toolbar_view.h4
-rw-r--r--chrome/browser/wrench_menu_model.h5
-rwxr-xr-xchrome/chrome_browser.gypi6
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/test/test_browser_window.h2
35 files changed, 4 insertions, 1299 deletions
diff --git a/chrome/app/chrome_dll.rc b/chrome/app/chrome_dll.rc
index 3235ba3..03aa3b8 100644
--- a/chrome/app/chrome_dll.rc
+++ b/chrome/app/chrome_dll.rc
@@ -62,28 +62,6 @@ BEGIN
"N", IDC_NEW_INCOGNITO_WINDOW, VIRTKEY, CONTROL, SHIFT
"T", IDC_NEW_TAB, VIRTKEY, CONTROL
"N", IDC_NEW_WINDOW, VIRTKEY, CONTROL
- // NOTE: IDC_NEW_WINDOW_PROFILE_N is bound to the key ctrl-shift-(N+1), and
- // opens a new window using profile number N. For example,
- // IDC_NEW_WINDOW_PROFILE_0 is bound to ctrl-shift-1, and opens a window in
- // profile 0.
- "1", IDC_NEW_WINDOW_PROFILE_0, VIRTKEY, CONTROL, SHIFT
- VK_NUMPAD1, IDC_NEW_WINDOW_PROFILE_0, VIRTKEY, CONTROL, SHIFT
- "2", IDC_NEW_WINDOW_PROFILE_1, VIRTKEY, CONTROL, SHIFT
- VK_NUMPAD2, IDC_NEW_WINDOW_PROFILE_1, VIRTKEY, CONTROL, SHIFT
- "3", IDC_NEW_WINDOW_PROFILE_2, VIRTKEY, CONTROL, SHIFT
- VK_NUMPAD3, IDC_NEW_WINDOW_PROFILE_2, VIRTKEY, CONTROL, SHIFT
- "4", IDC_NEW_WINDOW_PROFILE_3, VIRTKEY, CONTROL, SHIFT
- VK_NUMPAD4, IDC_NEW_WINDOW_PROFILE_3, VIRTKEY, CONTROL, SHIFT
- "5", IDC_NEW_WINDOW_PROFILE_4, VIRTKEY, CONTROL, SHIFT
- VK_NUMPAD5, IDC_NEW_WINDOW_PROFILE_4, VIRTKEY, CONTROL, SHIFT
- "6", IDC_NEW_WINDOW_PROFILE_5, VIRTKEY, CONTROL, SHIFT
- VK_NUMPAD6, IDC_NEW_WINDOW_PROFILE_5, VIRTKEY, CONTROL, SHIFT
- "7", IDC_NEW_WINDOW_PROFILE_6, VIRTKEY, CONTROL, SHIFT
- VK_NUMPAD7, IDC_NEW_WINDOW_PROFILE_6, VIRTKEY, CONTROL, SHIFT
- "8", IDC_NEW_WINDOW_PROFILE_7, VIRTKEY, CONTROL, SHIFT
- VK_NUMPAD8, IDC_NEW_WINDOW_PROFILE_7, VIRTKEY, CONTROL, SHIFT
- "9", IDC_NEW_WINDOW_PROFILE_8, VIRTKEY, CONTROL, SHIFT
- VK_NUMPAD9, IDC_NEW_WINDOW_PROFILE_8, VIRTKEY, CONTROL, SHIFT
"O", IDC_OPEN_FILE, VIRTKEY, CONTROL
"P", IDC_PRINT, VIRTKEY, CONTROL
"R", IDC_RELOAD, VIRTKEY, CONTROL
@@ -100,7 +78,6 @@ BEGIN
VK_NEXT, IDC_SELECT_NEXT_TAB, VIRTKEY, CONTROL
VK_TAB, IDC_SELECT_PREVIOUS_TAB, VIRTKEY, CONTROL, SHIFT
VK_PRIOR, IDC_SELECT_PREVIOUS_TAB, VIRTKEY, CONTROL
- "M", IDC_SELECT_PROFILE, VIRTKEY, CONTROL
// NOTE: IDC_SELECT_TAB_N is bound to the key ctrl-(N+1), and selects the
// tab at index N. For example, IDC_SELECT_TAB_0 is bound to ctrl-1, and
// selects the tab at index 0.
diff --git a/chrome/app/chrome_dll_resource.h b/chrome/app/chrome_dll_resource.h
index c72cf1a..a1055ed 100644
--- a/chrome/app/chrome_dll_resource.h
+++ b/chrome/app/chrome_dll_resource.h
@@ -81,19 +81,6 @@
// Window management commands
#define IDC_NEW_WINDOW 34000
#define IDC_NEW_INCOGNITO_WINDOW 34001
-#define IDC_PROFILE_MENU 34002
-// Insert any additional profile values before _LAST; these have to be
-// consecutive.
-#define IDC_NEW_WINDOW_PROFILE_0 34003
-#define IDC_NEW_WINDOW_PROFILE_1 34004
-#define IDC_NEW_WINDOW_PROFILE_2 34005
-#define IDC_NEW_WINDOW_PROFILE_3 34006
-#define IDC_NEW_WINDOW_PROFILE_4 34007
-#define IDC_NEW_WINDOW_PROFILE_5 34008
-#define IDC_NEW_WINDOW_PROFILE_6 34009
-#define IDC_NEW_WINDOW_PROFILE_7 34010
-#define IDC_NEW_WINDOW_PROFILE_8 34011
-#define IDC_NEW_WINDOW_PROFILE_LAST IDC_NEW_WINDOW_PROFILE_8
#define IDC_CLOSE_WINDOW 34012
#define IDC_ALWAYS_ON_TOP 34013
#define IDC_NEW_TAB 34014
@@ -202,8 +189,6 @@
#define IDC_DEV_TOOLS 40003
#define IDC_DEV_TOOLS_CONSOLE 40004
#define IDC_TASK_MANAGER 40005
-#define IDC_SELECT_PROFILE 40006
-#define IDC_NEW_PROFILE 40007
#define IDC_REPORT_BUG 40008
#define IDC_SHOW_BOOKMARK_BAR 40009
#define IDC_SHOW_HISTORY 40010
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index f90ff1d..0551a07 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -712,12 +712,6 @@ each locale. -->
<message name="IDS_NEW_WINDOW" desc="The text label of the New Window menu item">
&amp;New window
</message>
- <message name="IDS_PROFILE_MENU" desc="The text label of the New profile Window menu item">
- New window in &amp;profile
- </message>
- <message name="IDS_SELECT_PROFILE" desc="The text label of the menu item to select a profile other than the ones displayed directly in the Profile submenu.">
- Other...
- </message>
<message name="IDS_NEW_INCOGNITO_WINDOW" desc="The text label of the New incognito window menu item">
New &amp;incognito window
</message>
@@ -777,12 +771,6 @@ each locale. -->
<message name="IDS_NEW_WINDOW" desc="In Title Case: The text label of the New Window menu item">
&amp;New Window
</message>
- <message name="IDS_PROFILE_MENU" desc="In Title Case: The text label of the New profile Window menu item">
- New Window in &amp;Profile
- </message>
- <message name="IDS_SELECT_PROFILE" desc="In Title Case: The text label of the menu item to select a profile other than the ones displayed directly in the Profile submenu.">
- Other...
- </message>
<message name="IDS_NEW_INCOGNITO_WINDOW" desc="In Title Case: The text label of the New incognito window menu item">
New &amp;Incognito Window
</message>
@@ -6022,18 +6010,10 @@ Keep your key file in a safe place. You will need it to create new versions of y
desc="Title of the new tab page, this is only shown while loading, then the title comes from the page">
New Tab
</message>
- <message name="IDS_NEW_TAB_TITLE_WITH_PROFILE_NAME"
- desc="Title of the new tab page with profile name, this is only shown while loading, then the title comes from the page">
- New Tab [<ph name="PROFILE_NAME">$1</ph>]
- </message>
<message name="IDS_NEW_TAB_MOST_VISITED"
desc="The 'Most Visited' heading on the new tab page">
Most visited
</message>
- <message name="IDS_NEW_TAB_MOST_VISITED_WITH_PROFILE_NAME"
- desc="The 'Most Visited' heading on the new tab page">
- Most visited [<ph name="PROFILE_NAME">$1</ph>]
- </message>
<message name="IDS_NEW_TAB_RESTORE_THUMBNAILS_LINK"
desc="The link that restores previously removed thumbnails">
Restore all removed thumbnails
@@ -6474,31 +6454,6 @@ Keep your key file in a safe place. You will need it to create new versions of y
Choose Another Directory...
</message>
- <!-- User data directory profiles dialog -->
- <message name="IDS_SELECT_PROFILE_DIALOG_TITLE" desc="Title of the dialog that lets the user select a profile to open a new window.">
- Select a Profile
- </message>
- <message name="IDS_SELECT_PROFILE_DIALOG_LABEL_TEXT" desc="The label for the combo box that shows all the available profiles.">
- Select a profile to open a new window
- </message>
- <message name="IDS_SELECT_PROFILE_DIALOG_NEW_PROFILE_ENTRY" desc="Text for an extra entry in the profiles combo box. The user can select this entry to create a new profile.">
- &lt;New Profile&gt;...
- </message>
- <message name="IDS_START_IN_PROFILE_SHORTCUT_NAME" desc="Name of the desktop shortcut to start the application in a specific profile.">
- <ph name="app_name">$1<ex>Google Chrome</ex></ph> for <ph name="profile_name">$2<ex>My Second Profile</ex></ph>
- </message>
-
- <!-- User data directory new profile dialog -->
- <message name="IDS_NEW_PROFILE_DIALOG_TITLE" desc="Title of dialog that lets the user enter a new profile name to open new window.">
- Enter a Profile Name
- </message>
- <message name="IDS_NEW_PROFILE_DIALOG_LABEL_TEXT" desc="The label for the text box that lets the user enter a new profile name.">
- Enter a new profile name
- </message>
- <message name="IDS_NEW_PROFILE_DIALOG_CREATE_SHORTCUT_TEXT" desc="The label for the text box that lets the user enter a new profile name.">
- Create a desktop shortcut for this profile
- </message>
-
<!-- Advanced Section Titles -->
<message name="IDS_OPTIONS_ADVANCED_SECTION_TITLE_PRIVACY">
Privacy
diff --git a/chrome/app/resources/locale_settings.grd b/chrome/app/resources/locale_settings.grd
index c693bba..6c48c12 100644
--- a/chrome/app/resources/locale_settings.grd
+++ b/chrome/app/resources/locale_settings.grd
@@ -539,20 +539,6 @@
52
</message>
- <!-- The width and height of the Select Profile dialog in characters and lines -->
- <!-- (See above). -->
- <message name="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS" use_name_for_id="true">
- 60
- </message>
- <message name="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES" use_name_for_id="true">
- 5
- </message>
-
- <!-- The width of the New Profile dialog in characters (See above). -->
- <message name="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS" use_name_for_id="true">
- 60
- </message>
-
<!-- The URL for Chromium project used in About dialog. -->
<message name="IDS_CHROMIUM_PROJECT_URL" translateable="false">
http://code.google.com/chromium/?hl=[GRITLANGCODE]
diff --git a/chrome/browser/app_menu_model.cc b/chrome/browser/app_menu_model.cc
index ac418b7..456c6d9 100644
--- a/chrome/browser/app_menu_model.cc
+++ b/chrome/browser/app_menu_model.cc
@@ -65,18 +65,6 @@ void AppMenuModel::Build() {
AddItemWithStringId(IDC_NEW_TAB, IDS_NEW_TAB);
AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW);
AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW);
- // 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().
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (command_line.HasSwitch(switches::kEnableUserDataDirProfiles)) {
- if (!profiles_menu_contents_.get()) {
- profiles_menu_contents_.reset(new menus::SimpleMenuModel(delegate()));
- BuildProfileSubMenu();
- }
- AddSubMenuWithStringId(IDC_PROFILE_MENU, IDS_PROFILE_MENU,
- profiles_menu_contents_.get());
- }
AddSeparator();
AddCheckItemWithStringId(IDC_SHOW_BOOKMARK_BAR, IDS_SHOW_BOOKMARK_BAR);
@@ -125,60 +113,6 @@ void AppMenuModel::Build() {
}
}
-bool AppMenuModel::BuildProfileSubMenu() {
- // Nothing to do if the menu has gone away.
- if (!profiles_menu_contents_.get())
- return false;
-
- // Triggers profile list refresh in case it's changed.
- UserDataManager::Get()->RefreshUserDataDirProfiles();
-
- // Use the list of profiles in the browser.
- const std::vector<std::wstring>& profiles =
- browser_->user_data_dir_profiles();
-
- // Check if profiles have changed.
- if (!ProfilesChanged(profiles))
- return false;
-
- // Update known profiles.
- known_profiles_.assign(profiles.begin(), profiles.end());
-
- // Clear old profile menu items.
- profiles_menu_contents_->Clear();
-
- // Add direct submenu items for profiles.
- std::vector<std::wstring>::const_iterator iter = profiles.begin();
- for (int i = IDC_NEW_WINDOW_PROFILE_0;
- i <= IDC_NEW_WINDOW_PROFILE_LAST && iter != profiles.end();
- ++i, ++iter)
- profiles_menu_contents_->AddItem(i, WideToUTF16Hack(*iter));
-
- // If there are more profiles then show "Other" link.
- if (iter != profiles.end()) {
- profiles_menu_contents_->AddSeparator();
- profiles_menu_contents_->AddItemWithStringId(IDC_SELECT_PROFILE,
- IDS_SELECT_PROFILE);
- }
-
- // Always show a link to select a new profile.
- profiles_menu_contents_->AddSeparator();
- profiles_menu_contents_->AddItemWithStringId(
- IDC_NEW_PROFILE,
- IDS_SELECT_PROFILE_DIALOG_NEW_PROFILE_ENTRY);
-
- return true;
-}
-
-bool AppMenuModel::ProfilesChanged(
- const std::vector<std::wstring>& profiles) const {
- if (profiles.size() != known_profiles_.size())
- return true;
-
- return !std::equal(profiles.begin(), profiles.end(),
- known_profiles_.begin());
-}
-
string16 AppMenuModel::GetSyncMenuLabel() const {
return sync_ui_util::GetSyncMenuLabel(
browser_->profile()->GetOriginalProfile()->GetProfileSyncService());
diff --git a/chrome/browser/app_menu_model.h b/chrome/browser/app_menu_model.h
index 962368e..60483f8 100644
--- a/chrome/browser/app_menu_model.h
+++ b/chrome/browser/app_menu_model.h
@@ -11,7 +11,6 @@
#include "app/menus/simple_menu_model.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
-#include "chrome/browser/user_data_manager.h"
class Browser;
@@ -28,22 +27,13 @@ class AppMenuModel : public menus::SimpleMenuModel {
virtual bool HasIcons() const { return true; }
virtual bool GetIconAt(int index, SkBitmap* icon) const;
- // Build/update profile submenu. Return true if profiles submenu is built or
- // updated. False otherwise.
- bool BuildProfileSubMenu();
-
private:
void Build();
- bool ProfilesChanged(const std::vector<std::wstring>& profiles) const;
-
string16 GetSyncMenuLabel() const;
string16 GetAboutEntryMenuLabel() const;
bool IsDynamicItem(int index) const;
- // Contents of the profiles menu to populate with profile names.
- scoped_ptr<menus::SimpleMenuModel> profiles_menu_contents_;
-
// Profile names that are in profiles_menu_contents_. This is used to
// detect profile change.
std::vector<std::wstring> known_profiles_;
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index a4620f6..49f5394 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -101,7 +101,6 @@
#include "chrome/browser/ssl/ssl_error_info.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/task_manager.h"
-#include "chrome/browser/user_data_manager.h"
#include "chrome/browser/view_ids.h"
#include "chrome/browser/views/app_launcher.h"
#include "chrome/browser/views/location_bar/location_bar_view.h"
@@ -1024,7 +1023,6 @@ void Browser::UpdateCommandsForFullscreenMode(bool is_fullscreen) {
command_updater_.UpdateCommandEnabled(IDC_OPEN_CURRENT_URL, show_main_ui);
// Window management commands
- command_updater_.UpdateCommandEnabled(IDC_PROFILE_MENU, show_main_ui);
command_updater_.UpdateCommandEnabled(IDC_SHOW_AS_TAB,
(type() & TYPE_POPUP) && !is_fullscreen);
@@ -1038,7 +1036,6 @@ void Browser::UpdateCommandsForFullscreenMode(bool is_fullscreen) {
// Show various bits of UI
command_updater_.UpdateCommandEnabled(IDC_DEVELOPER_MENU, show_main_ui);
- command_updater_.UpdateCommandEnabled(IDC_NEW_PROFILE, show_main_ui);
command_updater_.UpdateCommandEnabled(IDC_REPORT_BUG, show_main_ui);
command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_BAR, show_main_ui);
command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, show_main_ui);
@@ -1244,17 +1241,6 @@ void Browser::NewIncognitoWindow() {
Browser::OpenEmptyWindow(profile_->GetOffTheRecordProfile());
}
-void Browser::NewProfileWindowByIndex(int index) {
-#if defined(OS_WIN)
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (!command_line.HasSwitch(switches::kEnableUserDataDirProfiles))
- return;
- UserMetrics::RecordAction(UserMetricsAction("NewProfileWindowByIndex"),
- profile_);
- UserDataManager::Get()->LaunchChromeForProfile(index);
-#endif
-}
-
void Browser::CloseWindow() {
UserMetrics::RecordAction(UserMetricsAction("CloseWindow"), profile_);
window_->Close();
@@ -1620,22 +1606,6 @@ void Browser::OpenTaskManager() {
window_->ShowTaskManager();
}
-void Browser::OpenSelectProfileDialog() {
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (!command_line.HasSwitch(switches::kEnableUserDataDirProfiles))
- return;
- UserMetrics::RecordAction(UserMetricsAction("SelectProfile"), profile_);
- window_->ShowSelectProfileDialog();
-}
-
-void Browser::OpenNewProfileDialog() {
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (!command_line.HasSwitch(switches::kEnableUserDataDirProfiles))
- return;
- UserMetrics::RecordAction(UserMetricsAction("CreateProfile"), profile_);
- window_->ShowNewProfileDialog();
-}
-
void Browser::OpenBugReportDialog() {
#if defined(OS_CHROMEOS)
UserMetrics::RecordAction(UserMetricsAction("ReportBug"), profile_);
@@ -1919,17 +1889,6 @@ void Browser::ExecuteCommandWithDisposition(
// Window management commands
case IDC_NEW_WINDOW: NewWindow(); break;
case IDC_NEW_INCOGNITO_WINDOW: NewIncognitoWindow(); break;
- case IDC_NEW_WINDOW_PROFILE_0:
- case IDC_NEW_WINDOW_PROFILE_1:
- case IDC_NEW_WINDOW_PROFILE_2:
- case IDC_NEW_WINDOW_PROFILE_3:
- case IDC_NEW_WINDOW_PROFILE_4:
- case IDC_NEW_WINDOW_PROFILE_5:
- case IDC_NEW_WINDOW_PROFILE_6:
- case IDC_NEW_WINDOW_PROFILE_7:
- case IDC_NEW_WINDOW_PROFILE_8:
- NewProfileWindowByIndex(id - IDC_NEW_WINDOW_PROFILE_0);
- break;
case IDC_CLOSE_WINDOW: CloseWindow(); break;
case IDC_NEW_TAB: NewTab(); break;
case IDC_CLOSE_TAB: CloseTab(); break;
@@ -2032,8 +1991,6 @@ void Browser::ExecuteCommandWithDisposition(
case IDC_DEV_TOOLS: ToggleDevToolsWindow(false); break;
case IDC_DEV_TOOLS_CONSOLE: ToggleDevToolsWindow(true); break;
case IDC_TASK_MANAGER: OpenTaskManager(); break;
- case IDC_SELECT_PROFILE: OpenSelectProfileDialog(); break;
- case IDC_NEW_PROFILE: OpenNewProfileDialog(); break;
case IDC_REPORT_BUG: OpenBugReportDialog(); break;
case IDC_SHOW_BOOKMARK_BAR: ToggleBookmarkBar(); break;
@@ -3009,17 +2966,6 @@ void Browser::InitCommandState() {
// Window management commands
command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW, true);
command_updater_.UpdateCommandEnabled(IDC_NEW_INCOGNITO_WINDOW, true);
- // TODO(pkasting): Perhaps the code that populates this submenu should do
- // this?
- command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_0, true);
- command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_1, true);
- command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_2, true);
- command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_3, true);
- command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_4, true);
- command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_5, true);
- command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_6, true);
- command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_7, true);
- command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_8, true);
command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true);
command_updater_.UpdateCommandEnabled(IDC_NEW_TAB, true);
command_updater_.UpdateCommandEnabled(IDC_CLOSE_TAB, true);
@@ -3088,7 +3034,6 @@ void Browser::InitCommandState() {
command_updater_.UpdateCommandEnabled(IDC_DEV_TOOLS, true);
command_updater_.UpdateCommandEnabled(IDC_DEV_TOOLS_CONSOLE, true);
command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, true);
- command_updater_.UpdateCommandEnabled(IDC_SELECT_PROFILE, true);
command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, true);
command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_MANAGER, true);
command_updater_.UpdateCommandEnabled(IDC_SHOW_EXTENSION_SHELF, true);
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index 5a3a636..cfd9959 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -440,7 +440,6 @@ class Browser : public TabStripModelDelegate,
// Window management commands
void NewWindow();
void NewIncognitoWindow();
- void NewProfileWindowByIndex(int index);
void CloseWindow();
void NewTab();
void CloseTab();
@@ -509,8 +508,6 @@ class Browser : public TabStripModelDelegate,
void OpenCreateShortcutsDialog();
void ToggleDevToolsWindow(bool open_console);
void OpenTaskManager();
- void OpenSelectProfileDialog();
- void OpenNewProfileDialog();
void OpenBugReportDialog();
void ToggleBookmarkBar();
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc
index 9c343c2..8c6c8c6 100644
--- a/chrome/browser/browser_init.cc
+++ b/chrome/browser/browser_init.cc
@@ -37,7 +37,6 @@
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
#include "chrome/browser/tabs/pinned_tab_codec.h"
-#include "chrome/browser/user_data_manager.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -1011,14 +1010,6 @@ bool BrowserInit::ProcessCmdLineImpl(const CommandLine& command_line,
net::SetExplicitlyAllowedPorts(allowed_ports);
}
- if (command_line.HasSwitch(switches::kEnableUserDataDirProfiles)) {
- // Update user data dir profiles when kEnableUserDataDirProfiles is enabled.
- // Profile enumeration would be scheduled on file thread and when
- // enumeration is done, the profile list in BrowserProcess would be
- // updated on ui thread.
- UserDataManager::Get()->RefreshUserDataDirProfiles();
- }
-
#if defined(OS_CHROMEOS)
// The browser will be launched after the user logs in.
if (command_line.HasSwitch(switches::kLoginManager))
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index c801f98..6675bba 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -61,7 +61,6 @@
#else
#include "chrome/browser/translate/translate_manager2.h"
#endif
-#include "chrome/browser/user_data_manager.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -974,9 +973,6 @@ int BrowserMain(const MainFunctionParams& parameters) {
scoped_refptr<HistogramSynchronizer> histogram_synchronizer =
new HistogramSynchronizer();
- // Initialize the shared instance of user data manager.
- scoped_ptr<UserDataManager> user_data_manager(UserDataManager::Create());
-
// Initialize the prefs of the local state.
browser::RegisterLocalState(local_state);
diff --git a/chrome/browser/browser_window.h b/chrome/browser/browser_window.h
index 93ae25f..ff80ab7 100644
--- a/chrome/browser/browser_window.h
+++ b/chrome/browser/browser_window.h
@@ -214,12 +214,6 @@ class BrowserWindow {
// Shows the Password Manager dialog box.
virtual void ShowPasswordManager() = 0;
- // Shows the Select Profile dialog box.
- virtual void ShowSelectProfileDialog() = 0;
-
- // Shows the New Profile dialog box.
- virtual void ShowNewProfileDialog() = 0;
-
// Shows the repost form confirmation dialog box.
virtual void ShowRepostFormWarningDialog(TabContents* tab_contents) = 0;
diff --git a/chrome/browser/cocoa/browser_window_cocoa.h b/chrome/browser/cocoa/browser_window_cocoa.h
index 0b44fe1..b6aa455 100644
--- a/chrome/browser/cocoa/browser_window_cocoa.h
+++ b/chrome/browser/cocoa/browser_window_cocoa.h
@@ -77,8 +77,6 @@ class BrowserWindowCocoa : public BrowserWindow,
virtual void ShowImportDialog();
virtual void ShowSearchEnginesDialog();
virtual void ShowPasswordManager();
- virtual void ShowSelectProfileDialog();
- virtual void ShowNewProfileDialog();
virtual void ShowRepostFormWarningDialog(TabContents* tab_contents);
virtual void ShowContentSettingsWindow(ContentSettingsType content_type,
Profile* profile);
diff --git a/chrome/browser/cocoa/browser_window_cocoa.mm b/chrome/browser/cocoa/browser_window_cocoa.mm
index 38bbd48..78f2221 100644
--- a/chrome/browser/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/cocoa/browser_window_cocoa.mm
@@ -307,14 +307,6 @@ void BrowserWindowCocoa::ShowPasswordManager() {
NOTIMPLEMENTED();
}
-void BrowserWindowCocoa::ShowSelectProfileDialog() {
- NOTIMPLEMENTED();
-}
-
-void BrowserWindowCocoa::ShowNewProfileDialog() {
- NOTIMPLEMENTED();
-}
-
void BrowserWindowCocoa::ShowRepostFormWarningDialog(
TabContents* tab_contents) {
RepostFormWarningMac::Create(GetNativeHandle(), tab_contents);
diff --git a/chrome/browser/dom_ui/ntp_resource_cache.cc b/chrome/browser/dom_ui/ntp_resource_cache.cc
index 3d4f98a..829a431 100644
--- a/chrome/browser/dom_ui/ntp_resource_cache.cc
+++ b/chrome/browser/dom_ui/ntp_resource_cache.cc
@@ -23,7 +23,6 @@
#include "chrome/browser/google_util.h"
#include "chrome/browser/pref_service.h"
#include "chrome/browser/profile.h"
-#include "chrome/browser/user_data_manager.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
@@ -241,21 +240,8 @@ void NTPResourceCache::CreateNewTabIncognitoHTML() {
void NTPResourceCache::CreateNewTabHTML() {
// Show the profile name in the title and most visited labels if the current
// profile is not the default.
- std::wstring title;
- std::wstring most_visited;
- if (UserDataManager::Get()->is_current_profile_default()) {
- title = l10n_util::GetString(IDS_NEW_TAB_TITLE);
- most_visited = l10n_util::GetString(IDS_NEW_TAB_MOST_VISITED);
- } else {
- // Get the current profile name.
- std::wstring profile_name =
- UserDataManager::Get()->current_profile_name();
- title = l10n_util::GetStringF(IDS_NEW_TAB_TITLE_WITH_PROFILE_NAME,
- profile_name);
- most_visited = l10n_util::GetStringF(
- IDS_NEW_TAB_MOST_VISITED_WITH_PROFILE_NAME,
- profile_name);
- }
+ std::wstring title = l10n_util::GetString(IDS_NEW_TAB_TITLE);
+ std::wstring most_visited = l10n_util::GetString(IDS_NEW_TAB_MOST_VISITED);
DictionaryValue localized_strings;
localized_strings.SetString(L"bookmarkbarattached",
profile_->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ?
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index b7ed9b8..fbc4750 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -928,14 +928,6 @@ void BrowserWindowGtk::ShowPasswordManager() {
NOTIMPLEMENTED();
}
-void BrowserWindowGtk::ShowSelectProfileDialog() {
- NOTIMPLEMENTED();
-}
-
-void BrowserWindowGtk::ShowNewProfileDialog() {
- NOTIMPLEMENTED();
-}
-
void BrowserWindowGtk::ShowRepostFormWarningDialog(TabContents* tab_contents) {
new RepostFormWarningGtk(GetNativeHandle(), tab_contents);
}
diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h
index 4120596..4ba7d33 100644
--- a/chrome/browser/gtk/browser_window_gtk.h
+++ b/chrome/browser/gtk/browser_window_gtk.h
@@ -95,8 +95,6 @@ class BrowserWindowGtk : public BrowserWindow,
virtual void ShowImportDialog();
virtual void ShowSearchEnginesDialog();
virtual void ShowPasswordManager();
- virtual void ShowSelectProfileDialog();
- virtual void ShowNewProfileDialog();
virtual void ShowRepostFormWarningDialog(TabContents* tab_contents);
virtual void ShowContentSettingsWindow(ContentSettingsType content_type,
Profile* profile);
diff --git a/chrome/browser/renderer_host/test/test_render_view_host.cc b/chrome/browser/renderer_host/test/test_render_view_host.cc
index 7b4a11e..33c7529 100644
--- a/chrome/browser/renderer_host/test/test_render_view_host.cc
+++ b/chrome/browser/renderer_host/test/test_render_view_host.cc
@@ -161,8 +161,6 @@ void RenderViewHostTestHarness::SetUp() {
SiteInstance* instance = SiteInstance::CreateSiteInstance(profile_.get());
contents_.reset(new TestTabContents(profile_.get(), instance));
-
- user_data_manager_.reset(UserDataManager::Create());
}
void RenderViewHostTestHarness::TearDown() {
diff --git a/chrome/browser/renderer_host/test/test_render_view_host.h b/chrome/browser/renderer_host/test/test_render_view_host.h
index 10a76bd..595b339 100644
--- a/chrome/browser/renderer_host/test/test_render_view_host.h
+++ b/chrome/browser/renderer_host/test/test_render_view_host.h
@@ -16,7 +16,6 @@
#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/test_tab_contents.h"
-#include "chrome/browser/user_data_manager.h"
#include "chrome/test/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -296,8 +295,6 @@ class RenderViewHostTestHarness : public testing::Test {
scoped_ptr<TestTabContents> contents_;
- scoped_ptr<UserDataManager> user_data_manager_;
-
DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness);
};
diff --git a/chrome/browser/user_data_manager.cc b/chrome/browser/user_data_manager.cc
deleted file mode 100644
index ec35b19..0000000
--- a/chrome/browser/user_data_manager.cc
+++ /dev/null
@@ -1,382 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "build/build_config.h"
-
-#include "chrome/browser/user_data_manager.h"
-
-#include <string>
-
-#include "app/l10n_util.h"
-#include "base/file_util.h"
-#include "base/logging.h"
-#include "base/message_loop.h"
-#include "base/path_service.h"
-#include "base/process_util.h"
-#include "base/string_util.h"
-#include "chrome/browser/browser_process.h"
-#include "chrome/browser/chrome_thread.h"
-#include "chrome/common/chrome_constants.h"
-#include "chrome/common/chrome_paths.h"
-#include "chrome/common/chrome_switches.h"
-#include "grit/generated_resources.h"
-
-#if defined(OS_WIN)
-#include <windows.h>
-#include "chrome/browser/shell_integration.h"
-#include "chrome/installer/util/browser_distribution.h"
-#include "chrome/installer/util/shell_util.h"
-#endif
-
-namespace {
-
-// Helper to start chrome for a given profile index. The helper takes care of
-// enumerating profiles on the file thread and then it launches Chrome for the
-// appropriate profile on the original thread.
-// An instance of this class should always be created on the heap, and it will
-// delete itself when the launch is done.
-class LaunchChromeForProfileIndexHelper : GetProfilesHelper::Delegate {
- public:
- // Creates an instance with the given data manager and to launch chrome for
- // the profile with the given index.
- LaunchChromeForProfileIndexHelper(const UserDataManager* manager, int index);
- virtual ~LaunchChromeForProfileIndexHelper();
-
- // Starts the asynchronous launch.
- void StartLaunch();
-
- // GetProfilesHelper::Delegate method.
- void OnGetProfilesDone(const std::vector<std::wstring>& profiles);
-
- private:
- int index_;
- const UserDataManager* manager_;
- scoped_refptr<GetProfilesHelper> profiles_helper_;
-
- DISALLOW_COPY_AND_ASSIGN(LaunchChromeForProfileIndexHelper);
-};
-
-// Helper to update global user data dir profiles list.
-class UserDataDirProfilesUpdater : GetProfilesHelper::Delegate {
- public:
- UserDataDirProfilesUpdater();
- virtual ~UserDataDirProfilesUpdater();
-
- // Request profiles via GetProfilesHelper.
- void Run();
-
- // GetProfilesHelper::Delegate method.
- void OnGetProfilesDone(const std::vector<std::wstring>& profiles);
-
- private:
- scoped_refptr<GetProfilesHelper> profiles_helper_;
-
- DISALLOW_COPY_AND_ASSIGN(UserDataDirProfilesUpdater);
-};
-
-LaunchChromeForProfileIndexHelper::LaunchChromeForProfileIndexHelper(
- const UserDataManager* manager,
- int index)
- : index_(index),
- manager_(manager),
- ALLOW_THIS_IN_INITIALIZER_LIST(
- profiles_helper_(new GetProfilesHelper(this))) {
- DCHECK(manager);
-}
-
-LaunchChromeForProfileIndexHelper::~LaunchChromeForProfileIndexHelper() {
- profiles_helper_->OnDelegateDeleted();
-}
-
-void LaunchChromeForProfileIndexHelper::StartLaunch() {
- profiles_helper_->GetProfiles(NULL);
-}
-
-void LaunchChromeForProfileIndexHelper::OnGetProfilesDone(
- const std::vector<std::wstring>& profiles) {
- if (index_ >= 0 && index_ < static_cast<int>(profiles.size()))
- manager_->LaunchChromeForProfile(profiles[index_]);
-
- // We are done, delete ourselves.
- delete this;
-}
-
-UserDataDirProfilesUpdater::UserDataDirProfilesUpdater()
- : ALLOW_THIS_IN_INITIALIZER_LIST(
- profiles_helper_(new GetProfilesHelper(this))) {
-}
-
-UserDataDirProfilesUpdater::~UserDataDirProfilesUpdater() {
- profiles_helper_->OnDelegateDeleted();
-}
-
-void UserDataDirProfilesUpdater::Run() {
- profiles_helper_->GetProfiles(NULL);
-}
-
-void UserDataDirProfilesUpdater::OnGetProfilesDone(
- const std::vector<std::wstring>& profiles) {
- g_browser_process->user_data_dir_profiles() = profiles;
-
- // We are done, delete ourselves.
- delete this;
-}
-
-} // namespace
-
-// Separator used in folder names between the prefix and the profile name.
-// For e.g. a folder for the profile "Joe" would be named "User Data-Joe".
-static const wchar_t kProfileFolderSeparator[] = L"-";
-
-// static
-UserDataManager* UserDataManager::instance_ = NULL;
-
-// static
-UserDataManager* UserDataManager::Create() {
- DCHECK(!instance_);
- FilePath user_path;
- PathService::Get(chrome::DIR_USER_DATA, &user_path);
- instance_ = new UserDataManager(user_path);
- return instance_;
-}
-
-// static
-UserDataManager* UserDataManager::Get() {
- DCHECK(instance_);
- return instance_;
-}
-
-UserDataManager::UserDataManager(const FilePath& user_data_root)
- : user_data_root_(user_data_root) {
- // Determine current profile name and current folder name.
- current_folder_name_ = user_data_root.BaseName().ToWStringHack();
- bool success = GetProfileNameFromFolderName(current_folder_name_,
- &current_profile_name_);
- // The current profile is a default profile if the current user data folder
- // name is just kUserDataDirname or when the folder name doesn't have the
- // kUserDataDirname as prefix.
- is_current_profile_default_ =
- !success || (current_folder_name_ == chrome::kUserDataDirname);
-
- // (TODO:munjal) Fix issue 5070:
- // http://code.google.com/p/chromium/issues/detail?id=5070
-
- user_data_root_ = user_data_root_.DirName();
-}
-
-UserDataManager::~UserDataManager() {
- if (instance_ == this)
- instance_ = NULL;
-}
-
-// static
-bool UserDataManager::GetProfileNameFromFolderName(
- const std::wstring& folder_name,
- std::wstring* profile_name) {
- // The folder name should start with a specific prefix for it to be a valid
- // profile folder.
- if (folder_name.find(chrome::kUserDataDirname) != 0)
- return false;
-
- // Seems like we cannot use arraysize macro for externally defined constants.
- // Is there a way?
- unsigned int prefix_length = wcslen(chrome::kUserDataDirname);
- // Subtract 1 from the size of the array for trailing null character.
- unsigned int separator_length = arraysize(kProfileFolderSeparator) - 1;
-
- // It's safe to use profile_name variable for intermediate values since we
- // will always return true now.
- *profile_name = folder_name.substr(prefix_length);
- // Remove leading separator if present.
- if (profile_name->find_first_of(kProfileFolderSeparator) == 0)
- *profile_name = profile_name->substr(separator_length);
-
- if (profile_name->empty())
- *profile_name = chrome::kNotSignedInProfile;
-
- return true;
-}
-
-// static
-std::wstring UserDataManager::GetFolderNameFromProfileName(
- const std::wstring& profile_name) {
- std::wstring folder_name = chrome::kUserDataDirname;
- if (profile_name != chrome::kNotSignedInProfile) {
- folder_name += kProfileFolderSeparator;
- folder_name += profile_name;
- }
- return folder_name;
-}
-
-std::wstring UserDataManager::GetUserDataFolderForProfile(
- const std::wstring& profile_name) const {
- std::wstring folder_name = GetFolderNameFromProfileName(profile_name);
- FilePath folder_path = user_data_root_.Append(
- FilePath::FromWStringHack(folder_name));
- return folder_path.ToWStringHack();
-}
-
-void UserDataManager::LaunchChromeForProfile(
- const std::wstring& profile_name) const {
- std::wstring user_data_dir = GetUserDataFolderForProfile(profile_name);
- FilePath command;
- PathService::Get(base::FILE_EXE, &command);
- CommandLine command_line(command);
- command_line.AppendSwitch(switches::kEnableUserDataDirProfiles);
- command_line.AppendSwitchWithValue(switches::kUserDataDir,
- user_data_dir);
- FilePath local_state_path;
- PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path);
- command_line.AppendSwitchWithValue(switches::kParentProfile,
- local_state_path.ToWStringHack());
- base::LaunchApp(command_line, false, false, NULL);
-}
-
-void UserDataManager::LaunchChromeForProfile(int index) const {
- // Helper deletes itself when done.
- LaunchChromeForProfileIndexHelper* helper =
- new LaunchChromeForProfileIndexHelper(this, index);
- helper->StartLaunch();
-}
-
-void UserDataManager::GetProfiles(std::vector<std::wstring>* profiles) const {
- // This function should be called on the file thread.
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
- file_util::FileEnumerator file_enum(user_data_root_, false,
- file_util::FileEnumerator::DIRECTORIES);
- std::wstring folder_name;
- while (!(folder_name = file_enum.Next().ToWStringHack()).empty()) {
- folder_name = file_util::GetFilenameFromPath(folder_name);
- std::wstring profile_name;
- if (GetProfileNameFromFolderName(folder_name, &profile_name))
- profiles->push_back(profile_name);
- }
-}
-
-bool UserDataManager::CreateShortcutForProfileInFolder(
- const FilePath& folder,
- const std::wstring& profile_name) const {
-#if defined(OS_WIN)
- FilePath exe_path;
- if (!PathService::Get(base::FILE_EXE, &exe_path))
- return false;
-
- BrowserDistribution* dist = BrowserDistribution::GetDistribution();
-
- // Working directory.
- FilePath exe_folder = exe_path.DirName();
-
- // Command and arguments.
- std::wstring cmd;
- cmd = StringPrintf(L"\"%ls\"", exe_path.value().c_str());
- std::wstring user_data_dir = GetUserDataFolderForProfile(profile_name);
- std::wstring args = CommandLine::PrefixedSwitchStringWithValue(
- switches::kUserDataDir,
- user_data_dir);
- args = StringPrintf(L"\"%ls\"", args.c_str());
-
- // Shortcut path.
- std::wstring shortcut_name = l10n_util::GetStringF(
- IDS_START_IN_PROFILE_SHORTCUT_NAME,
- dist->GetAppShortCutName(),
- profile_name);
- shortcut_name.append(L".lnk");
- FilePath shortcut_path = folder.Append(shortcut_name);
-
- // Profile path from user_data_dir.
- FilePath profile_path = FilePath(user_data_dir).Append(
- chrome::kNotSignedInProfile);
-
- return file_util::CreateShortcutLink(
- cmd.c_str(),
- shortcut_path.value().c_str(),
- exe_folder.value().c_str(),
- args.c_str(),
- NULL,
- exe_path.value().c_str(),
- dist->GetIconIndex(),
- ShellIntegration::GetChromiumAppId(profile_path).c_str());
-#else
- // TODO(port): should probably use freedesktop.org standard for desktop files.
- // See shell_integration.h for an implementation; but this code is reportedly
- // obsolete.
- NOTIMPLEMENTED();
- return false;
-#endif
-}
-
-bool UserDataManager::CreateDesktopShortcutForProfile(
- const std::wstring& profile_name) const {
-#if defined(OS_WIN)
- std::wstring desktop_path;
- if (!ShellUtil::GetDesktopPath(false, &desktop_path))
- return false;
-
- return CreateShortcutForProfileInFolder(FilePath(desktop_path), profile_name);
-#else
- // TODO(port): should probably use freedesktop.org standard for desktop files.
- // See shell_integration.h for an implementation; but this code is reportedly
- // obsolete.
- NOTIMPLEMENTED();
- return false;
-#endif
-}
-
-void UserDataManager::RefreshUserDataDirProfiles() const {
- // UserDataDirProfilesUpdater will delete itself when done.
- UserDataDirProfilesUpdater* updater = new UserDataDirProfilesUpdater();
- updater->Run();
-}
-
-GetProfilesHelper::GetProfilesHelper(Delegate* delegate)
- : delegate_(delegate),
- message_loop_(NULL) {
-}
-
-void GetProfilesHelper::GetProfiles(MessageLoop* target_loop) {
- // If the target loop is not NULL then use the target loop, or if it's NULL
- // then use the current message loop to post a task on it later when we are
- // done building a list of profiles.
- if (target_loop) {
- message_loop_ = target_loop;
- } else {
- message_loop_ = MessageLoop::current();
- }
- DCHECK(message_loop_);
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
- NewRunnableMethod(this, &GetProfilesHelper::GetProfilesFromManager));
-}
-
-// Records that the delegate is closed.
-void GetProfilesHelper::OnDelegateDeleted() {
- delegate_ = NULL;
-}
-
-void GetProfilesHelper::GetProfilesFromManager() {
- // This function should be called on the file thread.
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
-
- // If the delegate is gone by now, no need to do any work.
- if (!delegate_)
- return;
-
- scoped_ptr< std::vector<std::wstring> > profiles(
- new std::vector<std::wstring>);
- UserDataManager::Get()->GetProfiles(profiles.get());
-
- // Post a task on the original thread to call the delegate.
- message_loop_->PostTask(
- FROM_HERE,
- NewRunnableMethod(this,
- &GetProfilesHelper::InvokeDelegate,
- profiles.release()));
-}
-
-void GetProfilesHelper::InvokeDelegate(std::vector<std::wstring>* profiles) {
- scoped_ptr< std::vector<std::wstring> > udd_profiles(profiles);
- // If the delegate is gone by now, no need to do any work.
- if (delegate_)
- delegate_->OnGetProfilesDone(*udd_profiles.get());
-}
diff --git a/chrome/browser/user_data_manager.h b/chrome/browser/user_data_manager.h
deleted file mode 100644
index ddcc43b..0000000
--- a/chrome/browser/user_data_manager.h
+++ /dev/null
@@ -1,159 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This class encapsulates the implementation of multiple profiles by using
-// the user-data-dir functionality.
-
-#ifndef CHROME_BROWSER_USER_DATA_MANAGER_H_
-#define CHROME_BROWSER_USER_DATA_MANAGER_H_
-
-#include <string>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "base/file_path.h"
-#include "base/ref_counted.h"
-
-class MessageLoop;
-
-// Provides an abstraction of profiles on top of the user data directory
-// feature. Given the root of the user data directories, it provides
-// functionality to enumerate the existing profiles and start Chrome in a
-// given profile.
-// Also holds a shared instance of its own for convenience though it's not a
-// singleton class. The shared instance should be created by the main thread,
-// then other threads can access and use the shared instance.
-class UserDataManager {
- public:
- // Creates the shared instance of this class. This method is not thread-safe,
- // so the shared instance should be created on the main thread.
- static UserDataManager* Create();
-
- // Returns the shared instance. CreateInstance must be called before callling
- // this method.
- static UserDataManager* Get();
-
- // Creates a new instance with the given root folder for storing user data
- // folders.
- explicit UserDataManager(const FilePath& user_data_root);
-
- ~UserDataManager();
-
- // Returns the name of the current profile.
- std::wstring current_profile_name() const { return current_profile_name_; }
-
- // Returns whether the current profile is the default profile or not.
- bool is_current_profile_default() const {
- return is_current_profile_default_;
- }
-
- // Populates the given vector with a list of all the profiles.
- // This function should be called on the file thread.
- void GetProfiles(std::vector<std::wstring>* profiles) const;
-
- // Creates a shortcut for the given profile name in |folder|.
- // Returns false if the shortcut creation fails; true otherwise.
- bool CreateShortcutForProfileInFolder(const FilePath& folder,
- const std::wstring& profile_name) const;
-
- // Creates a desktop shortcut for the given profile name.
- // Returns false if the shortcut creation fails; true otherwise.
- bool CreateDesktopShortcutForProfile(const std::wstring& profile_name) const;
-
- // Starts a new Chrome instance in the given profile name.
- void LaunchChromeForProfile(const std::wstring& profile_name) const;
-
- // Starts a new Chrome instance in the profile with the given index. The
- // index is zero based, and refers to the position of the profile in the
- // list of profile names in alphabetical order.
- // This method launches Chrome asynchornously since it enumerates profiles
- // on a separate thread.
- void LaunchChromeForProfile(int index) const;
-
- // Updates global user data dir profile list stored in g_browser_process.
- void RefreshUserDataDirProfiles() const;
-
- private:
- // Gets the name of the profile from the name of the folder.
- // Returns false if the folder does not correspond to a profile folder, true
- // otherwise.
- static bool GetProfileNameFromFolderName(const std::wstring& folder_name,
- std::wstring* profile_name);
-
- // Returns the name of the folder from the name of the profile.
- static std::wstring GetFolderNameFromProfileName(
- const std::wstring& profile_name);
-
- // Returns the path of the user data folder for the given profile.
- std::wstring GetUserDataFolderForProfile(
- const std::wstring& profile_name) const;
-
- // Shared instance.
- static UserDataManager* instance_;
-
- // Root folder.
- FilePath user_data_root_;
-
- // Current user data folder.
- std::wstring current_folder_name_;
-
- // Whether the current profile is the default profile.
- bool is_current_profile_default_;
-
- // Current profile name.
- std::wstring current_profile_name_;
-
- DISALLOW_COPY_AND_ASSIGN(UserDataManager);
-};
-
-// Helper class to enumerate the profiles asynchronously on the file thread.
-// It calls the given delegate instance when the enumeration is complete.
-// USAGE: Create an instance of the helper with a delegate instance, call the
-// asynchronous method GetProfiles. The delegate instance will be called when
-// enumerating profiles is done.
-// IMPORTANT: It's the responsibility of the caller to call OnDelegateDeleted
-// method when the delegate instance is deleted. Typically OnDelegateDeleted
-// should be called in the destructor of the delegate. This is the way to
-// tell the helper to not call the delegate when enumerating profiles is done.
-class GetProfilesHelper
- : public base::RefCountedThreadSafe<GetProfilesHelper> {
- public:
- // Interface the delegate classes should implement.
- class Delegate {
- public:
- virtual void OnGetProfilesDone(
- const std::vector<std::wstring>& profiles) = 0;
- virtual ~Delegate() { }
- };
-
- explicit GetProfilesHelper(Delegate* delegate);
-
- // Asynchronous call to get the list of profiles. Calls the delegate when done
- // on either the given target loop or the message loop on which this function
- // is called if target loop is NULL.
- void GetProfiles(MessageLoop* target_loop);
-
- // Records that the delegate is deleted.
- void OnDelegateDeleted();
-
- private:
- friend class base::RefCountedThreadSafe<GetProfilesHelper>;
-
- ~GetProfilesHelper() {}
-
- // Helper to get the profiles from user data manager.
- void GetProfilesFromManager();
-
- // Helper to invoke the delegate.
- void InvokeDelegate(std::vector<std::wstring>* profiles);
-
- // Delegate to call.
- Delegate* delegate_;
- // Message loop to post tasks on completion of loading profiles.
- MessageLoop* message_loop_;
-
- DISALLOW_COPY_AND_ASSIGN(GetProfilesHelper);
-};
-
-#endif // CHROME_BROWSER_USER_DATA_MANAGER_H_
diff --git a/chrome/browser/views/browser_dialogs.h b/chrome/browser/views/browser_dialogs.h
index b0075fb..1697f13 100644
--- a/chrome/browser/views/browser_dialogs.h
+++ b/chrome/browser/views/browser_dialogs.h
@@ -48,9 +48,6 @@ void ShowBugReportView(views::Window* parent,
void ShowClearBrowsingDataView(gfx::NativeWindow parent,
Profile* profile);
-// Shows the "Select profile" dialog. See SelectProfileDialog.
-void ShowSelectProfileDialog();
-
// Shows the "Importer" dialog. See ImporterView.
void ShowImporterView(views::Widget* parent,
Profile* profile);
diff --git a/chrome/browser/views/dialog_stubs_gtk.cc b/chrome/browser/views/dialog_stubs_gtk.cc
index ce19fa6..7e06c23 100644
--- a/chrome/browser/views/dialog_stubs_gtk.cc
+++ b/chrome/browser/views/dialog_stubs_gtk.cc
@@ -30,12 +30,6 @@ void ShowClearBrowsingDataView(views::Widget* parent,
profile);
}
-void ShowSelectProfileDialog() {
- // Only matters if we're going to support profile switching
- // (switches::kEnableUserDataDirProfiles).
- NOTIMPLEMENTED();
-}
-
void ShowImporterView(views::Widget* parent, Profile* profile) {
// Import currently doesn't matter.
NOTIMPLEMENTED();
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index 2aec7e8..7bc300f 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -1037,14 +1037,6 @@ void BrowserView::ShowPasswordManager() {
browser::ShowPasswordsExceptionsWindowView(browser_->profile());
}
-void BrowserView::ShowSelectProfileDialog() {
- browser::ShowSelectProfileDialog();
-}
-
-void BrowserView::ShowNewProfileDialog() {
- browser::ShowNewProfileDialog();
-}
-
void BrowserView::ShowRepostFormWarningDialog(TabContents* tab_contents) {
browser::ShowRepostFormWarningDialog(GetNativeHandle(), tab_contents);
}
diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h
index b017939..a4cdd57 100644
--- a/chrome/browser/views/frame/browser_view.h
+++ b/chrome/browser/views/frame/browser_view.h
@@ -309,8 +309,6 @@ class BrowserView : public BrowserBubbleHost,
virtual void ShowImportDialog();
virtual void ShowSearchEnginesDialog();
virtual void ShowPasswordManager();
- virtual void ShowSelectProfileDialog();
- virtual void ShowNewProfileDialog();
virtual void ShowRepostFormWarningDialog(TabContents* tab_contents);
virtual void ShowContentSettingsWindow(ContentSettingsType content_type,
Profile* profile);
diff --git a/chrome/browser/views/new_profile_dialog.cc b/chrome/browser/views/new_profile_dialog.cc
deleted file mode 100644
index 9672a7a..0000000
--- a/chrome/browser/views/new_profile_dialog.cc
+++ /dev/null
@@ -1,136 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/views/new_profile_dialog.h"
-
-#include <string>
-
-#include "app/l10n_util.h"
-#include "app/message_box_flags.h"
-#include "base/file_util.h"
-#include "base/i18n/file_util_icu.h"
-#include "base/logging.h"
-#include "base/path_service.h"
-#include "chrome/browser/user_data_manager.h"
-#include "grit/chromium_strings.h"
-#include "grit/generated_resources.h"
-#include "grit/locale_settings.h"
-#include "views/controls/message_box_view.h"
-#include "views/controls/textfield/textfield.h"
-#include "views/view.h"
-#include "views/window/window.h"
-
-#if defined(OS_WIN)
-#include "base/win_util.h"
-#endif // defined(OS_WIN)
-
-namespace browser {
-
-// Declared in browser_dialogs.h so others don't have to depend on our header.
-void ShowNewProfileDialog() {
- NewProfileDialog::RunDialog();
-}
-
-} // namespace browser
-
-// static
-void NewProfileDialog::RunDialog() {
- NewProfileDialog* dlg = new NewProfileDialog();
- views::Window::CreateChromeWindow(NULL, gfx::Rect(), dlg)->Show();
-}
-
-NewProfileDialog::NewProfileDialog() {
- std::wstring message_text = l10n_util::GetString(
- IDS_NEW_PROFILE_DIALOG_LABEL_TEXT);
- const int kDialogWidth = views::Window::GetLocalizedContentsWidth(
- IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS);
- const int kMessageBoxFlags = MessageBoxFlags::kFlagHasOKButton |
- MessageBoxFlags::kFlagHasCancelButton |
- MessageBoxFlags::kFlagHasPromptField;
- message_box_view_ = new MessageBoxView(kMessageBoxFlags,
- message_text.c_str(),
- std::wstring(),
- kDialogWidth);
- message_box_view_->SetCheckBoxLabel(
- l10n_util::GetString(IDS_NEW_PROFILE_DIALOG_CREATE_SHORTCUT_TEXT));
- message_box_view_->SetCheckBoxSelected(true);
- message_box_view_->text_box()->SetController(this);
-}
-
-NewProfileDialog::~NewProfileDialog() {
-}
-
-views::View* NewProfileDialog::GetInitiallyFocusedView() {
- views::Textfield* text_box = message_box_view_->text_box();
- DCHECK(text_box);
- return text_box;
-}
-
-bool NewProfileDialog::IsDialogButtonEnabled(
- MessageBoxFlags::DialogButton button) const {
- if (button == MessageBoxFlags::DIALOGBUTTON_OK) {
- std::wstring profile_name = message_box_view_->GetInputText();
-
-#if defined(OS_POSIX)
- std::string profile_name_narrow = WideToUTF8(profile_name);
- file_util::ReplaceIllegalCharactersInPath(&profile_name_narrow, '_');
- profile_name = UTF8ToWide(profile_name_narrow);
-#else
- file_util::ReplaceIllegalCharactersInPath(&profile_name, '_');
-#endif
- return !profile_name.empty() &&
- profile_name == message_box_view_->GetInputText();
- }
- return true;
-}
-
-std::wstring NewProfileDialog::GetWindowTitle() const {
- return l10n_util::GetString(IDS_NEW_PROFILE_DIALOG_TITLE);
-}
-
-void NewProfileDialog::DeleteDelegate() {
- delete this;
-}
-
-void NewProfileDialog::ContentsChanged(views::Textfield* sender,
- const std::wstring& new_contents) {
- GetDialogClientView()->UpdateDialogButtons();
-}
-
-bool NewProfileDialog::Accept() {
- std::wstring profile_name = message_box_view_->GetInputText();
- if (profile_name.empty()) {
- NOTREACHED();
- return true;
- }
- // Create a desktop shortcut if the corresponding checkbox is checked.
- if (message_box_view_->IsCheckBoxSelected()) {
- UserDataManager::Get()->CreateDesktopShortcutForProfile(
- profile_name);
- } else {
-#if defined(OS_WIN)
- if (win_util::GetWinVersion() >= win_util::WINVERSION_WIN7) {
- // For Win7, we need to have a shortcut in a place that Windows would
- // index to provide correct relaunch info.
- // See http://crbug.com/32106
- FilePath temp_path;
- if (PathService::Get(base::DIR_APP_DATA, &temp_path)) {
- temp_path = temp_path.Append(
- L"Microsoft\\Internet Explorer\\Quick Launch\\User Pinned");
- UserDataManager::Get()->CreateShortcutForProfileInFolder(
- temp_path,
- profile_name);
- }
- }
-#endif // defined(OS_WIN)
- }
-
- UserDataManager::Get()->LaunchChromeForProfile(profile_name);
- UserDataManager::Get()->RefreshUserDataDirProfiles();
- return true;
-}
-
-views::View* NewProfileDialog::GetContentsView() {
- return message_box_view_;
-}
diff --git a/chrome/browser/views/new_profile_dialog.h b/chrome/browser/views/new_profile_dialog.h
deleted file mode 100644
index 2ce169e..0000000
--- a/chrome/browser/views/new_profile_dialog.h
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// A dialog box that prompts the user to enter a profile name, and opens a new
-// window in that profile.
-
-#ifndef CHROME_BROWSER_VIEWS_NEW_PROFILE_DIALOG_H_
-#define CHROME_BROWSER_VIEWS_NEW_PROFILE_DIALOG_H_
-
-#include "base/basictypes.h"
-#include "base/message_loop.h"
-#include "chrome/browser/shell_dialogs.h"
-#include "views/controls/textfield/textfield.h"
-#include "views/window/dialog_delegate.h"
-
-class MessageBoxView;
-namespace views {
-class View;
-class Window;
-}
-
-// Dialog that prompts the user to create a new profile.
-class NewProfileDialog : public views::DialogDelegate,
- public views::Textfield::Controller {
- public:
- // Creates and runs the dialog.
- static void RunDialog();
- virtual ~NewProfileDialog();
-
- // views::DialogDelegate methods.
- virtual bool Accept();
- virtual views::View* GetInitiallyFocusedView();
- virtual bool IsDialogButtonEnabled(
- MessageBoxFlags::DialogButton button) const;
- virtual std::wstring GetWindowTitle() const;
- virtual void DeleteDelegate();
-
- // views::Textfield::Controller methods.
- virtual void ContentsChanged(views::Textfield* sender,
- const std::wstring& new_contents);
- virtual bool HandleKeystroke(views::Textfield* sender,
- const views::Textfield::Keystroke& key) {
- return false;
- }
-
- // views::WindowDelegate methods.
- virtual views::View* GetContentsView();
- virtual bool IsAlwaysOnTop() const { return false; }
- virtual bool IsModal() const { return false; }
-
- private:
- NewProfileDialog();
-
- MessageBoxView* message_box_view_;
-
- DISALLOW_COPY_AND_ASSIGN(NewProfileDialog);
-};
-
-#endif // CHROME_BROWSER_VIEWS_NEW_PROFILE_DIALOG_H_
diff --git a/chrome/browser/views/select_profile_dialog.cc b/chrome/browser/views/select_profile_dialog.cc
deleted file mode 100644
index f57fe6f..0000000
--- a/chrome/browser/views/select_profile_dialog.cc
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/views/select_profile_dialog.h"
-
-#include <string>
-
-#include "app/l10n_util.h"
-#include "base/logging.h"
-#include "base/string_util.h"
-#include "chrome/browser/user_data_manager.h"
-#include "chrome/browser/views/new_profile_dialog.h"
-#include "grit/chromium_strings.h"
-#include "grit/generated_resources.h"
-#include "grit/locale_settings.h"
-#include "views/controls/label.h"
-#include "views/controls/message_box_view.h"
-#include "views/grid_layout.h"
-#include "views/standard_layout.h"
-#include "views/view.h"
-#include "views/window/window.h"
-
-using views::ColumnSet;
-using views::GridLayout;
-
-namespace browser {
-
-// Defined in browser_dialogs so callers don't have to depend on our header.
-void ShowSelectProfileDialog() {
- SelectProfileDialog::RunDialog();
-}
-
-} // namespace browser
-
-// static
-void SelectProfileDialog::RunDialog() {
- // When the window closes, it will delete itself.
- SelectProfileDialog* dlg = new SelectProfileDialog();
- views::Window::CreateChromeWindow(NULL, gfx::Rect(), dlg)->Show();
-}
-
-SelectProfileDialog::SelectProfileDialog()
- : ALLOW_THIS_IN_INITIALIZER_LIST(helper_(new GetProfilesHelper(this))) {
- // We first create an instance of the helper and then setup controls. This
- // doesn't lead to race condition because once the helper is done with
- // enumerating profiles by examining the file system, it posts a task on the
- // thread it was called on. This is the same thread that the current code is
- // running on. So that task wouldn't get executed until we are done with
- // setup controls. Given that, we start the helper before setup controls so
- // that file enumeration can be done as soon as possible.
- helper_->GetProfiles(NULL);
- SetupControls();
-}
-
-SelectProfileDialog::~SelectProfileDialog() {
- helper_->OnDelegateDeleted();
-}
-
-gfx::Size SelectProfileDialog::GetPreferredSize() {
- return gfx::Size(views::Window::GetLocalizedContentsSize(
- IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS,
- IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES));
-}
-
-void SelectProfileDialog::PopulateProfilesComboBox(
- const std::vector<std::wstring>& profiles) {
- profiles_.insert(profiles_.begin(), profiles.begin(), profiles.end());
- profile_combobox_->ModelChanged();
- GetDialogClientView()->UpdateDialogButtons();
-}
-
-void SelectProfileDialog::Layout() {
- GetLayoutManager()->Layout(this);
-}
-
-views::View* SelectProfileDialog::GetInitiallyFocusedView() {
- return profile_combobox_;
-}
-
-std::wstring SelectProfileDialog::GetWindowTitle() const {
- return l10n_util::GetString(IDS_SELECT_PROFILE_DIALOG_TITLE);
-}
-
-bool SelectProfileDialog::Accept() {
- size_t index = profile_combobox_->selected_item();
- DCHECK_LE(index, profiles_.size());
- if (index == profiles_.size())
- NewProfileDialog::RunDialog();
- else
- UserDataManager::Get()->LaunchChromeForProfile(profiles_[index]);
- return true;
-}
-
-bool SelectProfileDialog::Cancel() {
- return true;
-}
-
-views::View* SelectProfileDialog::GetContentsView() {
- return this;
-}
-
-int SelectProfileDialog::GetItemCount() {
- // Always show one more item in the combo box that allows the user to select
- // <New Profile>.
- return profiles_.size() + 1;
-}
-
-std::wstring SelectProfileDialog::GetItemAt(int index) {
- size_t index_size_t = index;
- DCHECK_LE(index_size_t, profiles_.size());
- // For the last item in the drop down, return the <New Profile> text,
- // otherwise return the corresponding profile name from the vector.
- return index_size_t == profiles_.size() ?
- l10n_util::GetString(IDS_SELECT_PROFILE_DIALOG_NEW_PROFILE_ENTRY) :
- profiles_[index];
-}
-
-void SelectProfileDialog::OnGetProfilesDone(
- const std::vector<std::wstring>& profiles) {
- PopulateProfilesComboBox(profiles);
-}
-
-void SelectProfileDialog::SetupControls() {
- // Adds all controls.
- select_profile_label_ = new views::Label(
- l10n_util::GetString(IDS_SELECT_PROFILE_DIALOG_LABEL_TEXT));
- profile_combobox_ = new views::Combobox(this);
-
- // Arranges controls by using GridLayout.
- const int column_set_id = 0;
- GridLayout* layout = CreatePanelGridLayout(this);
- SetLayoutManager(layout);
- ColumnSet* column_set = layout->AddColumnSet(column_set_id);
- column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0,
- GridLayout::USE_PREF, 0, 0);
- column_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing);
- column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 0,
- GridLayout::FIXED, 200, 0);
-
- layout->StartRow(0, column_set_id);
- layout->AddView(select_profile_label_);
- layout->AddPaddingRow(0, kRelatedControlVerticalSpacing);
- layout->StartRow(0, column_set_id);
- layout->AddView(profile_combobox_);
-}
diff --git a/chrome/browser/views/select_profile_dialog.h b/chrome/browser/views/select_profile_dialog.h
deleted file mode 100644
index 9c309de..0000000
--- a/chrome/browser/views/select_profile_dialog.h
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// A dialog box that shows the user various profiles that currently exist
-// and lets the user select one.
-
-#ifndef CHROME_BROWSER_VIEWS_SELECT_PROFILE_DIALOG_H_
-#define CHROME_BROWSER_VIEWS_SELECT_PROFILE_DIALOG_H_
-
-#include <vector>
-
-#include "app/combobox_model.h"
-#include "base/basictypes.h"
-#include "base/message_loop.h"
-#include "base/ref_counted.h"
-#include "chrome/browser/shell_dialogs.h"
-#include "chrome/browser/user_data_manager.h"
-#include "views/controls/combobox/combobox.h"
-#include "views/window/dialog_delegate.h"
-
-class SelectProfileDialogHelper;
-namespace views {
-class Label;
-class Window;
-}
-
-// Dialog to allow the user to select a profile to open a new window.
-class SelectProfileDialog
- : public views::DialogDelegate,
- public views::View,
- public ComboboxModel,
- public GetProfilesHelper::Delegate {
- public:
- // Creates and runs the dialog.
- static void RunDialog();
-
- virtual ~SelectProfileDialog();
-
- // Populates the list of profiles from the given vector.
- void PopulateProfilesComboBox(const std::vector<std::wstring>& profiles);
-
- // Returns the profile name selected by the user.
- std::wstring profile_name() { return profile_name_; }
-
- // views::View methods.
- virtual gfx::Size GetPreferredSize();
- virtual void Layout();
-
- // views::DialogDelegate Methods:
- virtual bool Accept();
- virtual bool Cancel();
- virtual views::View* GetContentsView();
- virtual views::View* GetInitiallyFocusedView();
- virtual std::wstring GetWindowTitle() const;
- virtual bool IsModal() const { return false; }
-
- // ComboboxModel methods.
- virtual int GetItemCount();
- virtual std::wstring GetItemAt(int index);
-
- // GetProfilesHelper::Delegate method.
- virtual void OnGetProfilesDone(const std::vector<std::wstring>& profiles);
-
- private:
- SelectProfileDialog();
-
- // Sets up all UI controls for the dialog.
- void SetupControls();
-
- // UI controls.
- views::Combobox* profile_combobox_;
- views::Label* select_profile_label_;
-
- std::vector<std::wstring> profiles_;
- std::wstring profile_name_;
-
- // Helper instance that handles all task posting activities.
- scoped_refptr<GetProfilesHelper> helper_;
-
- DISALLOW_COPY_AND_ASSIGN(SelectProfileDialog);
-};
-
-#endif // CHROME_BROWSER_VIEWS_SELECT_PROFILE_DIALOG_H_
diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc
index 05f892d..62f8ea7 100644
--- a/chrome/browser/views/toolbar_view.cc
+++ b/chrome/browser/views/toolbar_view.cc
@@ -835,8 +835,6 @@ void ToolbarView::RunAppMenu(const gfx::Point& pt) {
bool destroyed_flag = false;
destroyed_flag_ = &destroyed_flag;
- if (app_menu_model_->BuildProfileSubMenu())
- app_menu_menu_->Rebuild();
for (size_t i = 0; i < menu_listeners_.size(); i++)
app_menu_menu_->AddMenuListener(menu_listeners_[i]);
app_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT);
diff --git a/chrome/browser/views/toolbar_view.h b/chrome/browser/views/toolbar_view.h
index 4b389c6..a2bc4df 100644
--- a/chrome/browser/views/toolbar_view.h
+++ b/chrome/browser/views/toolbar_view.h
@@ -215,8 +215,8 @@ class ToolbarView : public AccessibleToolbarView,
DisplayMode display_mode_;
// The contents of the various menus.
- scoped_ptr<PageMenuModel> page_menu_model_;
- scoped_ptr<AppMenuModel> app_menu_model_;
+ scoped_ptr<menus::SimpleMenuModel> page_menu_model_;
+ scoped_ptr<menus::SimpleMenuModel> app_menu_model_;
// TODO(beng): build these into MenuButton.
scoped_ptr<views::Menu2> page_menu_menu_;
diff --git a/chrome/browser/wrench_menu_model.h b/chrome/browser/wrench_menu_model.h
index d010518..8bd65ff 100644
--- a/chrome/browser/wrench_menu_model.h
+++ b/chrome/browser/wrench_menu_model.h
@@ -11,7 +11,6 @@
#include "app/menus/simple_menu_model.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
-#include "chrome/browser/user_data_manager.h"
class Browser;
class EncodingMenuModel;
@@ -59,10 +58,6 @@ class WrenchMenuModel : public menus::SimpleMenuModel {
string16 GetAboutEntryMenuLabel() const;
bool IsDynamicItem(int index) const;
- // Profile names that are in profiles_menu_contents_. This is used to
- // detect profile change.
- std::vector<std::wstring> known_profiles_;
-
// Tools menu.
scoped_ptr<ToolsMenuModel> tools_menu_model_;
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 35b82ca..3131dcb 100755
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -2247,8 +2247,6 @@
'browser/translate/translate_prefs.h',
'browser/upgrade_detector.cc',
'browser/upgrade_detector.h',
- 'browser/user_data_manager.cc',
- 'browser/user_data_manager.h',
'browser/user_style_sheet_watcher.cc',
'browser/user_style_sheet_watcher.h',
'browser/utility_process_host.cc',
@@ -2472,8 +2470,6 @@
'browser/views/login_view.h',
'browser/views/modal_dialog_delegate.cc',
'browser/views/modal_dialog_delegate.h',
- 'browser/views/new_profile_dialog.cc',
- 'browser/views/new_profile_dialog.h',
'browser/views/notifications/balloon_view_host.cc',
'browser/views/notifications/balloon_view_host.h',
'browser/views/notifications/balloon_view.cc',
@@ -2531,8 +2527,6 @@
'browser/views/sad_tab_view.cc',
'browser/views/sad_tab_view.h',
'browser/views/select_file_dialog.cc',
- 'browser/views/select_profile_dialog.cc',
- 'browser/views/select_profile_dialog.h',
'browser/views/shell_dialogs_win.cc',
'browser/views/status_bubble_views.cc',
'browser/views/status_bubble_views.h',
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 404c18c..1645ba1 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -372,10 +372,6 @@ const char kEnableSyncTypedUrls[] = "enable-sync-typed-urls";
// Whether or not the touch events API is exposed.
const char kEnableTouch[] = "enable-touch";
-// Whether the multiple profiles feature based on the user-data-dir flag is
-// enabled or not.
-const char kEnableUserDataDirProfiles[] = "enable-udd-profiles";
-
// Enables the option to show tabs as a vertical stack down the side of the
// browser window.
const char kEnableVerticalTabs[] = "enable-vertical-tabs";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index e7d3ec2..57e6d15 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -123,7 +123,6 @@ extern const char kEnableSyncPreferences[];
extern const char kEnableSyncThemes[];
extern const char kEnableSyncTypedUrls[];
extern const char kEnableTouch[];
-extern const char kEnableUserDataDirProfiles[];
extern const char kEnableVerticalTabs[];
extern const char kEnableVideoLayering[];
extern const char kEnableVideoLogging[];
diff --git a/chrome/test/test_browser_window.h b/chrome/test/test_browser_window.h
index 77874e6..b35e070 100644
--- a/chrome/test/test_browser_window.h
+++ b/chrome/test/test_browser_window.h
@@ -80,8 +80,6 @@ class TestBrowserWindow : public BrowserWindow {
virtual void ShowImportDialog() {}
virtual void ShowSearchEnginesDialog() {}
virtual void ShowPasswordManager() {}
- virtual void ShowSelectProfileDialog() {}
- virtual void ShowNewProfileDialog() {}
virtual void ShowRepostFormWarningDialog(TabContents* tab_contents) {}
virtual void ShowContentSettingsWindow(ContentSettingsType content_type,
Profile* profile) {}