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', |