Index: content/browser/webui/web_ui_message_handler.cc |
diff --git a/content/browser/webui/web_ui_message_handler.cc b/content/browser/webui/web_ui_message_handler.cc |
index 56e0adcbbaa7a1919749123f767746c17f0069fa..41ca291e03e8ec768fab1e9de23d2dc3f05eca97 100644 |
--- a/content/browser/webui/web_ui_message_handler.cc |
+++ b/content/browser/webui/web_ui_message_handler.cc |
@@ -73,4 +73,20 @@ void WebUIMessageHandler::RenderViewReused() { |
DisallowJavascript(); |
} |
+void WebUIMessageHandler::ResolveJavascriptCallback( |
+ const base::Value& callback_id, |
+ const base::Value& response) { |
+ // cr.webUIResponse is a global JS function exposed from cr.js. |
+ CallJavascriptFunction("cr.webUIResponse", callback_id, |
+ base::FundamentalValue(true), response); |
+} |
+ |
+void WebUIMessageHandler::RejectJavascriptCallback( |
+ const base::Value& callback_id, |
+ const base::Value& response) { |
+ // cr.webUIResponse is a global JS function exposed from cr.js. |
+ CallJavascriptFunction("cr.webUIResponse", callback_id, |
+ base::FundamentalValue(false), response); |
+} |
+ |
} // namespace content |