| 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..93326fa23f5a79a271fecb5cc02159c72d733298
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/webui/settings/settings_page_ui_handler.cc
|
| @@ -0,0 +1,33 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// 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
|
|
|