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

Side by Side Diff: chrome/browser/signin/easy_unlock_service.h

Issue 880603003: Copy Smart Lock user preferences to local state so we can access them on the sign-in screen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_
6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ 6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 IDLE, 43 IDLE,
44 PENDING, 44 PENDING,
45 FAIL, 45 FAIL,
46 }; 46 };
47 47
48 enum Type { 48 enum Type {
49 TYPE_REGULAR, 49 TYPE_REGULAR,
50 TYPE_SIGNIN 50 TYPE_SIGNIN
51 }; 51 };
52 52
53 // Easy Unlock settings that the user can configure.
54 struct UserSettings {
55 UserSettings();
56 ~UserSettings();
57
58 // Whether to check that the remote device must be in very close proximity
59 // before allowing unlock (~1 feet).
60 bool check_close_proximity;
61 };
62
53 // Gets EasyUnlockService instance. 63 // Gets EasyUnlockService instance.
54 static EasyUnlockService* Get(Profile* profile); 64 static EasyUnlockService* Get(Profile* profile);
55 65
56 // Gets EasyUnlockService instance associated with a user if the user is 66 // Gets EasyUnlockService instance associated with a user if the user is
57 // logged in and his profile is initialized. 67 // logged in and his profile is initialized.
58 static EasyUnlockService* GetForUser(const user_manager::User& user); 68 static EasyUnlockService* GetForUser(const user_manager::User& user);
59 69
60 // Registers Easy Unlock profile preferences. 70 // Registers Easy Unlock profile preferences.
61 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); 71 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
62 72
63 // Registers Easy Unlock local state entries. 73 // Registers Easy Unlock local state entries.
64 static void RegisterPrefs(PrefRegistrySimple* registry); 74 static void RegisterPrefs(PrefRegistrySimple* registry);
65 75
66 // Removes the hardlock state for the given user. 76 // Removes the hardlock state for the given user.
67 static void ResetLocalStateForUser(const std::string& user_id); 77 static void ResetLocalStateForUser(const std::string& user_id);
68 78
79 // Returns the user's preferences.
80 static UserSettings GetUserSettings(const std::string& user_id);
81
69 // Returns true if Easy sign-in is enabled. 82 // Returns true if Easy sign-in is enabled.
70 static bool IsSignInEnabled(); 83 static bool IsSignInEnabled();
71 84
72 // Returns the EasyUnlockService type. 85 // Returns the EasyUnlockService type.
73 virtual Type GetType() const = 0; 86 virtual Type GetType() const = 0;
74 87
75 // Returns the user currently associated with the service. 88 // Returns the user currently associated with the service.
76 virtual std::string GetUserEmail() const = 0; 89 virtual std::string GetUserEmail() const = 0;
77 90
78 // Launches Easy Unlock Setup app. 91 // Launches Easy Unlock Setup app.
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 bool tpm_key_checked_; 292 bool tpm_key_checked_;
280 293
281 ObserverList<EasyUnlockServiceObserver> observers_; 294 ObserverList<EasyUnlockServiceObserver> observers_;
282 295
283 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; 296 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_;
284 297
285 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); 298 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService);
286 }; 299 };
287 300
288 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ 301 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698