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

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

Issue 8915027: Print preview: A quick hack to support printing to the default printer without user confirmation ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | « chrome/browser/resources/print_preview/print_preview.js ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/print_preview_handler.cc
===================================================================
--- chrome/browser/ui/webui/print_preview_handler.cc (revision 114602)
+++ chrome/browser/ui/webui/print_preview_handler.cc (working copy)
@@ -51,7 +51,7 @@
#include "printing/print_settings.h"
#include "unicode/ulocdata.h"
-#if !defined(OS_CHROMEOS)
+#if !defined(OS_MACOSX)
#include "base/command_line.h"
#include "chrome/common/chrome_switches.h"
#endif
@@ -104,6 +104,9 @@
const char kMeasurementSystem[] = "measurementSystem";
// Name of a dictionary field holding the number format according to the locale.
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";
// Get the print job settings dictionary from |args|. The caller takes
@@ -638,6 +641,15 @@
default_printer);
initial_settings.SetString(kCloudPrintData, cloud_print_data);
+#if defined(OS_MACOSX)
+ bool kiosk_mode = false; // No kiosk mode on Mac yet.
+#else
+ CommandLine* cmdline = CommandLine::ForCurrentProcess();
+ bool kiosk_mode = (cmdline->HasSwitch(switches::kKioskMode) &&
+ cmdline->HasSwitch(switches::kKioskModePrinting));
+#endif
+ initial_settings.SetBoolean(kPrintAutomaticallyInKioskMode, kiosk_mode);
+
if (print_preview_ui->source_is_modifiable()) {
GetLastUsedMarginSettings(&initial_settings);
GetNumberFormatAndMeasurementSystem(&initial_settings);
« no previous file with comments | « chrome/browser/resources/print_preview/print_preview.js ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698