OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/service/cloud_print/cloud_print_proxy.h" | 5 #include "chrome/service/cloud_print/cloud_print_proxy.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 } | 31 } |
32 CommandLine cmd_line(exe_path); | 32 CommandLine cmd_line(exe_path); |
33 | 33 |
34 const CommandLine& process_command_line = *CommandLine::ForCurrentProcess(); | 34 const CommandLine& process_command_line = *CommandLine::ForCurrentProcess(); |
35 FilePath user_data_dir = | 35 FilePath user_data_dir = |
36 process_command_line.GetSwitchValuePath(switches::kUserDataDir); | 36 process_command_line.GetSwitchValuePath(switches::kUserDataDir); |
37 if (!user_data_dir.empty()) | 37 if (!user_data_dir.empty()) |
38 cmd_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir); | 38 cmd_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir); |
39 cmd_line.AppendSwitch(switches::kNotifyCloudPrintTokenExpired); | 39 cmd_line.AppendSwitch(switches::kNotifyCloudPrintTokenExpired); |
40 | 40 |
41 base::LaunchOptions options; | 41 base::LaunchProcess(cmd_line, base::LaunchOptions(), NULL); |
42 base::LaunchProcess(cmd_line, options); | |
43 } | 42 } |
44 | 43 |
45 CloudPrintProxy::CloudPrintProxy() | 44 CloudPrintProxy::CloudPrintProxy() |
46 : service_prefs_(NULL), | 45 : service_prefs_(NULL), |
47 client_(NULL), | 46 client_(NULL), |
48 enabled_(false) { | 47 enabled_(false) { |
49 } | 48 } |
50 | 49 |
51 CloudPrintProxy::~CloudPrintProxy() { | 50 CloudPrintProxy::~CloudPrintProxy() { |
52 DCHECK(CalledOnValidThread()); | 51 DCHECK(CalledOnValidThread()); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 } | 237 } |
239 } | 238 } |
240 | 239 |
241 void CloudPrintProxy::Shutdown() { | 240 void CloudPrintProxy::Shutdown() { |
242 DCHECK(CalledOnValidThread()); | 241 DCHECK(CalledOnValidThread()); |
243 if (backend_.get()) | 242 if (backend_.get()) |
244 backend_->Shutdown(); | 243 backend_->Shutdown(); |
245 backend_.reset(); | 244 backend_.reset(); |
246 } | 245 } |
247 | 246 |
OLD | NEW |