Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6749)

Unified Diff: chrome/browser/signin/easy_unlock_service.h

Issue 475483003: Wire easy unlock settings UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
« no previous file with comments | « chrome/browser/resources/options/easy_unlock_turn_off_overlay.js ('k') | chrome/browser/signin/easy_unlock_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698