| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // Launches a browser to see if the proxy policy has been set. | 57 // Launches a browser to see if the proxy policy has been set. |
| 58 void CheckCloudPrintProxyPolicy(); | 58 void CheckCloudPrintProxyPolicy(); |
| 59 | 59 |
| 60 const std::string& user_email() const { | 60 const std::string& user_email() const { |
| 61 return user_email_; | 61 return user_email_; |
| 62 } | 62 } |
| 63 | 63 |
| 64 // CloudPrintProxyFrontend implementation. Called on UI thread. | 64 // CloudPrintProxyFrontend implementation. Called on UI thread. |
| 65 virtual void OnAuthenticated(const std::string& robot_oauth_refresh_token, | 65 virtual void OnAuthenticated(const std::string& robot_oauth_refresh_token, |
| 66 const std::string& robot_email, | 66 const std::string& robot_email, |
| 67 const std::string& user_email) OVERRIDE; | 67 const std::string& user_email) override; |
| 68 virtual void OnAuthenticationFailed() OVERRIDE; | 68 virtual void OnAuthenticationFailed() override; |
| 69 virtual void OnPrintSystemUnavailable() OVERRIDE; | 69 virtual void OnPrintSystemUnavailable() override; |
| 70 virtual void OnUnregisterPrinters( | 70 virtual void OnUnregisterPrinters( |
| 71 const std::string& auth_token, | 71 const std::string& auth_token, |
| 72 const std::list<std::string>& printer_ids) OVERRIDE; | 72 const std::list<std::string>& printer_ids) override; |
| 73 virtual void OnXmppPingUpdated(int ping_timeout) OVERRIDE; | 73 virtual void OnXmppPingUpdated(int ping_timeout) override; |
| 74 | 74 |
| 75 // CloudPrintWipeout::Client implementation. | 75 // CloudPrintWipeout::Client implementation. |
| 76 virtual void OnUnregisterPrintersComplete() OVERRIDE; | 76 virtual void OnUnregisterPrintersComplete() override; |
| 77 | 77 |
| 78 protected: | 78 protected: |
| 79 void ShutdownBackend(); | 79 void ShutdownBackend(); |
| 80 bool CreateBackend(); | 80 bool CreateBackend(); |
| 81 | 81 |
| 82 // Our asynchronous backend to communicate with sync components living on | 82 // Our asynchronous backend to communicate with sync components living on |
| 83 // other threads. | 83 // other threads. |
| 84 scoped_ptr<CloudPrintProxyBackend> backend_; | 84 scoped_ptr<CloudPrintProxyBackend> backend_; |
| 85 // This class does not own this. It is guaranteed to remain valid for the | 85 // This class does not own this. It is guaranteed to remain valid for the |
| 86 // lifetime of this class. | 86 // lifetime of this class. |
| 87 ServiceProcessPrefs* service_prefs_; | 87 ServiceProcessPrefs* service_prefs_; |
| 88 // This class does not own this. If non-NULL, It is guaranteed to remain | 88 // This class does not own this. If non-NULL, It is guaranteed to remain |
| 89 // valid for the lifetime of this class. | 89 // valid for the lifetime of this class. |
| 90 Client* client_; | 90 Client* client_; |
| 91 // The email address of the account used to authenticate to the Cloud Print | 91 // The email address of the account used to authenticate to the Cloud Print |
| 92 // service. | 92 // service. |
| 93 std::string user_email_; | 93 std::string user_email_; |
| 94 // This is set to true when the Cloud Print proxy is enabled and after | 94 // This is set to true when the Cloud Print proxy is enabled and after |
| 95 // successful authentication with the Cloud Print service. | 95 // successful authentication with the Cloud Print service. |
| 96 bool enabled_; | 96 bool enabled_; |
| 97 // This is a cleanup class for unregistering printers on proxy disable. | 97 // This is a cleanup class for unregistering printers on proxy disable. |
| 98 scoped_ptr<CloudPrintWipeout> wipeout_; | 98 scoped_ptr<CloudPrintWipeout> wipeout_; |
| 99 | 99 |
| 100 DISALLOW_COPY_AND_ASSIGN(CloudPrintProxy); | 100 DISALLOW_COPY_AND_ASSIGN(CloudPrintProxy); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace cloud_print | 103 } // namespace cloud_print |
| 104 | 104 |
| 105 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_H_ | 105 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_H_ |
| OLD | NEW |