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 a8379f7403497402bacd4a4c2ca8690746bdadd7..996b4110c5dfc1720b90ad22c37f7f3a71562c1a 100644 |
--- a/chrome/browser/signin/easy_unlock_service.h |
+++ b/chrome/browser/signin/easy_unlock_service.h |
@@ -6,19 +6,34 @@ |
#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 EasyUnlockScreenlockStateHandler; |
+class EasyUnlockServiceObserver; |
+class EasyUnlockToggleFlow; |
class Profile; |
class EasyUnlockService : public KeyedService { |
public: |
+ enum TurnOffFlowStatus { |
+ IDLE, |
+ PENDING, |
+ FAIL, |
+ }; |
+ |
explicit EasyUnlockService(Profile* profile); |
virtual ~EasyUnlockService(); |
@@ -42,16 +57,44 @@ class EasyUnlockService : public KeyedService { |
// Unlock gets disabled. |
EasyUnlockScreenlockStateHandler* GetScreenlockStateHandler(); |
+ // 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_; |
// Created lazily in |GetScreenlockStateHandler|. |
scoped_ptr<EasyUnlockScreenlockStateHandler> screenlock_state_handler_; |
+ |
+ TurnOffFlowStatus turn_off_flow_status_; |
+ scoped_ptr<EasyUnlockToggleFlow> turn_off_flow_; |
+ ObserverList<EasyUnlockServiceObserver> observers_; |
+ |
base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; |
DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); |