Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / chromeos / login / signin / auth_sync_observer.h
blob983f7ac2654ba5528bc15236652e9640ca23bf7c
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_AUTH_SYNC_OBSERVER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_AUTH_SYNC_OBSERVER_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "components/keyed_service/core/keyed_service.h"
13 #include "components/sync_driver/sync_service_observer.h"
15 class Profile;
17 namespace chromeos {
19 // This class is responsible for detecting authentication problems reported
20 // by sync service and
21 class AuthSyncObserver : public KeyedService,
22 public sync_driver::SyncServiceObserver {
23 public:
24 explicit AuthSyncObserver(Profile* user_profile);
25 ~AuthSyncObserver() override;
27 void StartObserving();
29 private:
30 friend class AuthSyncObserverFactory;
32 // KeyedService implementation.
33 void Shutdown() override;
35 // sync_driver::SyncServiceObserver implementation.
36 void OnStateChanged() override;
38 // Called on attempt to restore supervised user token.
39 void OnSupervisedTokenLoaded(const std::string& token);
41 Profile* profile_;
43 DISALLOW_COPY_AND_ASSIGN(AuthSyncObserver);
46 } // namespace chromeos
48 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_AUTH_SYNC_OBSERVER_H_