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" |
| 6 #include "chrome/browser/service/service_process_control.h" |
| 7 #include "chrome/common/service_messages.h" |
| 8 |
| 9 namespace cloud_print { |
| 10 void VirtualDriverInstallHelper::SetUpInstall() { |
| 11 scoped_refptr<VirtualDriverInstallHelper> help = |
| 12 new VirtualDriverInstallHelper(); |
| 13 ServiceProcessControl::GetInstance()->Launch(NewRunnableMethod(help.get(), |
| 14 &VirtualDriverInstallHelper::InstallVirtualDriverTask), |
| 15 NULL); |
| 16 } |
| 17 |
| 18 void VirtualDriverInstallHelper::SetUpUninstall() { |
| 19 scoped_refptr<VirtualDriverInstallHelper> help = |
| 20 new VirtualDriverInstallHelper(); |
| 21 ServiceProcessControl::GetInstance()->Launch(NewRunnableMethod(help.get(), |
| 22 &VirtualDriverInstallHelper::UninstallVirtualDriverTask) |
| 23 , NULL); |
| 24 } |
| 25 |
| 26 void VirtualDriverInstallHelper::InstallVirtualDriverTask() { |
| 27 ServiceProcessControl* process_control = |
| 28 ServiceProcessControl::GetInstance(); |
| 29 DCHECK(process_control->is_connected()); |
| 30 process_control->Send(new ServiceMsg_EnableVirtualDriver()); |
| 31 } |
| 32 |
| 33 void VirtualDriverInstallHelper::UninstallVirtualDriverTask() { |
| 34 ServiceProcessControl* process_control = |
| 35 ServiceProcessControl::GetInstance(); |
| 36 DCHECK(process_control->is_connected()); |
| 37 process_control->Send(new ServiceMsg_DisableVirtualDriver()); |
| 38 } |
| 39 } |
OLD | NEW |