OLD | NEW |
---|---|
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/settings/appearance_handler.h" | 5 #include "chrome/browser/ui/webui/settings/appearance_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 bool is_system_theme = false; | 64 bool is_system_theme = false; |
65 | 65 |
66 // TODO(jhawkins): Handle native/system theme button. | 66 // TODO(jhawkins): Handle native/system theme button. |
67 | 67 |
68 bool is_classic_theme = !is_system_theme && | 68 bool is_classic_theme = !is_system_theme && |
69 theme_service->UsingDefaultTheme(); | 69 theme_service->UsingDefaultTheme(); |
70 return base::FundamentalValue(!is_classic_theme); | 70 return base::FundamentalValue(!is_classic_theme); |
71 } | 71 } |
72 | 72 |
73 void AppearanceHandler::GetResetThemeEnabled(const base::ListValue* args) { | 73 void AppearanceHandler::GetResetThemeEnabled(const base::ListValue* args) { |
74 CHECK_EQ(2U, args->GetSize()); | 74 CHECK_EQ(1U, args->GetSize()); |
75 | |
76 std::string callbackFn; | |
77 CHECK(args->GetString(0, &callbackFn)); | |
78 const base::Value* callbackId; | 75 const base::Value* callbackId; |
Dan Beam
2016/01/27 00:23:57
callback_id
dpapad
2016/01/27 00:45:23
Done.
| |
79 CHECK(args->Get(1, &callbackId)); | 76 CHECK(args->Get(0, &callbackId)); |
80 | 77 |
81 base::FundamentalValue enabled(QueryResetThemeEnabledState()); | 78 base::FundamentalValue enabled(QueryResetThemeEnabledState()); |
82 web_ui()->CallJavascriptFunction(callbackFn, *callbackId, enabled); | 79 CallJavascriptCallback(web_ui(), *callbackId, enabled); |
83 } | 80 } |
84 | 81 |
85 } // namespace settings | 82 } // namespace settings |
OLD | NEW |