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

Unified Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.cc

Issue 2956033002: Print Preview: Make useCloudPrint a WebUI event (Closed)
Patch Set: clean up Created 3 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/print_preview/print_preview_handler.cc
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index 1f29ef46a0365da1f6b323b35c20b312c5bece39..dc546dac8176940de66c77cc6e274d3ef9355832 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -188,8 +188,6 @@ const char kPrintAutomaticallyInKioskMode[] = "printAutomaticallyInKioskMode";
// Dictionary field to indicate whether Chrome is running in forced app (app
// kiosk) mode. It's not the same as desktop Chrome kiosk (the one above).
const char kAppKioskMode[] = "appKioskMode";
-// Dictionary field to store Cloud Print base URL.
-const char kCloudPrintUrl[] = "cloudPrintUrl";
// Name of a dictionary field holding the state of selection for document.
const char kDocumentHasSelection[] = "documentHasSelection";
// Dictionary field holding the default destination selection rules.
@@ -1433,11 +1431,10 @@ void PrintPreviewHandler::SendCloudPrintEnabled() {
preview_web_contents()->GetBrowserContext());
PrefService* prefs = profile->GetPrefs();
if (prefs->GetBoolean(prefs::kCloudPrintSubmitEnabled)) {
- base::DictionaryValue settings;
- settings.SetString(kCloudPrintUrl,
- GURL(cloud_devices::GetCloudPrintURL()).spec());
- settings.SetBoolean(kAppKioskMode, chrome::IsRunningInForcedAppMode());
- web_ui()->CallJavascriptFunctionUnsafe("setUseCloudPrint", settings);
+ FireWebUIListener(
+ "use-cloud-print",
+ base::Value(GURL(cloud_devices::GetCloudPrintURL()).spec()),
+ base::Value(chrome::IsRunningInForcedAppMode()));
}
}

Powered by Google App Engine
This is Rietveld 408576698