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

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

Issue 446743003: Hook up new API for easy unlock to update lock screen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 unified diff | Download patch | Annotate | Revision Log
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 "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/prefs/pref_change_registrar.h" 10 #include "base/prefs/pref_change_registrar.h"
11 #include "components/keyed_service/core/keyed_service.h" 11 #include "components/keyed_service/core/keyed_service.h"
12 12
13 namespace user_prefs { 13 namespace user_prefs {
14 class PrefRegistrySyncable; 14 class PrefRegistrySyncable;
15 } 15 }
16 16
17 class EasyUnlockScreenlockStateHandler;
17 class Profile; 18 class Profile;
18 19
19 class EasyUnlockService : public KeyedService { 20 class EasyUnlockService : public KeyedService {
20 public: 21 public:
21 explicit EasyUnlockService(Profile* profile); 22 explicit EasyUnlockService(Profile* profile);
22 virtual ~EasyUnlockService(); 23 virtual ~EasyUnlockService();
23 24
24 // Gets EasyUnlockService instance. 25 // Gets EasyUnlockService instance.
25 static EasyUnlockService* Get(Profile* profile); 26 static EasyUnlockService* Get(Profile* profile);
26 27
27 // Registers Easy Unlock profile preferences. 28 // Registers Easy Unlock profile preferences.
28 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); 29 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
29 30
30 // Launches Easy Unlock Setup app. 31 // Launches Easy Unlock Setup app.
31 void LaunchSetup(); 32 void LaunchSetup();
32 33
33 // Whether easy unlock is allowed to be used. If the controlling preference 34 // Whether easy unlock is allowed to be used. If the controlling preference
34 // is set (from policy), this returns the preference value. Otherwise, it is 35 // is set (from policy), this returns the preference value. Otherwise, it is
35 // permitted either the flag is enabled or its field trial is enabled. 36 // permitted either the flag is enabled or its field trial is enabled.
36 bool IsAllowed(); 37 bool IsAllowed();
37 38
39 // Gets |screenlock_state_handler_|. Returns NULL if Easy Unlock is not
40 // allowed. Otherwise, if |screenlock_state_handler_| is not set, an instance
41 // is created. Do not cache the returned value, as it may go away if Easy
42 // Unlock gets disabled.
43 EasyUnlockScreenlockStateHandler* GetScreenlockStateHandler();
44
38 private: 45 private:
39 void Initialize(); 46 void Initialize();
40 void LoadApp(); 47 void LoadApp();
41 void UnloadApp(); 48 void UnloadApp();
42 void OnPrefsChanged(); 49 void OnPrefsChanged();
43 50
44 Profile* profile_; 51 Profile* profile_;
45 PrefChangeRegistrar registrar_; 52 PrefChangeRegistrar registrar_;
53 // Created lazily in |GetScreenlockStateHandler|.
54 scoped_ptr<EasyUnlockScreenlockStateHandler> screenlock_state_handler_;
46 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; 55 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_;
47 56
48 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); 57 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService);
49 }; 58 };
50 59
51 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ 60 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/signin/easy_unlock_screenlock_state_handler.cc ('k') | chrome/browser/signin/easy_unlock_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698