diff options
author | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-25 22:42:23 +0000 |
---|---|---|
committer | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-25 22:42:23 +0000 |
commit | ca53b14c9f632785ebc9604c640f1bfeb860b12a (patch) | |
tree | 8d1a83410680fc922e46de9345b1154a2239cc43 | |
parent | a5850e96ba6c7ff6efcbbfd11c893acafe281f8d (diff) | |
download | chromium_src-ca53b14c9f632785ebc9604c640f1bfeb860b12a.zip chromium_src-ca53b14c9f632785ebc9604c640f1bfeb860b12a.tar.gz chromium_src-ca53b14c9f632785ebc9604c640f1bfeb860b12a.tar.bz2 |
Enable CDD in cloud print connector on windows by default.
Added flag to switch back to XPS if needed.
BUG=317027, 281494
NOTRY=true
Review URL: https://codereview.chromium.org/179363002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253273 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/generated_resources.grd | 8 | ||||
-rw-r--r-- | chrome/browser/about_flags.cc | 9 | ||||
-rw-r--r-- | chrome/browser/service_process/service_process_control.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 3 | ||||
-rw-r--r-- | chrome/service/cloud_print/print_system_win.cc | 10 | ||||
-rw-r--r-- | cloud_print/service/win/service_utils.cc | 1 |
7 files changed, 34 insertions, 3 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 6522616..ee07127 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -5625,6 +5625,14 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_FLAGS_DISABLE_PRIVET_LOCAL_PRINTING_DESCRIPTION"> Disable printing to printers on the local network using the Privet protocol. </message> + <if expr="is_win"> + <message name="IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_NAME"> + Enable XPS in <ph name="CLOUD_PRINT_NAME">$1<ex>Google Cloud Print</ex></ph> + </message> + <message name="IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_DESCRIPTION"> + Fallback to XPS. By default <ph name="CLOUD_PRINT_NAME">$1<ex>Google Cloud Print</ex></ph> uses CDD. + </message> + </if> <message name="IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME" desc="Title of the touch-optimized UI flag." > Touch Optimized UI </message> diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 6c82810..ca27f89 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -1546,6 +1546,15 @@ const Experiment kExperiments[] = { SINGLE_VALUE_TYPE(switches::kDisablePrivetLocalPrinting) }, #endif // ENABLE_MDNS +#if defined(OS_WIN) + { + "enable-cloud-print-xps", + IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_NAME, + IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_DESCRIPTION, + kOsWin, + SINGLE_VALUE_TYPE(switches::kEnableCloudPrintXps) + }, +#endif #if defined(OS_MACOSX) { "disable-app-shims", diff --git a/chrome/browser/service_process/service_process_control.cc b/chrome/browser/service_process/service_process_control.cc index 09d15f9..15a902e 100644 --- a/chrome/browser/service_process/service_process_control.cc +++ b/chrome/browser/service_process/service_process_control.cc @@ -137,6 +137,9 @@ void ServiceProcessControl::Launch(const base::Closure& success_task, static const char* const kSwitchesToCopy[] = { switches::kCloudPrintServiceURL, switches::kCloudPrintSetupProxy, +#if defined(OS_WIN) + switches::kEnableCloudPrintXps, +#endif switches::kEnableLogging, switches::kIgnoreUrlFetcherCertRequests, switches::kLang, diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 071b3e4..78bb39c 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -1607,6 +1607,9 @@ const char kEnablePermissionsBubbles[] = "enable-permissions-bubbles"; // Enables support to debug printing subsystem. const char kDebugPrint[] = "debug-print"; +// Fallback to XPS. By default connector uses CDD. +const char kEnableCloudPrintXps[] = "enable-cloud-print-xps"; + // Force-enables the profile shortcut manager. This is needed for tests since // they use a custom-user-data-dir which disables this. const char kEnableProfileShortcutManager[] = "enable-profile-shortcut-manager"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index c0a0f52..d865468c 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -451,9 +451,10 @@ extern const char kRelauncherProcess[]; #if defined(OS_WIN) extern const char kDebugPrint[]; +extern const char kEnableCloudPrintXps[]; extern const char kEnableProfileShortcutManager[]; -extern const char kForceImmersive[]; extern const char kForceDesktop[]; +extern const char kForceImmersive[]; extern const char kPrintRaster[]; extern const char kRelaunchShortcut[]; extern const char kViewerConnect[]; diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc index 8d585d3..fc1ab97 100644 --- a/chrome/service/cloud_print/print_system_win.cc +++ b/chrome/service/cloud_print/print_system_win.cc @@ -4,6 +4,7 @@ #include "chrome/service/cloud_print/print_system.h" +#include "base/command_line.h" #include "base/file_util.h" #include "base/memory/scoped_ptr.h" #include "base/strings/utf_string_conversions.h" @@ -11,6 +12,7 @@ #include "base/win/scoped_bstr.h" #include "base/win/scoped_comptr.h" #include "base/win/scoped_hdc.h" +#include "chrome/common/chrome_switches.h" #include "chrome/common/cloud_print/cloud_print_constants.h" #include "chrome/common/crash_keys.h" #include "chrome/service/cloud_print/cdd_conversion_win.h" @@ -658,12 +660,16 @@ class PrintSystemWin : public PrintSystem { DISALLOW_COPY_AND_ASSIGN(PrintSystemWin); }; -PrintSystemWin::PrintSystemWin() : use_cdd_(false) { +PrintSystemWin::PrintSystemWin() : use_cdd_(true) { print_backend_ = printing::PrintBackend::CreateInstance(NULL); } PrintSystem::PrintSystemResult PrintSystemWin::Init() { - use_cdd_ = !printing::XPSModule::Init(); + use_cdd_ = !CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableCloudPrintXps); + + if (!use_cdd_) + use_cdd_ = !printing::XPSModule::Init(); if (!use_cdd_) { HPTPROVIDER provider = NULL; diff --git a/cloud_print/service/win/service_utils.cc b/cloud_print/service/win/service_utils.cc index cb791ad..37f2747 100644 --- a/cloud_print/service/win/service_utils.cc +++ b/cloud_print/service/win/service_utils.cc @@ -50,6 +50,7 @@ base::string16 GetCurrentUserName() { void CopyChromeSwitchesFromCurrentProcess(CommandLine* destination) { static const char* const kSwitchesToCopy[] = { switches::kCloudPrintServiceURL, + switches::kEnableCloudPrintXps, switches::kEnableLogging, switches::kIgnoreUrlFetcherCertRequests, switches::kLsoUrl, |