OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.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(switch_string); | 39 cmd_line.AppendSwitch(switch_string); |
40 | 40 |
| 41 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 42 base::ProcessHandle pid = 0; |
| 43 base::LaunchProcess(cmd_line, base::LaunchOptions(), &pid); |
| 44 base::EnsureProcessGetsReaped(pid); |
| 45 #else |
41 base::LaunchProcess(cmd_line, base::LaunchOptions(), NULL); | 46 base::LaunchProcess(cmd_line, base::LaunchOptions(), NULL); |
| 47 #endif |
42 } | 48 } |
43 | 49 |
44 // This method is invoked on the IO thread to launch the browser process to | 50 // This method is invoked on the IO thread to launch the browser process to |
45 // display a desktop notification that the Cloud Print token is invalid and | 51 // display a desktop notification that the Cloud Print token is invalid and |
46 // needs re-authentication. | 52 // needs re-authentication. |
47 void ShowTokenExpiredNotificationInBrowser() { | 53 void ShowTokenExpiredNotificationInBrowser() { |
48 LaunchBrowserProcessWithSwitch(switches::kNotifyCloudPrintTokenExpired); | 54 LaunchBrowserProcessWithSwitch(switches::kNotifyCloudPrintTokenExpired); |
49 } | 55 } |
50 | 56 |
51 void CheckCloudPrintProxyPolicyInBrowser() { | 57 void CheckCloudPrintProxyPolicyInBrowser() { |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 // Finish disabling cloud print for this user. | 283 // Finish disabling cloud print for this user. |
278 DisableForUser(); | 284 DisableForUser(); |
279 } | 285 } |
280 | 286 |
281 void CloudPrintProxy::ShutdownBackend() { | 287 void CloudPrintProxy::ShutdownBackend() { |
282 DCHECK(CalledOnValidThread()); | 288 DCHECK(CalledOnValidThread()); |
283 if (backend_.get()) | 289 if (backend_.get()) |
284 backend_->Shutdown(); | 290 backend_->Shutdown(); |
285 backend_.reset(); | 291 backend_.reset(); |
286 } | 292 } |
OLD | NEW |