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

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

Issue 10391044: retry 136193 - convert localStrings to loadTimeData for options page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 7 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/resources/options2/browser_options.js
diff --git a/chrome/browser/resources/options2/browser_options.js b/chrome/browser/resources/options2/browser_options.js
index e11f831727109789a60a47c5b8ee5d52acb0584b..f9190c6c1a9c079c47dd3345b6424e7ed73afe5a 100644
--- a/chrome/browser/resources/options2/browser_options.js
+++ b/chrome/browser/resources/options2/browser_options.js
@@ -12,7 +12,7 @@ cr.define('options', function() {
// Encapsulated handling of browser options page.
//
function BrowserOptions() {
- OptionsPage.call(this, 'settings', templateData.settingsTitle,
+ OptionsPage.call(this, 'settings', loadTimeData.getString('settingsTitle'),
'settings');
}
@@ -89,7 +89,7 @@ cr.define('options', function() {
UIAccountTweaks.applyGuestModeVisibility(document);
// Sync (Sign in) section.
- this.updateSyncState_(templateData.syncData);
+ this.updateSyncState_(loadTimeData.getValue('syncData'));
$('sync-action-link').onclick = function(event) {
SyncSetupOverlay.showErrorUI();
@@ -122,8 +122,9 @@ cr.define('options', function() {
// restore changes has stabilized. For now, only the startup option is
// renamed to "continue where I left off", but the session related content
// settings are not disabled or overridden (because
- // templateData.enable_restore_session_state is forced to false).
- this.sessionRestoreEnabled_ = templateData.enable_restore_session_state;
+ // 'enable_restore_session_state' is forced to false).
+ this.sessionRestoreEnabled_ =
+ loadTimeData.getBoolean('enable_restore_session_state');
if (this.sessionRestoreEnabled_) {
$('startup-restore-session').onclick = function(event) {
if (!event.currentTarget.checked)
@@ -156,7 +157,7 @@ cr.define('options', function() {
}
$('themes-gallery').onclick = function(event) {
- window.open(localStrings.getString('themesGalleryURL'));
+ window.open(loadTimeData.getString('themesGalleryURL'));
};
$('themes-reset').onclick = function(event) {
chrome.send('themesReset');
@@ -212,14 +213,14 @@ cr.define('options', function() {
});
// Users section.
- if (typeof templateData.profilesInfo != 'undefined') {
+ if (loadTimeData.valueExists('profilesInfo')) {
$('profiles-section').hidden = false;
var profilesList = $('profiles-list');
options.browser_options.ProfileList.decorate(profilesList);
profilesList.autoExpands = true;
- this.setProfilesInfo_(templateData.profilesInfo);
+ this.setProfilesInfo_(loadTimeData.getValue('profilesInfo'));
profilesList.addEventListener('change',
this.setProfileViewButtonsStatus_);
@@ -247,7 +248,7 @@ cr.define('options', function() {
// Username (canonical email) of the currently logged in user or
// |kGuestUser| if a guest session is active.
- this.username_ = localStrings.getString('username');
+ this.username_ = loadTimeData.getString('username');
this.updateAccountPicture_();
@@ -374,8 +375,10 @@ cr.define('options', function() {
$('manage-passwords').disabled = true;
}
- if (cr.isMac)
- $('mac-passwords-warning').hidden = !templateData.multiple_profiles;
+ if (cr.isMac) {
+ $('mac-passwords-warning').hidden =
+ !loadTimeData.getBoolean('multiple_profiles');
+ }
// Network section.
if (!cr.isChromeOS) {
@@ -443,7 +446,7 @@ cr.define('options', function() {
if ($('cloudPrintManageButton').style.display == 'none') {
// Disable the button, set its text to the intermediate state.
$('cloudPrintConnectorSetupButton').textContent =
- localStrings.getString('cloudPrintConnectorEnablingButton');
+ loadTimeData.getString('cloudPrintConnectorEnablingButton');
$('cloudPrintConnectorSetupButton').disabled = true;
chrome.send('showCloudPrintSetupDialog');
} else {
@@ -615,9 +618,9 @@ cr.define('options', function() {
updateAdvancedSettingsExpander_: function() {
var expander = $('advanced-settings-expander');
if ($('advanced-settings').style.height == '')
- expander.textContent = localStrings.getString('showAdvancedSettings');
+ expander.textContent = loadTimeData.getString('showAdvancedSettings');
else
- expander.textContent = localStrings.getString('hideAdvancedSettings');
+ expander.textContent = loadTimeData.getString('hideAdvancedSettings');
},
/**
@@ -643,10 +646,10 @@ cr.define('options', function() {
syncData.setupCompleted && cr.isChromeOS;
startStopButton.textContent =
syncData.setupCompleted ?
- localStrings.getString('syncButtonTextStop') :
+ loadTimeData.getString('syncButtonTextStop') :
syncData.setupInProgress ?
- localStrings.getString('syncButtonTextInProgress') :
- localStrings.getString('syncButtonTextStart');
+ loadTimeData.getString('syncButtonTextInProgress') :
+ loadTimeData.getString('syncButtonTextStart');
// TODO(estade): can this just be textContent?
@@ -970,8 +973,8 @@ cr.define('options', function() {
$('profiles-single-message').hidden = !hasSingleProfile;
$('profiles-manage').hidden = hasSingleProfile;
$('profiles-delete').textContent = hasSingleProfile ?
- templateData.profilesDeleteSingle :
- templateData.profilesDelete;
+ loadTimeData.getString('profilesDeleteSingle') :
+ loadTimeData.getString('profilesDelete');
},
/**
@@ -1061,7 +1064,7 @@ cr.define('options', function() {
// Add/Select Custom Option in the font size label list.
if (!$('Custom')) {
- var option = new Option(localStrings.getString('fontSizeLabelCustom'),
+ var option = new Option(loadTimeData.getString('fontSizeLabelCustom'),
-1, false, true);
option.setAttribute('id', 'Custom');
selectCtl.add(option);
@@ -1161,11 +1164,11 @@ cr.define('options', function() {
$('cloudPrintConnectorLabel').textContent = label;
if (disabled || !allowed) {
$('cloudPrintConnectorSetupButton').textContent =
- localStrings.getString('cloudPrintConnectorDisabledButton');
+ loadTimeData.getString('cloudPrintConnectorDisabledButton');
$('cloudPrintManageButton').style.display = 'none';
} else {
$('cloudPrintConnectorSetupButton').textContent =
- localStrings.getString('cloudPrintConnectorEnabledButton');
+ loadTimeData.getString('cloudPrintConnectorEnabledButton');
$('cloudPrintManageButton').style.display = 'inline';
}
$('cloudPrintConnectorSetupButton').disabled = !allowed;

Powered by Google App Engine
This is Rietveld 408576698