| 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 #ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_H_ | 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_H_ |
| 6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_H_ | 6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/threading/non_thread_safe.h" | 14 #include "base/sequence_checker.h" |
| 15 #include "chrome/service/cloud_print/cloud_print_proxy_backend.h" | 15 #include "chrome/service/cloud_print/cloud_print_proxy_backend.h" |
| 16 #include "chrome/service/cloud_print/cloud_print_wipeout.h" | 16 #include "chrome/service/cloud_print/cloud_print_wipeout.h" |
| 17 | 17 |
| 18 class ServiceProcessPrefs; | 18 class ServiceProcessPrefs; |
| 19 | 19 |
| 20 namespace cloud_print { | 20 namespace cloud_print { |
| 21 | 21 |
| 22 struct CloudPrintProxyInfo; | 22 struct CloudPrintProxyInfo; |
| 23 | 23 |
| 24 // CloudPrintProxy is the layer between the service process UI thread | 24 // CloudPrintProxy is the layer between the service process UI thread |
| 25 // and the cloud print proxy backend. | 25 // and the cloud print proxy backend. |
| 26 class CloudPrintProxy : public CloudPrintProxyFrontend, | 26 class CloudPrintProxy : public CloudPrintProxyFrontend, |
| 27 public CloudPrintWipeout::Client, | 27 public CloudPrintWipeout::Client { |
| 28 public base::NonThreadSafe { | |
| 29 public: | 28 public: |
| 30 class Client { | 29 class Client { |
| 31 public: | 30 public: |
| 32 virtual ~Client() {} | 31 virtual ~Client() {} |
| 33 virtual void OnCloudPrintProxyEnabled(bool persist_state) {} | 32 virtual void OnCloudPrintProxyEnabled(bool persist_state) {} |
| 34 virtual void OnCloudPrintProxyDisabled(bool persist_state) {} | 33 virtual void OnCloudPrintProxyDisabled(bool persist_state) {} |
| 35 }; | 34 }; |
| 36 CloudPrintProxy(); | 35 CloudPrintProxy(); |
| 37 ~CloudPrintProxy() override; | 36 ~CloudPrintProxy() override; |
| 38 | 37 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 Client* client_; | 91 Client* client_; |
| 93 // The email address of the account used to authenticate to the Cloud Print | 92 // The email address of the account used to authenticate to the Cloud Print |
| 94 // service. | 93 // service. |
| 95 std::string user_email_; | 94 std::string user_email_; |
| 96 // This is set to true when the Cloud Print proxy is enabled and after | 95 // This is set to true when the Cloud Print proxy is enabled and after |
| 97 // successful authentication with the Cloud Print service. | 96 // successful authentication with the Cloud Print service. |
| 98 bool enabled_; | 97 bool enabled_; |
| 99 // This is a cleanup class for unregistering printers on proxy disable. | 98 // This is a cleanup class for unregistering printers on proxy disable. |
| 100 std::unique_ptr<CloudPrintWipeout> wipeout_; | 99 std::unique_ptr<CloudPrintWipeout> wipeout_; |
| 101 | 100 |
| 101 SEQUENCE_CHECKER(sequence_checker_); |
| 102 |
| 102 DISALLOW_COPY_AND_ASSIGN(CloudPrintProxy); | 103 DISALLOW_COPY_AND_ASSIGN(CloudPrintProxy); |
| 103 }; | 104 }; |
| 104 | 105 |
| 105 } // namespace cloud_print | 106 } // namespace cloud_print |
| 106 | 107 |
| 107 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_H_ | 108 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_H_ |
| OLD | NEW |