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

Unified Diff: chrome/browser/ui/webui/settings/search_engines_handler.cc

Issue 2890523003: WebUI: Add helper FireWebUIListener method on WebUIMessageHandler. (Closed)
Patch Set: Add example conversion. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/public/browser/web_ui_message_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/settings/search_engines_handler.cc
diff --git a/chrome/browser/ui/webui/settings/search_engines_handler.cc b/chrome/browser/ui/webui/settings/search_engines_handler.cc
index 077d940d7905736a8c5daf8dca586a1fc57e4e94..f330f90510f28589de1bbee9eb0bf70fc9f1accb 100644
--- a/chrome/browser/ui/webui/settings/search_engines_handler.cc
+++ b/chrome/browser/ui/webui/settings/search_engines_handler.cc
@@ -196,13 +196,11 @@ SearchEnginesHandler::GetSearchEnginesList() {
void SearchEnginesHandler::OnModelChanged() {
AllowJavascript();
- CallJavascriptFunction("cr.webUIListenerCallback",
- base::Value("search-engines-changed"),
- *GetSearchEnginesList());
+ FireJavascriptEvent("search-engines-changed", *GetSearchEnginesList());
Dan Beam 2017/05/16 22:33:38 what about ListenerCallback("search-engines-chang
dpapad 2017/05/16 22:42:14 I attempted to keep the naming in the same spirit
+
// Google Now availability may have changed.
- CallJavascriptFunction("cr.webUIListenerCallback",
- base::Value("google-now-availability-changed"),
- base::Value(IsGoogleNowAvailable(profile_)));
+ FireJavascriptEvent("google-now-availability-changed",
+ base::Value(IsGoogleNowAvailable(profile_)));
}
void SearchEnginesHandler::OnItemsChanged(int start, int length) {
@@ -517,8 +515,7 @@ void SearchEnginesHandler::HotwordInfoComplete(
if (callback_id) {
ResolveJavascriptCallback(*callback_id, status);
} else {
- CallJavascriptFunction("cr.webUIListenerCallback",
- base::Value("hotword-info-update"), status);
+ FireJavascriptEvent("hotword-info-update", status);
}
}
« no previous file with comments | « no previous file | content/public/browser/web_ui_message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698