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

Unified Diff: chrome/browser/resources/options2/browser_options.js

Issue 10139019: [webui settings] send user profiles info earlier during load (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make return type scoped_ptr Created 8 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options2/browser_options_handler2.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options2/browser_options.js
diff --git a/chrome/browser/resources/options2/browser_options.js b/chrome/browser/resources/options2/browser_options.js
index b4e324b2dd478bb80b30566d66fd8f04e2518027..96b856e7466017931d7bd1fa6575046858e0dbde 100644
--- a/chrome/browser/resources/options2/browser_options.js
+++ b/chrome/browser/resources/options2/browser_options.js
@@ -208,25 +208,31 @@ cr.define('options', function() {
});
// Users section.
- var profilesList = $('profiles-list');
- options.browser_options.ProfileList.decorate(profilesList);
- profilesList.autoExpands = true;
+ if (typeof templateData.profilesInfo != 'undefined') {
+ $('profiles-section').hidden = false;
- profilesList.addEventListener('change',
- this.setProfileViewButtonsStatus_);
- $('profiles-create').onclick = function(event) {
- chrome.send('createProfile');
- };
- $('profiles-manage').onclick = function(event) {
- var selectedProfile = self.getSelectedProfileItem_();
- if (selectedProfile)
- ManageProfileOverlay.showManageDialog(selectedProfile);
- };
- $('profiles-delete').onclick = function(event) {
- var selectedProfile = self.getSelectedProfileItem_();
- if (selectedProfile)
- ManageProfileOverlay.showDeleteDialog(selectedProfile);
- };
+ var profilesList = $('profiles-list');
+ options.browser_options.ProfileList.decorate(profilesList);
+ profilesList.autoExpands = true;
+
+ this.setProfilesInfo_(templateData.profilesInfo);
+
+ profilesList.addEventListener('change',
+ this.setProfileViewButtonsStatus_);
+ $('profiles-create').onclick = function(event) {
+ chrome.send('createProfile');
+ };
+ $('profiles-manage').onclick = function(event) {
+ var selectedProfile = self.getSelectedProfileItem_();
+ if (selectedProfile)
+ ManageProfileOverlay.showManageDialog(selectedProfile);
+ };
+ $('profiles-delete').onclick = function(event) {
+ var selectedProfile = self.getSelectedProfileItem_();
+ if (selectedProfile)
+ ManageProfileOverlay.showDeleteDialog(selectedProfile);
+ };
+ }
if (cr.isChromeOS) {
if (!UIAccountTweaks.loggedInAsGuest()) {
@@ -664,16 +670,6 @@ cr.define('options', function() {
},
/**
- * Display or hide the profiles section of the page. This is used for
- * multi-profile settings.
- * @param {boolean} visible True to show the section.
- * @private
- */
- setProfilesSectionVisible_: function(visible) {
- $('profiles-section').hidden = !visible;
- },
-
- /**
* Get the start/stop sync button DOM element. Used for testing.
* @return {DOMElement} The start/stop sync button.
* @private
@@ -1375,7 +1371,6 @@ cr.define('options', function() {
'setMetricsReportingCheckboxState',
'setMetricsReportingSettingVisibility',
'setProfilesInfo',
- 'setProfilesSectionVisible',
'setScreenMagnifierCheckboxState',
'setSpokenFeedbackCheckboxState',
'setThemesResetButtonEnabled',
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options2/browser_options_handler2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698