summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-27 09:05:56 +0000
committervitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-27 09:05:56 +0000
commit6e6c451cdfbc3acfaa0dda793836068dba2ffc13 (patch)
tree828be996d8ffe4c4a64cf3746af9a8adc286e526
parent406f1923b6d8537c3e2d304608616ee3932c8797 (diff)
downloadchromium_src-6e6c451cdfbc3acfaa0dda793836068dba2ffc13.zip
chromium_src-6e6c451cdfbc3acfaa0dda793836068dba2ffc13.tar.gz
chromium_src-6e6c451cdfbc3acfaa0dda793836068dba2ffc13.tar.bz2
User constansts from chrome_switches.h
NOTRY=True Review URL: https://chromiumcodereview.appspot.com/12924005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190878 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--cloud_print/DEPS1
-rw-r--r--cloud_print/service/service.gyp3
-rw-r--r--cloud_print/service/service_switches.cc2
-rw-r--r--cloud_print/service/service_switches.h2
-rw-r--r--cloud_print/service/win/chrome_launcher.cc5
-rw-r--r--cloud_print/service/win/cloud_print_service.cc10
-rw-r--r--cloud_print/service/win/service_controller.cc4
-rw-r--r--cloud_print/virtual_driver/virtual_driver_switches.cc16
-rw-r--r--cloud_print/virtual_driver/virtual_driver_switches.h40
-rw-r--r--cloud_print/virtual_driver/win/port_monitor/port_monitor.cc5
-rw-r--r--cloud_print/virtual_driver/win/port_monitor/port_monitor_dll.cc2
-rw-r--r--cloud_print/virtual_driver/win/virtual_driver.gyp2
-rw-r--r--cloud_print/virtual_driver/win/virtual_driver.gypi3
-rw-r--r--cloud_print/virtual_driver/win/virtual_driver64.gyp2
14 files changed, 22 insertions, 75 deletions
diff --git a/cloud_print/DEPS b/cloud_print/DEPS
index 350c845..07b8166 100644
--- a/cloud_print/DEPS
+++ b/cloud_print/DEPS
@@ -1,4 +1,5 @@
include_rules = [
+ "+chrome/common/chrome_switches.h",
"+chrome/installer/launcher_support",
"+grit", # For generated headers
"+net",
diff --git a/cloud_print/service/service.gyp b/cloud_print/service/service.gyp
index 8e11395..a5ed819 100644
--- a/cloud_print/service/service.gyp
+++ b/cloud_print/service/service.gyp
@@ -32,6 +32,7 @@
{
'target_name': 'cloud_print_service_lib',
'type': 'static_library',
+ 'defines': ['COMPILE_CONTENT_STATICALLY'],
'dependencies': [
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/build/temp_gyp/googleurl.gyp:googleurl',
@@ -44,10 +45,12 @@
'dependencies': [
'<(DEPTH)/chrome/chrome.gyp:chrome_version_header',
'<(DEPTH)/chrome/chrome.gyp:launcher_support',
+ '<(DEPTH)/chrome/common_constants.gyp:common_constants',
],
}],
],
'sources': [
+ '<(DEPTH)/content/public/common/content_switches.cc',
'service_state.cc',
'service_state.h',
'service_switches.cc',
diff --git a/cloud_print/service/service_switches.cc b/cloud_print/service/service_switches.cc
index 8896349..9386777 100644
--- a/cloud_print/service/service_switches.cc
+++ b/cloud_print/service/service_switches.cc
@@ -4,7 +4,6 @@
#include "cloud_print/service/service_switches.h"
-const char kChromeTypeSwitch[] = "type";
const char kConsoleSwitch[] = "console";
const char kInstallSwitch[] = "install";
const char kRequirementsSwitch[] = "requirements";
@@ -12,5 +11,4 @@ const char kServiceSwitch[] = "service";
const char kStartSwitch[] = "start";
const char kStopSwitch[] = "stop";
const char kUninstallSwitch[] = "uninstall";
-const char kUserDataDirSwitch[] = "user-data-dir";
diff --git a/cloud_print/service/service_switches.h b/cloud_print/service/service_switches.h
index a6704f7..ae92fed 100644
--- a/cloud_print/service/service_switches.h
+++ b/cloud_print/service/service_switches.h
@@ -5,7 +5,6 @@
#ifndef CLOUD_PRINT_SERVICE_SERVICE_SWITCHES_H_
#define CLOUD_PRINT_SERVICE_SERVICE_SWITCHES_H_
-extern const char kChromeTypeSwitch[];
extern const char kConsoleSwitch[];
extern const char kInstallSwitch[];
extern const char kRequirementsSwitch[];
@@ -13,7 +12,6 @@ extern const char kServiceSwitch[];
extern const char kStartSwitch[];
extern const char kStopSwitch[];
extern const char kUninstallSwitch[];
-extern const char kUserDataDirSwitch[];
#endif // CLOUD_PRINT_SERVICE_SERVICE_SWITCHES_H_
diff --git a/cloud_print/service/win/chrome_launcher.cc b/cloud_print/service/win/chrome_launcher.cc
index 2fafe6f..98ed5a4 100644
--- a/cloud_print/service/win/chrome_launcher.cc
+++ b/cloud_print/service/win/chrome_launcher.cc
@@ -9,6 +9,7 @@
#include "base/process_util.h"
#include "base/win/scoped_handle.h"
#include "base/win/scoped_process_information.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/installer/launcher_support/chrome_launcher_support.h"
#include "cloud_print/service/service_switches.h"
@@ -82,8 +83,8 @@ void ChromeLauncher::Run() {
if (!chrome_path.empty()) {
CommandLine cmd(chrome_path);
- cmd.AppendSwitchASCII(kChromeTypeSwitch, "service");
- cmd.AppendSwitchPath(kUserDataDirSwitch, user_data_);
+ cmd.AppendSwitchASCII(switches::kProcessType, switches::kServiceProcess);
+ cmd.AppendSwitchPath(switches::kUserDataDir, user_data_);
base::win::ScopedHandle chrome_handle;
base::Time started = base::Time::Now();
DWORD thread_id = 0;
diff --git a/cloud_print/service/win/cloud_print_service.cc b/cloud_print/service/win/cloud_print_service.cc
index 0bc922e..7c6b289 100644
--- a/cloud_print/service/win/cloud_print_service.cc
+++ b/cloud_print/service/win/cloud_print_service.cc
@@ -17,6 +17,7 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "base/win/scoped_handle.h"
+#include "chrome/common/chrome_switches.h"
#include "cloud_print/service/service_state.h"
#include "cloud_print/service/service_switches.h"
#include "cloud_print/service/win/chrome_launcher.h"
@@ -39,7 +40,7 @@ void InvalidUsage() {
std::cout << "[";
std::cout << "[";
std::cout << " -" << kInstallSwitch;
- std::cout << " -" << kUserDataDirSwitch << "=DIRECTORY";
+ std::cout << " -" << switches::kUserDataDir << "=DIRECTORY";
std::cout << "]";
std::cout << "]";
std::cout << " | -" << kUninstallSwitch;
@@ -53,7 +54,8 @@ void InvalidUsage() {
const char* description;
} kSwitchHelp[] = {
{ kInstallSwitch, "Installs cloud print as service." },
- { kUserDataDirSwitch, "User data directory with \"Service State\" file." },
+ { switches::kUserDataDir,
+ "User data directory with \"Service State\" file." },
{ kUninstallSwitch, "Uninstalls service." },
{ kStartSwitch, "Starts service. May be combined with installation." },
{ kStopSwitch, "Stops service." },
@@ -177,7 +179,7 @@ class CloudPrintServiceModule
return E_INVALIDARG;
*is_service = false;
- user_data_dir_ = command_line.GetSwitchValuePath(kUserDataDirSwitch);
+ user_data_dir_ = command_line.GetSwitchValuePath(switches::kUserDataDir);
if (command_line.HasSwitch(kStopSwitch))
return controller_->StopService();
@@ -185,7 +187,7 @@ class CloudPrintServiceModule
return controller_->UninstallService();
if (command_line.HasSwitch(kInstallSwitch)) {
- if (!command_line.HasSwitch(kUserDataDirSwitch)) {
+ if (!command_line.HasSwitch(switches::kUserDataDir)) {
InvalidUsage();
return S_FALSE;
}
diff --git a/cloud_print/service/win/service_controller.cc b/cloud_print/service/win/service_controller.cc
index 792c757..2c441cb 100644
--- a/cloud_print/service/win/service_controller.cc
+++ b/cloud_print/service/win/service_controller.cc
@@ -12,7 +12,7 @@
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "base/win/scoped_handle.h"
-#include "cloud_print/service/service_switches.h"
+#include "chrome/common/chrome_switches.h"
#include "cloud_print/service/win/local_security_policy.h"
namespace {
@@ -130,7 +130,7 @@ HRESULT ServiceController::InstallService(const string16& user,
CHECK(PathService::Get(base::FILE_EXE, &service_path));
CommandLine command_line(service_path);
command_line.AppendSwitch(run_switch);
- command_line.AppendSwitchPath(kUserDataDirSwitch, user_data_dir);
+ command_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir);
LocalSecurityPolicy local_security_policy;
if (local_security_policy.Open()) {
diff --git a/cloud_print/virtual_driver/virtual_driver_switches.cc b/cloud_print/virtual_driver/virtual_driver_switches.cc
deleted file mode 100644
index ed73e5e..0000000
--- a/cloud_print/virtual_driver/virtual_driver_switches.cc
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "cloud_print/virtual_driver/virtual_driver_switches.h"
-
-namespace switches {
-// Same value as as Chrome.
-const char kCloudPrintUserDataDir[] = "user-data-dir";
-const char kCloudPrintDeleteFile[] = "cloud-print-delete-file";
-const char kCloudPrintFile[] = "cloud-print-file";
-const char kCloudPrintJobTitle[] = "cloud-print-job-title";
-const char kCloudPrintFileType[] = "cloud-print-file-type";
-const char kCloudPrintPrintTicket[] = "cloud-print-print-ticket";
-} // namespace switches
-
diff --git a/cloud_print/virtual_driver/virtual_driver_switches.h b/cloud_print/virtual_driver/virtual_driver_switches.h
deleted file mode 100644
index b11570b..0000000
--- a/cloud_print/virtual_driver/virtual_driver_switches.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CLOUD_PRINT_VIRTUAL_DRIVER_VIRTUAL_DRIVER_SWITCHES_H_
-#define CLOUD_PRINT_VIRTUAL_DRIVER_VIRTUAL_DRIVER_SWITCHES_H_
-
-namespace switches {
-// These constants are duplicated from chrome/common/chrome_switches.cc
-// in order to avoid dependency problems.
-// TODO(abodenha@chromium.org) Reunify them in some sensible manner.
-// Bug: http://crbug.com/88991
-
-// Location of Chrome user profile. Optional.
-extern const char kCloudPrintUserDataDir[];
-
-// Used with kCloudPrintFile. Tells Chrome to delete the file when
-// finished displaying the print dialog.
-extern const char kCloudPrintDeleteFile[];
-
-// Tells chrome to display the cloud print dialog and upload the
-// specified file for printing.
-extern const char kCloudPrintFile[];
-
-// Used with kCloudPrintFile to specify a title for the resulting print
-// job.
-extern const char kCloudPrintJobTitle[];
-
-// Specifies the mime type to be used when uploading data from the
-// file referenced by cloud-print-file.
-// Defaults to "application/pdf" if unspecified.
-extern const char kCloudPrintFileType[];
-
-// Used with kCloudPrintFile to specify a JSON print ticket for the resulting
-// print job.
-// Defaults to null if unspecified.
-extern const char kCloudPrintPrintTicket[];
-} // namespace switches
-
-#endif // CLOUD_PRINT_VIRTUAL_DRIVER_VIRTUAL_DRIVER_SWITCHES_H_
diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
index 7e2ffe9..9c46e45 100644
--- a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
+++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
@@ -23,8 +23,8 @@
#include "base/win/registry.h"
#include "base/win/scoped_handle.h"
#include "base/win/windows_version.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/installer/launcher_support/chrome_launcher_support.h"
-#include "cloud_print/virtual_driver/virtual_driver_switches.h"
#include "cloud_print/virtual_driver/win/port_monitor/spooler_win.h"
#include "cloud_print/virtual_driver/win/virtual_driver_consts.h"
#include "cloud_print/virtual_driver/win/virtual_driver_helpers.h"
@@ -215,8 +215,7 @@ bool LaunchPrintDialog(const base::FilePath& xps_path,
base::FilePath chrome_profile = GetChromeProfilePath();
if (!chrome_profile.empty()) {
- command_line.AppendSwitchPath(switches::kCloudPrintUserDataDir,
- chrome_profile);
+ command_line.AppendSwitchPath(switches::kUserDataDir, chrome_profile);
}
command_line.AppendSwitchPath(switches::kCloudPrintFile,
diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor_dll.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor_dll.cc
index e9cf3b5..2ca2bd7 100644
--- a/cloud_print/virtual_driver/win/port_monitor/port_monitor_dll.cc
+++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor_dll.cc
@@ -23,7 +23,7 @@
#include "base/win/registry.h"
#include "base/win/scoped_handle.h"
#include "base/win/windows_version.h"
-#include "cloud_print/virtual_driver/virtual_driver_switches.h"
+#include "chrome/common/chrome_switches.h"
#include "cloud_print/virtual_driver/win/port_monitor/spooler_win.h"
#include "cloud_print/virtual_driver/win/virtual_driver_consts.h"
#include "cloud_print/virtual_driver/win/virtual_driver_helpers.h"
diff --git a/cloud_print/virtual_driver/win/virtual_driver.gyp b/cloud_print/virtual_driver/win/virtual_driver.gyp
index d1bc0da0..851746f 100644
--- a/cloud_print/virtual_driver/win/virtual_driver.gyp
+++ b/cloud_print/virtual_driver/win/virtual_driver.gyp
@@ -9,6 +9,8 @@
'target_defaults': {
'dependencies': [
'<(DEPTH)/base/base.gyp:base',
+ '<(DEPTH)/chrome/chrome.gyp:launcher_support',
+ '<(DEPTH)/chrome/common_constants.gyp:common_constants',
],
},
diff --git a/cloud_print/virtual_driver/win/virtual_driver.gypi b/cloud_print/virtual_driver/win/virtual_driver.gypi
index 15e7b39..dfdc5c1 100644
--- a/cloud_print/virtual_driver/win/virtual_driver.gypi
+++ b/cloud_print/virtual_driver/win/virtual_driver.gypi
@@ -19,8 +19,6 @@
'target_name': 'virtual_driver_lib<(virtual_driver_suffix)',
'type': 'static_library',
'sources': [
- '../virtual_driver_switches.cc',
- '../virtual_driver_switches.h',
'virtual_driver_consts.cc',
'virtual_driver_consts.h',
'virtual_driver_helpers.cc',
@@ -35,7 +33,6 @@
'port_monitor/port_monitor.h',
],
'dependencies': [
- '<(DEPTH)/chrome/chrome.gyp:launcher_support<(virtual_driver_suffix)',
'virtual_driver_lib<(virtual_driver_suffix)',
],
},
diff --git a/cloud_print/virtual_driver/win/virtual_driver64.gyp b/cloud_print/virtual_driver/win/virtual_driver64.gyp
index 885fb7c..b41a992 100644
--- a/cloud_print/virtual_driver/win/virtual_driver64.gyp
+++ b/cloud_print/virtual_driver/win/virtual_driver64.gyp
@@ -12,6 +12,8 @@
],
'dependencies': [
'<(DEPTH)/base/base.gyp:base_nacl_win64',
+ '<(DEPTH)/chrome/chrome.gyp:launcher_support64',
+ '<(DEPTH)/chrome/common_constants.gyp:common_constants_win64',
],
'configurations': {
'Common_Base': {