Chromium Code Reviews| 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..c2f311b3d41b1ed8efda7f64efcdc31b39b8f247 100644 |
| --- a/chrome/browser/ui/webui/settings/appearance_handler.cc |
| +++ b/chrome/browser/ui/webui/settings/appearance_handler.cc |
| @@ -44,7 +44,7 @@ void AppearanceHandler::Observe( |
| switch (type) { |
| case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: { |
| base::StringValue event("reset-theme-enabled-changed"); |
| - base::FundamentalValue enabled(QueryResetThemeEnabledState()); |
| + base::FundamentalValue enabled(ResetThemeEnabled()); |
| web_ui()->CallJavascriptFunction( |
| "cr.webUIListenerCallback", event, enabled); |
| break; |
| @@ -59,15 +59,9 @@ void AppearanceHandler::ResetTheme(const base::ListValue* /* args */) { |
| 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,7 +69,7 @@ void AppearanceHandler::GetResetThemeEnabled(const base::ListValue* args) { |
| const base::Value* callback_id; |
| CHECK(args->Get(0, &callback_id)); |
| - base::FundamentalValue enabled(QueryResetThemeEnabledState()); |
| + base::FundamentalValue enabled(ResetThemeEnabled()); |
| ResolveJavascriptCallback(*callback_id, enabled); |
|
dpapad
2016/03/30 17:15:26
Nit(optional): Maybe Inline local var.
ResolveJav
Dan Beam
2016/03/30 23:22:37
Done.
|
| } |