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

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

Issue 387073002: Print preview changes for App Kiosk mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix PrintPreviewWebUITest.* Created 6 years, 5 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 27ab250de074ecbe1b6280cc66eac14b10c78c11..86ee312de2523d6cdec431d45fdeac0d8f56af72 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -27,6 +27,7 @@
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "base/values.h"
+#include "chrome/browser/app_mode/app_mode_utils.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/printing/print_dialog_cloud.h"
@@ -182,6 +183,11 @@ const char kNumberFormat[] = "numberFormat";
// Name of a dictionary field specifying whether to print automatically in
// kiosk mode. See http://crbug.com/31395.
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";
#if defined(OS_WIN)
const char kHidePrintWithSystemDialogLink[] = "hidePrintWithSystemDialogLink";
#endif
@@ -1195,6 +1201,8 @@ void PrintPreviewHandler::SendInitialSettings(
base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
initial_settings.SetBoolean(kPrintAutomaticallyInKioskMode,
cmdline->HasSwitch(switches::kKioskModePrinting));
+ initial_settings.SetBoolean(kAppKioskMode,
+ chrome::IsRunningInForcedAppMode());
#if defined(OS_WIN)
// In Win8 metro, the system print dialog can only open on the desktop. Doing
// so will cause the browser to appear hung, so we don't show the link in
@@ -1251,9 +1259,11 @@ void PrintPreviewHandler::SendCloudPrintEnabled() {
preview_web_contents()->GetBrowserContext());
PrefService* prefs = profile->GetPrefs();
if (prefs->GetBoolean(prefs::kCloudPrintSubmitEnabled)) {
- GURL gcp_url(cloud_devices::GetCloudPrintURL());
- base::StringValue gcp_url_value(gcp_url.spec());
- web_ui()->CallJavascriptFunction("setUseCloudPrint", gcp_url_value);
+ base::DictionaryValue settings;
+ settings.SetString(kCloudPrintUrl,
+ GURL(cloud_devices::GetCloudPrintURL()).spec());
+ settings.SetBoolean(kAppKioskMode, chrome::IsRunningInForcedAppMode());
+ web_ui()->CallJavascriptFunction("setUseCloudPrint", settings);
}
}
« no previous file with comments | « chrome/browser/resources/print_preview/settings/destination_settings.js ('k') | chrome/test/data/webui/print_preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698