| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROMEOS_LOGIN_SIGNIN_AUTH_SYNC_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_AUTH_SYNC_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_AUTH_SYNC_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_AUTH_SYNC_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "components/keyed_service/core/keyed_service.h" | 12 #include "components/keyed_service/core/keyed_service.h" |
| 13 #include "components/sync/driver/sync_service_observer.h" | 13 #include "components/sync/driver/sync_service_observer.h" |
| 14 | 14 |
| 15 class Profile; | 15 class Profile; |
| 16 | 16 |
| 17 namespace chromeos { | 17 namespace chromeos { |
| 18 | 18 |
| 19 // This class is responsible for detecting authentication problems reported | 19 // This class is responsible for detecting authentication problems reported |
| 20 // by sync service and | 20 // by sync service and |
| 21 class AuthSyncObserver : public KeyedService, | 21 class AuthSyncObserver : public KeyedService, |
| 22 public syncer::SyncServiceObserver { | 22 public sync_driver::SyncServiceObserver { |
| 23 public: | 23 public: |
| 24 explicit AuthSyncObserver(Profile* user_profile); | 24 explicit AuthSyncObserver(Profile* user_profile); |
| 25 ~AuthSyncObserver() override; | 25 ~AuthSyncObserver() override; |
| 26 | 26 |
| 27 void StartObserving(); | 27 void StartObserving(); |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 friend class AuthSyncObserverFactory; | 30 friend class AuthSyncObserverFactory; |
| 31 | 31 |
| 32 // KeyedService implementation. | 32 // KeyedService implementation. |
| 33 void Shutdown() override; | 33 void Shutdown() override; |
| 34 | 34 |
| 35 // syncer::SyncServiceObserver implementation. | 35 // sync_driver::SyncServiceObserver implementation. |
| 36 void OnStateChanged() override; | 36 void OnStateChanged() override; |
| 37 | 37 |
| 38 // Called on attempt to restore supervised user token. | 38 // Called on attempt to restore supervised user token. |
| 39 void OnSupervisedTokenLoaded(const std::string& token); | 39 void OnSupervisedTokenLoaded(const std::string& token); |
| 40 | 40 |
| 41 Profile* profile_; | 41 Profile* profile_; |
| 42 | 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(AuthSyncObserver); | 43 DISALLOW_COPY_AND_ASSIGN(AuthSyncObserver); |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 } // namespace chromeos | 46 } // namespace chromeos |
| 47 | 47 |
| 48 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_AUTH_SYNC_OBSERVER_H_ | 48 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_AUTH_SYNC_OBSERVER_H_ |
| OLD | NEW |