Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5706)

Unified Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 22642011: Request profiles info in BrowserOptions.initializePage to populate the profiles list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/browser_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index bc9f5c15671730b01e2e23f25a92ed2f13d7fc5e..197b1b736243230ad3439504b898c359bb0a7617 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -514,9 +514,8 @@ void BrowserOptionsHandler::GetLocalizedValues(DictionaryValue* values) {
values->SetBoolean("multiple_profiles",
g_browser_process->profile_manager()->GetNumberOfProfiles() > 1);
#endif
-
- if (ShouldShowMultiProfilesUserList(GetDesktopType()))
- values->Set("profilesInfo", GetProfilesInfoList().release());
+ values->SetBoolean("showProfilesSection",
+ ShouldShowMultiProfilesUserList(GetDesktopType()));
values->SetBoolean("profileIsManaged",
Profile::FromWebUI(web_ui())->IsManaged());
@@ -585,6 +584,10 @@ void BrowserOptionsHandler::RegisterMessages() {
"themesReset",
base::Bind(&BrowserOptionsHandler::ThemesReset,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "requestProfilesInfo",
+ base::Bind(&BrowserOptionsHandler::RequestProfilesInfo,
+ base::Unretained(this)));
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
web_ui()->RegisterMessageCallback(
"themesSetNative",
@@ -1484,6 +1487,10 @@ void BrowserOptionsHandler::HandleRestartBrowser(const ListValue* args) {
chrome::AttemptRestart();
}
+void BrowserOptionsHandler::RequestProfilesInfo(const ListValue* args) {
+ SendProfilesInfo();
+}
+
#if !defined(OS_CHROMEOS)
void BrowserOptionsHandler::ShowNetworkProxySettings(const ListValue* args) {
content::RecordAction(UserMetricsAction("Options_ShowProxySettings"));

Powered by Google App Engine
This is Rietveld 408576698