| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_CLOUD_PRINT_PROXY_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_PROXY_SERVICE_H_ |
| 6 #define CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_PROXY_SERVICE_H_ | 6 #define CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_PROXY_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 #include "chrome/browser/profile.h" | 13 #include "base/ref_counted.h" |
| 14 | |
| 15 | 14 |
| 16 class Profile; | 15 class Profile; |
| 17 | 16 |
| 18 // Layer between the browser user interface and the cloud print proxy code | 17 // Layer between the browser user interface and the cloud print proxy code |
| 19 // running in the service process. | 18 // running in the service process. |
| 20 class CloudPrintProxyService { | 19 class CloudPrintProxyService { |
| 21 public: | 20 public: |
| 22 explicit CloudPrintProxyService(Profile* profile); | 21 explicit CloudPrintProxyService(Profile* profile); |
| 23 virtual ~CloudPrintProxyService(); | 22 virtual ~CloudPrintProxyService(); |
| 24 | 23 |
| 25 // Initializes the object. This should be called every time an object of this | 24 // Initializes the object. This should be called every time an object of this |
| 26 // class is constructed. | 25 // class is constructed. |
| 27 void Initialize(); | 26 void Initialize(); |
| 28 | 27 |
| 29 // Enables/disables cloud printing for the user | 28 // Enables/disables cloud printing for the user |
| 30 virtual void EnableForUser(const std::string& auth_token); | 29 virtual void EnableForUser(const std::string& auth_token); |
| 31 virtual void DisableForUser(); | 30 virtual void DisableForUser(); |
| 32 | 31 |
| 33 protected: | 32 bool ShowTokenExpiredNotification(); |
| 33 |
| 34 private: |
| 35 // NotificationDelegate implementation for the token expired notification. |
| 36 class TokenExpiredNotificationDelegate; |
| 37 friend class TokenExpiredNotificationDelegate; |
| 38 |
| 39 Profile* profile_; |
| 40 scoped_refptr<TokenExpiredNotificationDelegate> token_expired_delegate_; |
| 41 |
| 34 void Shutdown(); | 42 void Shutdown(); |
| 43 void OnTokenExpiredNotificationError(); |
| 44 void OnTokenExpiredNotificationClosed(bool by_user); |
| 45 void OnTokenExpiredNotificationClick(); |
| 46 void TokenExpiredNotificationDone(); |
| 47 |
| 35 | 48 |
| 36 DISALLOW_COPY_AND_ASSIGN(CloudPrintProxyService); | 49 DISALLOW_COPY_AND_ASSIGN(CloudPrintProxyService); |
| 37 }; | 50 }; |
| 38 | 51 |
| 39 #endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_PROXY_SERVICE_H_ | 52 #endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_PROXY_SERVICE_H_ |
| OLD | NEW |