| Index: chrome/browser/ui/webui/settings/appearance_handler.cc
|
| diff --git a/chrome/browser/ui/webui/settings/appearance_handler.cc b/chrome/browser/ui/webui/settings/appearance_handler.cc
|
| index d9560170dba7330a3cf8b82c25fa9f2cb7da6d15..dcb34f393213a28e7f5ba3c4b7f578b26c6d8a43 100644
|
| --- a/chrome/browser/ui/webui/settings/appearance_handler.cc
|
| +++ b/chrome/browser/ui/webui/settings/appearance_handler.cc
|
| @@ -43,10 +43,10 @@ void AppearanceHandler::Observe(
|
| const content::NotificationDetails& details) {
|
| switch (type) {
|
| case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: {
|
| - base::StringValue event("reset-theme-enabled-changed");
|
| - base::FundamentalValue enabled(QueryResetThemeEnabledState());
|
| web_ui()->CallJavascriptFunction(
|
| - "cr.webUIListenerCallback", event, enabled);
|
| + "cr.webUIListenerCallback",
|
| + base::StringValue("reset-theme-enabled-changed"),
|
| + base::FundamentalValue(ResetThemeEnabled()));
|
| break;
|
| }
|
| default:
|
| @@ -55,19 +55,12 @@ void AppearanceHandler::Observe(
|
| }
|
|
|
| void AppearanceHandler::ResetTheme(const base::ListValue* /* args */) {
|
| - Profile* profile = Profile::FromWebUI(web_ui());
|
| - ThemeServiceFactory::GetForProfile(profile)->UseDefaultTheme();
|
| + ThemeServiceFactory::GetForProfile(profile_)->UseDefaultTheme();
|
| }
|
|
|
| -base::FundamentalValue AppearanceHandler::QueryResetThemeEnabledState() {
|
| - ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_);
|
| - bool is_system_theme = false;
|
| -
|
| +bool AppearanceHandler::ResetThemeEnabled() const {
|
| // TODO(jhawkins): Handle native/system theme button.
|
| -
|
| - bool is_classic_theme = !is_system_theme &&
|
| - theme_service->UsingDefaultTheme();
|
| - return base::FundamentalValue(!is_classic_theme);
|
| + return !ThemeServiceFactory::GetForProfile(profile_)->UsingDefaultTheme();
|
| }
|
|
|
| void AppearanceHandler::GetResetThemeEnabled(const base::ListValue* args) {
|
| @@ -75,8 +68,8 @@ void AppearanceHandler::GetResetThemeEnabled(const base::ListValue* args) {
|
| const base::Value* callback_id;
|
| CHECK(args->Get(0, &callback_id));
|
|
|
| - base::FundamentalValue enabled(QueryResetThemeEnabledState());
|
| - ResolveJavascriptCallback(*callback_id, enabled);
|
| + ResolveJavascriptCallback(*callback_id,
|
| + base::FundamentalValue(ResetThemeEnabled()));
|
| }
|
|
|
| } // namespace settings
|
|
|