| 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 #ifndef CHROME_BROWSER_PRINTING_CLOUD_PRINT_VIRTUAL_DRIVER_INSTALL_HELPER_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_CLOUD_PRINT_VIRTUAL_DRIVER_INSTALL_HELPER_H_ |
| 6 #define CHROME_BROWSER_PRINTING_CLOUD_PRINT_VIRTUAL_DRIVER_INSTALL_HELPER_H_ | 6 #define CHROME_BROWSER_PRINTING_CLOUD_PRINT_VIRTUAL_DRIVER_INSTALL_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 | 12 |
| 13 namespace cloud_print { | 13 namespace cloud_print { |
| 14 | 14 |
| 15 // Helper class to register the Cloud Print Driver with the service process. | 15 // Helper class to register the Cloud Print Driver with the service process. |
| 16 class VirtualDriverInstallHelper | 16 class VirtualDriverInstallHelper |
| 17 : public base::RefCountedThreadSafe<VirtualDriverInstallHelper> { | 17 : public base::RefCountedThreadSafe<VirtualDriverInstallHelper> { |
| 18 public: | 18 public: |
| 19 // Uses ServiceProcessControl to asynchronously get an instance | 19 // Uses ServiceProcessControl to asynchronously get an instance |
| 20 // of the Service Process, launching it if necessary, and register | 20 // of the Service Process, launching it if necessary, and register |
| 21 // either InstallVirtualDriverTask or UninstallVirtualDriverTask as the | 21 // either InstallVirtualDriverTask or UninstallVirtualDriverTask as the |
| 22 // Task to be called once we have an instance of the ServiceProcess. | 22 // Task to be called once we have an instance of the ServiceProcess. |
| 23 static void SetUpInstall(); | 23 static void SetUpInstall(); |
| 24 static void SetUpUninstall(); | 24 static void SetUpUninstall(); |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 friend class base::RefCountedThreadSafe<VirtualDriverInstallHelper>; |
| 28 |
| 29 ~VirtualDriverInstallHelper() {} |
| 30 |
| 27 void InstallVirtualDriverTask(); | 31 void InstallVirtualDriverTask(); |
| 28 void UninstallVirtualDriverTask(); | 32 void UninstallVirtualDriverTask(); |
| 29 }; | 33 }; |
| 30 | 34 |
| 31 } // namespace cloud_print | 35 } // namespace cloud_print |
| 32 | 36 |
| 33 #endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_VIRTUAL_DRIVER_INSTALL_HELPER_H_ | 37 #endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_VIRTUAL_DRIVER_INSTALL_HELPER_H_ |
| 34 | 38 |
| OLD | NEW |