summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-23 00:26:56 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-23 00:26:56 +0000
commit52426e4c3b775666fa9fd52e1c52f8dbbbaadd49 (patch)
tree29414fc9395df69c74b3cffb9a60743d14d32a40
parent7de53a19c7676feffa9c70e97ec9aa60b2836517 (diff)
downloadchromium_src-52426e4c3b775666fa9fd52e1c52f8dbbbaadd49.zip
chromium_src-52426e4c3b775666fa9fd52e1c52f8dbbbaadd49.tar.gz
chromium_src-52426e4c3b775666fa9fd52e1c52f8dbbbaadd49.tar.bz2
DOMUI: Properly disabled the 'Reset theme' button when the current theme is the
classic theme. BUG=59080 TEST=none Review URL: http://codereview.chromium.org/5282001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67028 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/dom_ui/options/personal_options_handler.cc8
-rw-r--r--chrome/browser/resources/options/personal_options.html6
-rw-r--r--chrome/browser/resources/options/personal_options.js33
3 files changed, 19 insertions, 28 deletions
diff --git a/chrome/browser/dom_ui/options/personal_options_handler.cc b/chrome/browser/dom_ui/options/personal_options_handler.cc
index 3a39b10..84b3fd3 100644
--- a/chrome/browser/dom_ui/options/personal_options_handler.cc
+++ b/chrome/browser/dom_ui/options/personal_options_handler.cc
@@ -101,7 +101,7 @@ void PersonalOptionsHandler::GetLocalizedValues(
l10n_util::GetStringUTF16(IDS_APPEARANCE_GROUP_NAME));
localized_strings->SetString("themes_GTK_button",
l10n_util::GetStringUTF16(IDS_THEMES_GTK_BUTTON));
- localized_strings->SetString("themes_set_classic",
+ localized_strings->SetString("themesSetClassic",
l10n_util::GetStringUTF16(IDS_THEMES_SET_CLASSIC));
localized_strings->SetString("showWindow_decorations_radio",
l10n_util::GetStringUTF16(IDS_SHOW_WINDOW_DECORATIONS_RADIO));
@@ -110,7 +110,7 @@ void PersonalOptionsHandler::GetLocalizedValues(
#else
localized_strings->SetString("themes",
l10n_util::GetStringUTF16(IDS_THEMES_GROUP_NAME));
- localized_strings->SetString("themes_reset",
+ localized_strings->SetString("themesReset",
l10n_util::GetStringUTF16(IDS_THEMES_RESET_BUTTON));
localized_strings->SetString("themes_default",
l10n_util::GetStringUTF16(IDS_THEMES_DEFAULT_THEME_LABEL));
@@ -245,9 +245,9 @@ void PersonalOptionsHandler::ObserveThemeChanged() {
#endif
bool is_classic_theme = !is_gtk_theme && provider->GetThemeID().empty();
- FundamentalValue classic_enabled(!is_classic_theme);
+ FundamentalValue enabled(!is_classic_theme);
dom_ui_->CallJavascriptFunction(
- L"options.PersonalOptions.setClassicThemeButtonEnabled", classic_enabled);
+ L"options.PersonalOptions.setThemesResetButtonEnabled", enabled);
}
void PersonalOptionsHandler::Initialize() {
diff --git a/chrome/browser/resources/options/personal_options.html b/chrome/browser/resources/options/personal_options.html
index 440bbda..48bd944 100644
--- a/chrome/browser/resources/options/personal_options.html
+++ b/chrome/browser/resources/options/personal_options.html
@@ -72,8 +72,8 @@
<div>
<button id="themes_GTK_button"
i18n-content="themes_GTK_button"></button>
- <button id="themes_set_classic"
- i18n-content="themes_set_classic"></button>
+ <button id="themes-reset"
+ i18n-content="themesSetClassic"></button>
<a id="themes-gallery" i18n-content="themes_gallery"
i18n-values="href:themes_gallery_url" target="_blank"></a>
</div>
@@ -96,7 +96,7 @@
<section>
<h3 i18n-content="themes"></h3>
<div>
- <button id="themes_reset" i18n-content="themes_reset"></button>
+ <button id="themes-reset" i18n-content="themesReset"></button>
<a id="themes-gallery" i18n-content="themes_gallery"
i18n-values="href:themes_gallery_url" target="_blank"></a>
</div>
diff --git a/chrome/browser/resources/options/personal_options.js b/chrome/browser/resources/options/personal_options.js
index 58a5481..266cce9 100644
--- a/chrome/browser/resources/options/personal_options.js
+++ b/chrome/browser/resources/options/personal_options.js
@@ -58,30 +58,23 @@ cr.define('options', function() {
chrome.send('coreOptionsUserMetricsAction',
['Options_ShowAutoFillSettings']);
};
+ $('themes-reset').onclick = function(event) {
+ chrome.send('themesReset');
+ };
if (!cr.isChromeOS) {
$('import_data').onclick = function(event) {
OptionsPage.showOverlay('importDataOverlay');
chrome.send('coreOptionsUserMetricsAction', ['Import_ShowDlg']);
};
- }
- if (!cr.isChromeOS && navigator.platform.match(/linux|BSD/i)) {
- $('themes_GTK_button').onclick = function(event) {
- chrome.send('themesSetGTK');
- };
- $('themes_set_classic').onclick = function(event) {
- chrome.send('themesReset');
- };
+ if (navigator.platform.match(/linux|BSD/i)) {
+ $('themes_GTK_button').onclick = function(event) {
+ chrome.send('themesSetGTK');
+ };
+ }
}
-
- if (cr.isMac || cr.isWindows || cr.isChromeOS) {
- $('themes_reset').onclick = function(event) {
- chrome.send('themesReset');
- };
- }
-
- if (cr.isChromeOS) {
+ else {
chrome.send('loadAccountPicture');
}
},
@@ -173,10 +166,8 @@ cr.define('options', function() {
}
},
- setClassicThemeButtonEnabled_: function(enabled) {
- if (!cr.isChromeOS && navigator.platform.match(/linux|BSD/i)) {
- $('themes_set_classic').disabled = !enabled;
- }
+ setThemesResetButtonEnabled_: function(enabled) {
+ $('themes-reset').disabled = !enabled;
},
hideSyncSection_: function() {
@@ -201,7 +192,7 @@ cr.define('options', function() {
'setCustomizeButtonEnabled',
'setCustomizeButtonLabel',
'setGtkThemeButtonEnabled',
- 'setClassicThemeButtonEnabled',
+ 'setThemesResetButtonEnabled',
'hideSyncSection',
].forEach(function(name) {
PersonalOptions[name] = function(value) {