| 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_BROWSER_CHROME_TO_MOBILE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 virtual void Observe(int type, | 148 virtual void Observe(int type, |
| 149 const content::NotificationSource& source, | 149 const content::NotificationSource& source, |
| 150 const content::NotificationDetails& details) OVERRIDE; | 150 const content::NotificationDetails& details) OVERRIDE; |
| 151 | 151 |
| 152 // OAuth2AccessTokenConsumer methods. | 152 // OAuth2AccessTokenConsumer methods. |
| 153 virtual void OnGetTokenSuccess(const std::string& access_token, | 153 virtual void OnGetTokenSuccess(const std::string& access_token, |
| 154 const base::Time& expiration_time) OVERRIDE; | 154 const base::Time& expiration_time) OVERRIDE; |
| 155 virtual void OnGetTokenFailure(const GoogleServiceAuthError& error) OVERRIDE; | 155 virtual void OnGetTokenFailure(const GoogleServiceAuthError& error) OVERRIDE; |
| 156 | 156 |
| 157 // syncer::InvalidationHandler implementation. | 157 // syncer::InvalidationHandler implementation. |
| 158 virtual void OnNotificationsEnabled() OVERRIDE; | 158 virtual void OnInvalidatorStateChange( |
| 159 virtual void OnNotificationsDisabled( | 159 syncer::InvalidatorState state) OVERRIDE; |
| 160 syncer::NotificationsDisabledReason reason) OVERRIDE; | 160 virtual void OnIncomingInvalidation( |
| 161 virtual void OnIncomingNotification( | |
| 162 const syncer::ObjectIdStateMap& id_state_map, | 161 const syncer::ObjectIdStateMap& id_state_map, |
| 163 syncer::IncomingNotificationSource source) OVERRIDE; | 162 syncer::IncomingInvalidationSource source) OVERRIDE; |
| 164 | 163 |
| 165 // Expose access token accessors for test purposes. | 164 // Expose access token accessors for test purposes. |
| 166 const std::string& GetAccessTokenForTest() const; | 165 const std::string& GetAccessTokenForTest() const; |
| 167 void SetAccessTokenForTest(const std::string& access_token); | 166 void SetAccessTokenForTest(const std::string& access_token); |
| 168 | 167 |
| 169 private: | 168 private: |
| 170 friend class MockChromeToMobileService; | 169 friend class MockChromeToMobileService; |
| 171 | 170 |
| 172 // Enable or disable Chrome To Mobile with the browsers' command controllers. | 171 // Enable or disable Chrome To Mobile with the browsers' command controllers. |
| 173 // The feature state is automatically derived from internal conditions. | 172 // The feature state is automatically derived from internal conditions. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 scoped_ptr<OAuth2AccessTokenFetcher> access_token_fetcher_; | 226 scoped_ptr<OAuth2AccessTokenFetcher> access_token_fetcher_; |
| 228 base::OneShotTimer<ChromeToMobileService> auth_retry_timer_; | 227 base::OneShotTimer<ChromeToMobileService> auth_retry_timer_; |
| 229 | 228 |
| 230 // A queue of tasks to perform after an access token is lazily initialized. | 229 // A queue of tasks to perform after an access token is lazily initialized. |
| 231 std::queue<base::Closure> task_queue_; | 230 std::queue<base::Closure> task_queue_; |
| 232 | 231 |
| 233 DISALLOW_COPY_AND_ASSIGN(ChromeToMobileService); | 232 DISALLOW_COPY_AND_ASSIGN(ChromeToMobileService); |
| 234 }; | 233 }; |
| 235 | 234 |
| 236 #endif // CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_ | 235 #endif // CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_ |
| OLD | NEW |