| Index: chrome/browser/signin/easy_unlock_service.h
|
| diff --git a/chrome/browser/signin/easy_unlock_service.h b/chrome/browser/signin/easy_unlock_service.h
|
| index dda962f09e745f3d793809e646ff64810db19919..0bb2318d5bb129ea9ae8994383205e2431185b1c 100644
|
| --- a/chrome/browser/signin/easy_unlock_service.h
|
| +++ b/chrome/browser/signin/easy_unlock_service.h
|
| @@ -6,18 +6,33 @@
|
| #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_
|
|
|
| #include "base/macros.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| #include "base/memory/weak_ptr.h"
|
| +#include "base/observer_list.h"
|
| #include "base/prefs/pref_change_registrar.h"
|
| #include "components/keyed_service/core/keyed_service.h"
|
|
|
| +namespace base {
|
| +class DictionaryValue;
|
| +class ListValue;
|
| +}
|
| +
|
| namespace user_prefs {
|
| class PrefRegistrySyncable;
|
| }
|
|
|
| +class EasyUnlockServiceObserver;
|
| +class EasyUnlockToggleFlow;
|
| class Profile;
|
|
|
| class EasyUnlockService : public KeyedService {
|
| public:
|
| + enum TurnOffFlowStatus {
|
| + IDLE,
|
| + PENDING,
|
| + FAIL,
|
| + };
|
| +
|
| explicit EasyUnlockService(Profile* profile);
|
| virtual ~EasyUnlockService();
|
|
|
| @@ -35,14 +50,42 @@ class EasyUnlockService : public KeyedService {
|
| // permitted either the flag is enabled or its field trial is enabled.
|
| bool IsAllowed();
|
|
|
| + // Gets/Sets/Clears the permit access for the local device.
|
| + const base::DictionaryValue* GetPermitAccess() const;
|
| + void SetPermitAccess(const base::DictionaryValue& permit);
|
| + void ClearPermitAccess();
|
| +
|
| + // Gets/Sets/Clears the remote devices list.
|
| + const base::ListValue* GetRemoteDevices() const;
|
| + void SetRemoteDevices(const base::ListValue& devices);
|
| + void ClearRemoteDevices();
|
| +
|
| + void RunTurnOffFlow();
|
| + void ResetTurnOffFlow();
|
| +
|
| + void AddObserver(EasyUnlockServiceObserver* observer);
|
| + void RemoveObserver(EasyUnlockServiceObserver* observer);
|
| +
|
| + TurnOffFlowStatus turn_off_flow_status() const {
|
| + return turn_off_flow_status_;
|
| + }
|
| +
|
| private:
|
| void Initialize();
|
| void LoadApp();
|
| void UnloadApp();
|
| void OnPrefsChanged();
|
|
|
| + void SetTurnOffFlowStatus(TurnOffFlowStatus status);
|
| + void OnTurnOffFlowFinished(bool success);
|
| +
|
| Profile* profile_;
|
| PrefChangeRegistrar registrar_;
|
| + ObserverList<EasyUnlockServiceObserver> observers_;
|
| +
|
| + TurnOffFlowStatus turn_off_flow_status_;
|
| + scoped_ptr<EasyUnlockToggleFlow> turn_off_flow_;
|
| +
|
| base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(EasyUnlockService);
|
|
|