Chromium Code Reviews| Index: chrome/browser/ui/webui/settings/settings_page_ui_handler.cc |
| diff --git a/chrome/browser/ui/webui/settings/settings_page_ui_handler.cc b/chrome/browser/ui/webui/settings/settings_page_ui_handler.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cee0d6940a98797a7aa5b9c433f9579bfe0aa27e |
| --- /dev/null |
| +++ b/chrome/browser/ui/webui/settings/settings_page_ui_handler.cc |
| @@ -0,0 +1,33 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
|
dpapad
2016/03/10 18:04:47
Nit: 2016?
Dan Beam
2016/03/11 06:38:01
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" |
| + |
| +#include "content/public/browser/web_ui.h" |
| + |
| +namespace settings { |
| + |
| +SettingsPageUIHandler::SettingsPageUIHandler() {} |
| + |
| +SettingsPageUIHandler::~SettingsPageUIHandler() {} |
| + |
| +void SettingsPageUIHandler::ResolveJavascriptCallback( |
| + const base::Value& callback_id, |
| + const base::Value& response) { |
| + // cr.webUIResponse is a global JS function exposed from cr.js. |
| + web_ui()->CallJavascriptFunction( |
| + "cr.webUIResponse", callback_id, |
| + base::FundamentalValue(true), response); |
| +} |
| + |
| +void SettingsPageUIHandler::RejectJavascriptCallback( |
| + const base::Value& callback_id, |
| + const base::Value& response) { |
| + // cr.webUIResponse is a global JS function exposed from cr.js. |
| + web_ui()->CallJavascriptFunction( |
| + "cr.webUIResponse", callback_id, |
| + base::FundamentalValue(false), response); |
| +} |
| + |
| +} // namespace settings |