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 |
| 11 void VirtualDriverInstallHelper::SetUpInstall() { |
| 12 scoped_refptr<VirtualDriverInstallHelper> help = |
| 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 |
| 44 |
OLD | NEW |