Commit 38c5ca50 authored by ibraaaa@chromium.org's avatar ibraaaa@chromium.org

Request profiles info in BrowserOptions.initializePage to populate the profiles list

Profiles info is being passed to JS in |BrowserOptionsHandler::GetLocalizedValues| which gets called only once when the settings page is opened but not on page reload.
When a user edits in the profiles list (adds or deletes a profile) and then reload the settings page we end up populating the profiles list with old cached data. Accordingly,
we request the profiles info in BrowserOptions.initializePage to get a fresh list of the profiles info every time the page is loaded.

BUG=269942

Review URL: https://chromiumcodereview.appspot.com/22642011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216797 0039d316-1c4b-4281-b951-d872f2087c98
parent ee24d3ff
......@@ -178,7 +178,9 @@ cr.define('options', function() {
options.browser_options.ProfileList.decorate(profilesList);
profilesList.autoExpands = true;
// The profiles info data in |loadTimeData| might be stale.
this.setProfilesInfo_(loadTimeData.getValue('profilesInfo'));
chrome.send('requestProfilesInfo');
profilesList.addEventListener('change',
this.setProfileViewButtonsStatus_);
......
......@@ -585,6 +585,10 @@ void BrowserOptionsHandler::RegisterMessages() {
"themesReset",
base::Bind(&BrowserOptionsHandler::ThemesReset,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"requestProfilesInfo",
base::Bind(&BrowserOptionsHandler::HandleRequestProfilesInfo,
base::Unretained(this)));
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
web_ui()->RegisterMessageCallback(
"themesSetNative",
......@@ -1484,6 +1488,10 @@ void BrowserOptionsHandler::HandleRestartBrowser(const ListValue* args) {
chrome::AttemptRestart();
}
void BrowserOptionsHandler::HandleRequestProfilesInfo(const ListValue* args) {
SendProfilesInfo();
}
#if !defined(OS_CHROMEOS)
void BrowserOptionsHandler::ShowNetworkProxySettings(const ListValue* args) {
content::RecordAction(UserMetricsAction("Options_ShowProxySettings"));
......
......@@ -228,6 +228,9 @@ class BrowserOptionsHandler
// Callback for the "restartBrowser" message. Restores all tabs on restart.
void HandleRestartBrowser(const ListValue* args);
// Callback for "requestProfilesInfo" message.
void HandleRequestProfilesInfo(const ListValue* args);
#if !defined(OS_CHROMEOS)
// Callback for the "showNetworkProxySettings" message. This will invoke
// an appropriate dialog for configuring proxy settings.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment