| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/message_loop.h" |
| 6 #include "chrome/common/chrome_constants.h" |
| 7 #include "chrome/common/chrome_switches.h" |
| 8 #include "chrome/common/main_function_params.h" |
| 9 #include "chrome/service/cloud_print/cloud_print_proxy.h" |
| 10 #include "chrome/service/service_process.h" |
| 11 |
| 12 // Mainline routine for running as the service process. |
| 13 int ServiceProcessMain(const MainFunctionParams& parameters) { |
| 14 MessageLoopForUI main_message_loop; |
| 15 std::wstring app_name = chrome::kBrowserAppName; |
| 16 PlatformThread::SetName(WideToASCII(app_name + L"_ServiceMain").c_str()); |
| 17 |
| 18 ServiceProcess service_process; |
| 19 service_process.Initialize(); |
| 20 if (parameters.command_line_.HasSwitch(switches::kEnableCloudPrintProxy)) { |
| 21 std::string lsid = |
| 22 parameters.command_line_.GetSwitchValueASCII( |
| 23 switches::kServiceAccountLsid); |
| 24 std::string proxy_id = |
| 25 parameters.command_line_.GetSwitchValueASCII( |
| 26 switches::kCloudPrintProxyId); |
| 27 service_process.cloud_print_proxy()->EnableForUser(lsid, proxy_id); |
| 28 } |
| 29 MessageLoop::current()->Run(); |
| 30 service_process.Teardown(); |
| 31 |
| 32 return 0; |
| 33 } |
| 34 |
| OLD | NEW |