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_
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"
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
{
24 explicit AuthSyncObserver(Profile
* user_profile
);
25 ~AuthSyncObserver() override
;
27 void StartObserving();
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
);
43 DISALLOW_COPY_AND_ASSIGN(AuthSyncObserver
);
46 } // namespace chromeos
48 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_AUTH_SYNC_OBSERVER_H_