| 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_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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // Returns the proxy info. | 47 // Returns the proxy info. |
| 48 void GetProxyInfo(cloud_print::CloudPrintProxyInfo* info); | 48 void GetProxyInfo(cloud_print::CloudPrintProxyInfo* info); |
| 49 | 49 |
| 50 const std::string& user_email() const { | 50 const std::string& user_email() const { |
| 51 return user_email_; | 51 return user_email_; |
| 52 } | 52 } |
| 53 | 53 |
| 54 // CloudPrintProxyFrontend implementation. Called on UI thread. | 54 // CloudPrintProxyFrontend implementation. Called on UI thread. |
| 55 virtual void OnAuthenticated(const std::string& robot_oauth_refresh_token, | 55 virtual void OnAuthenticated(const std::string& robot_oauth_refresh_token, |
| 56 const std::string& robot_email, | 56 const std::string& robot_email, |
| 57 const std::string& user_email); | 57 const std::string& user_email) OVERRIDE; |
| 58 virtual void OnAuthenticationFailed(); | 58 virtual void OnAuthenticationFailed() OVERRIDE; |
| 59 virtual void OnPrintSystemUnavailable(); | 59 virtual void OnPrintSystemUnavailable() OVERRIDE; |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 void Shutdown(); | 62 void Shutdown(); |
| 63 bool CreateBackend(); | 63 bool CreateBackend(); |
| 64 | 64 |
| 65 // Our asynchronous backend to communicate with sync components living on | 65 // Our asynchronous backend to communicate with sync components living on |
| 66 // other threads. | 66 // other threads. |
| 67 scoped_ptr<CloudPrintProxyBackend> backend_; | 67 scoped_ptr<CloudPrintProxyBackend> backend_; |
| 68 // This class does not own this. It is guaranteed to remain valid for the | 68 // This class does not own this. It is guaranteed to remain valid for the |
| 69 // lifetime of this class. | 69 // lifetime of this class. |
| 70 ServiceProcessPrefs* service_prefs_; | 70 ServiceProcessPrefs* service_prefs_; |
| 71 // This class does not own this. If non-NULL, It is guaranteed to remain | 71 // This class does not own this. If non-NULL, It is guaranteed to remain |
| 72 // valid for the lifetime of this class. | 72 // valid for the lifetime of this class. |
| 73 Client* client_; | 73 Client* client_; |
| 74 // The email address of the account used to authenticate to the Cloud Print | 74 // The email address of the account used to authenticate to the Cloud Print |
| 75 // service. | 75 // service. |
| 76 std::string user_email_; | 76 std::string user_email_; |
| 77 // This is set to true when the Cloud Print proxy is enabled and after | 77 // This is set to true when the Cloud Print proxy is enabled and after |
| 78 // successful authentication with the Cloud Print service. | 78 // successful authentication with the Cloud Print service. |
| 79 bool enabled_; | 79 bool enabled_; |
| 80 // This is initialized after a successful call to one of the Enable* methods. | 80 // This is initialized after a successful call to one of the Enable* methods. |
| 81 // It is not cleared in DisableUser. | 81 // It is not cleared in DisableUser. |
| 82 std::string proxy_id_; | 82 std::string proxy_id_; |
| 83 | 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(CloudPrintProxy); | 84 DISALLOW_COPY_AND_ASSIGN(CloudPrintProxy); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_H_ | 87 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_H_ |
| OLD | NEW |