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

Unified Diff: chrome/service/service_process.cc

Issue 3384001: The LSID for Cloud Print can now be supplied on the command line even if Clou... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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
« no previous file with comments | « chrome/service/service_process.h ('k') | chrome/service/service_process_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/service_process.cc
===================================================================
--- chrome/service/service_process.cc (revision 59257)
+++ chrome/service/service_process.cc (working copy)
@@ -58,7 +58,8 @@
g_service_process = this;
}
-bool ServiceProcess::Initialize(MessageLoop* message_loop) {
+bool ServiceProcess::Initialize(MessageLoop* message_loop,
+ const CommandLine& command_line) {
main_message_loop_ = message_loop;
network_change_notifier_.reset(net::NetworkChangeNotifier::Create());
base::Thread::Options options;
@@ -71,6 +72,12 @@
Teardown();
return false;
}
+
+ // See if we have been suppiled an LSID in the command line. This LSID will
+ // override the credentials we use for Cloud Print.
+ std::string lsid = command_line.GetSwitchValueASCII(
+ switches::kServiceAccountLsid);
+
FilePath user_data_dir;
PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
FilePath pref_path = user_data_dir.Append(chrome::kServiceStateFileName);
@@ -87,14 +94,17 @@
// If true then we start the host.
StartChromotingHost();
}
+ // Enable Cloud Print if needed. First check the command-line.
+ bool cloud_print_proxy_enabled =
+ command_line.HasSwitch(switches::kEnableCloudPrintProxy);
+ if (!cloud_print_proxy_enabled) {
+ // Then check if the cloud print proxy was previously enabled.
+ values->GetBoolean(prefs::kCloudPrintProxyEnabled,
+ &cloud_print_proxy_enabled);
+ }
- bool cloud_print_proxy_enabled = false;
-
- // Check if the cloud print proxy is already enabled.
- if (values->GetBoolean(prefs::kCloudPrintProxyEnabled,
- &cloud_print_proxy_enabled) &&
- cloud_print_proxy_enabled) {
- GetCloudPrintProxy()->EnableForUser(std::string());
+ if (cloud_print_proxy_enabled) {
+ GetCloudPrintProxy()->EnableForUser(lsid);
}
LOG(INFO) << "Starting Service Process IPC Server";
« no previous file with comments | « chrome/service/service_process.h ('k') | chrome/service/service_process_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698