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

Unified Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 1995113002: Rename WebUI::CallJavascriptFunction to WebUI::CallJavascriptFunctionUnsafe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: chrome/browser/ui/webui/ntp/app_launcher_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index 4521713224cc7852db281c9936f57b05bb21cac7..ca5d12b0cbbd78a1a809faf658e715ed652092c2 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -311,7 +311,7 @@ void AppLauncherHandler::Observe(int type,
CreateAppInfo(extension,
extension_service_,
&app_info);
- web_ui()->CallJavascriptFunction("ntp.appMoved", app_info);
+ web_ui()->CallJavascriptFunctionUnsafe("ntp.appMoved", app_info);
} else {
HandleGetApps(NULL);
}
@@ -349,7 +349,7 @@ void AppLauncherHandler::OnExtensionLoaded(
base::FundamentalValue highlight(prefs->IsFromBookmark(extension->id()) &&
attempted_bookmark_app_install_);
attempted_bookmark_app_install_ = false;
- web_ui()->CallJavascriptFunction("ntp.appAdded", *app_info, highlight);
+ web_ui()->CallJavascriptFunctionUnsafe("ntp.appAdded", *app_info, highlight);
}
void AppLauncherHandler::OnExtensionUnloaded(
@@ -450,7 +450,7 @@ void AppLauncherHandler::HandleGetApps(const base::ListValue* args) {
SetAppToBeHighlighted();
FillAppDictionary(&dictionary);
- web_ui()->CallJavascriptFunction("ntp.getAppsCallback", dictionary);
+ web_ui()->CallJavascriptFunctionUnsafe("ntp.getAppsCallback", dictionary);
// First time we get here we set up the observer so that we can tell update
// the apps as they change.
@@ -784,19 +784,20 @@ void AppLauncherHandler::SetAppToBeHighlighted() {
return;
base::StringValue app_id(highlight_app_id_);
- web_ui()->CallJavascriptFunction("ntp.setAppToBeHighlighted", app_id);
+ web_ui()->CallJavascriptFunctionUnsafe("ntp.setAppToBeHighlighted", app_id);
highlight_app_id_.clear();
}
void AppLauncherHandler::OnExtensionPreferenceChanged() {
base::DictionaryValue dictionary;
FillAppDictionary(&dictionary);
- web_ui()->CallJavascriptFunction("ntp.appsPrefChangeCallback", dictionary);
+ web_ui()->CallJavascriptFunctionUnsafe("ntp.appsPrefChangeCallback",
+ dictionary);
}
void AppLauncherHandler::OnLocalStatePreferenceChanged() {
#if defined(ENABLE_APP_LIST)
- web_ui()->CallJavascriptFunction(
+ web_ui()->CallJavascriptFunctionUnsafe(
"ntp.appLauncherPromoPrefChangeCallback",
base::FundamentalValue(g_browser_process->local_state()->GetBoolean(
prefs::kShowAppLauncherPromo)));
@@ -831,7 +832,7 @@ void AppLauncherHandler::ExtensionEnableFlowFinished() {
// icon disappears but isn't replaced by the enabled icon, making a poor
// visual experience.
base::StringValue app_id(extension_id_prompting_);
- web_ui()->CallJavascriptFunction("ntp.launchAppAfterEnable", app_id);
+ web_ui()->CallJavascriptFunctionUnsafe("ntp.launchAppAfterEnable", app_id);
extension_enable_flow_.reset();
extension_id_prompting_ = "";
@@ -876,7 +877,7 @@ void AppLauncherHandler::AppRemoved(const Extension* extension,
if (!app_info.get())
return;
- web_ui()->CallJavascriptFunction(
+ web_ui()->CallJavascriptFunctionUnsafe(
"ntp.appRemoved", *app_info, base::FundamentalValue(is_uninstall),
base::FundamentalValue(!extension_id_prompting_.empty()));
}

Powered by Google App Engine
This is Rietveld 408576698