Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: chrome/browser/ui/webui/settings/settings_page_ui_handler.cc

Issue 1988463002: MD Settings: Convert C++ handlers to be JavaScript-lifecycle aware. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/settings_page_ui_handler.h" 5 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
6 6
7 #include "content/public/browser/web_ui.h" 7 #include "content/public/browser/web_ui.h"
8 8
9 namespace settings { 9 namespace settings {
10 10
11 SettingsPageUIHandler::SettingsPageUIHandler() {} 11 SettingsPageUIHandler::SettingsPageUIHandler() {}
12 12
13 SettingsPageUIHandler::~SettingsPageUIHandler() {} 13 SettingsPageUIHandler::~SettingsPageUIHandler() {}
14 14
15 void SettingsPageUIHandler::ResolveJavascriptCallback( 15 void SettingsPageUIHandler::ResolveJavascriptCallback(
16 const base::Value& callback_id, 16 const base::Value& callback_id,
17 const base::Value& response) { 17 const base::Value& response) {
18 // cr.webUIResponse is a global JS function exposed from cr.js. 18 // cr.webUIResponse is a global JS function exposed from cr.js.
19 web_ui()->CallJavascriptFunction( 19 CallJavascriptFunction("cr.webUIResponse", callback_id,
20 "cr.webUIResponse", callback_id, 20 base::FundamentalValue(true), response);
21 base::FundamentalValue(true), response);
22 } 21 }
23 22
24 void SettingsPageUIHandler::RejectJavascriptCallback( 23 void SettingsPageUIHandler::RejectJavascriptCallback(
25 const base::Value& callback_id, 24 const base::Value& callback_id,
26 const base::Value& response) { 25 const base::Value& response) {
27 // cr.webUIResponse is a global JS function exposed from cr.js. 26 // cr.webUIResponse is a global JS function exposed from cr.js.
28 web_ui()->CallJavascriptFunction( 27 CallJavascriptFunction("cr.webUIResponse", callback_id,
29 "cr.webUIResponse", callback_id, 28 base::FundamentalValue(false), response);
30 base::FundamentalValue(false), response);
31 } 29 }
32 30
33 } // namespace settings 31 } // namespace settings
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/settings_page_ui_handler.h ('k') | chrome/browser/ui/webui/settings/site_settings_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698