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

Unified Diff: content/public/browser/web_ui_message_handler.h

Issue 2040473002: Move {Resolve|Reject}JavascriptCallback helpers in WebUIMessageHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comment. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/webui/web_ui_message_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/web_ui_message_handler.h
diff --git a/content/public/browser/web_ui_message_handler.h b/content/public/browser/web_ui_message_handler.h
index ed0117931f59bc8cc8db1b135a2c606aea0c2015..b088c07030cc7b3a87d807f556baea3ab963a11e 100644
--- a/content/public/browser/web_ui_message_handler.h
+++ b/content/public/browser/web_ui_message_handler.h
@@ -77,6 +77,18 @@ class CONTENT_EXPORT WebUIMessageHandler {
// to deregister or disabled observers that push JavaScript calls to the page.
virtual void OnJavascriptDisallowed() {}
+ // Helper method for responding to JS requests initiated with
Charlie Reis 2016/06/06 21:19:52 nit: Javascript
dpapad 2016/06/06 21:28:53 Done.
+ // cr.sendWithPromise(), for the case where the returned promise should be
Charlie Reis 2016/06/06 21:19:52 What is cr?
dpapad 2016/06/06 21:28:53 'cr' is simply a namespace used by cr.js (where th
+ // resolved (request succeeded).
+ void ResolveJavascriptCallback(const base::Value& callback_id,
+ const base::Value& response);
+
+ // Helper method for responding to JS requests initiated with
Charlie Reis 2016/06/06 21:19:52 (Same comments)
dpapad 2016/06/06 21:28:53 Done. See previous comment.
+ // cr.sendWithPromise(), for the case where the returned promise should be
+ // rejected (request failed).
+ void RejectJavascriptCallback(const base::Value& callback_id,
+ const base::Value& response);
+
// Call a Javascript function by sending its name and arguments down to
// the renderer. This is asynchronous; there's no way to get the result
// of the call, and should be thought of more like sending a message to
« no previous file with comments | « content/browser/webui/web_ui_message_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698