OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/printing/cloud_print/virtual_driver_install_helper.h" | |
Nico
2011/08/01 21:31:12
One newline here. The standard format is
#include
abeera
2011/08/02 01:21:02
Done.
| |
6 #include "chrome/browser/service/service_process_control.h" | |
7 #include "chrome/common/service_messages.h" | |
8 | |
9 namespace cloud_print { | |
10 | |
11 void VirtualDriverInstallHelper::SetUpInstall() { | |
12 scoped_refptr<VirtualDriverInstallHelper> help = | |
Nico
2011/08/01 21:31:12
NewRunnableMethod() retains its argument, so no ne
abeera
2011/08/02 01:21:02
To post a task, a class needs to extend from RefCo
| |
13 new VirtualDriverInstallHelper(); | |
14 ServiceProcessControl::GetInstance()->Launch( | |
15 NewRunnableMethod( | |
16 help.get(), &VirtualDriverInstallHelper::InstallVirtualDriverTask), | |
17 NULL); | |
18 } | |
19 | |
20 void VirtualDriverInstallHelper::SetUpUninstall() { | |
21 scoped_refptr<VirtualDriverInstallHelper> help = | |
22 new VirtualDriverInstallHelper(); | |
23 ServiceProcessControl::GetInstance()->Launch( | |
24 NewRunnableMethod( | |
25 help.get(), &VirtualDriverInstallHelper::UninstallVirtualDriverTask), | |
26 NULL); | |
27 } | |
28 | |
29 void VirtualDriverInstallHelper::InstallVirtualDriverTask() { | |
30 ServiceProcessControl* process_control = | |
31 ServiceProcessControl::GetInstance(); | |
32 DCHECK(process_control->is_connected()); | |
33 process_control->Send(new ServiceMsg_EnableVirtualDriver()); | |
34 } | |
35 | |
36 void VirtualDriverInstallHelper::UninstallVirtualDriverTask() { | |
37 ServiceProcessControl* process_control = | |
38 ServiceProcessControl::GetInstance(); | |
39 DCHECK(process_control->is_connected()); | |
40 process_control->Send(new ServiceMsg_DisableVirtualDriver()); | |
41 } | |
42 | |
43 } // namespace cloud_print | |
OLD | NEW |