OLD | NEW |
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_REGULAR_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_ |
6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_ | 6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/prefs/pref_change_registrar.h" | 12 #include "base/prefs/pref_change_registrar.h" |
13 #include "chrome/browser/signin/easy_unlock_service.h" | 13 #include "chrome/browser/signin/easy_unlock_service.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class DictionaryValue; | 16 class DictionaryValue; |
17 class ListValue; | 17 class ListValue; |
18 } | 18 } |
19 | 19 |
20 class EasyUnlockToggleFlow; | 20 class EasyUnlockToggleFlow; |
21 class Profile; | 21 class Profile; |
22 | 22 |
23 // EasyUnlockService instance that should be used for regular, non-signin | 23 // EasyUnlockService instance that should be used for regular, non-signin |
24 // profiles. | 24 // profiles. |
25 class EasyUnlockServiceRegular : public EasyUnlockService { | 25 class EasyUnlockServiceRegular : public EasyUnlockService { |
26 public: | 26 public: |
27 explicit EasyUnlockServiceRegular(Profile* profile); | 27 explicit EasyUnlockServiceRegular(Profile* profile); |
28 virtual ~EasyUnlockServiceRegular(); | 28 ~EasyUnlockServiceRegular() override; |
29 | 29 |
30 private: | 30 private: |
31 // EasyUnlockService implementation. | 31 // EasyUnlockService implementation. |
32 virtual EasyUnlockService::Type GetType() const override; | 32 EasyUnlockService::Type GetType() const override; |
33 virtual std::string GetUserEmail() const override; | 33 std::string GetUserEmail() const override; |
34 virtual void LaunchSetup() override; | 34 void LaunchSetup() override; |
35 virtual const base::DictionaryValue* GetPermitAccess() const override; | 35 const base::DictionaryValue* GetPermitAccess() const override; |
36 virtual void SetPermitAccess(const base::DictionaryValue& permit) override; | 36 void SetPermitAccess(const base::DictionaryValue& permit) override; |
37 virtual void ClearPermitAccess() override; | 37 void ClearPermitAccess() override; |
38 virtual const base::ListValue* GetRemoteDevices() const override; | 38 const base::ListValue* GetRemoteDevices() const override; |
39 virtual void SetRemoteDevices(const base::ListValue& devices) override; | 39 void SetRemoteDevices(const base::ListValue& devices) override; |
40 virtual void ClearRemoteDevices() override; | 40 void ClearRemoteDevices() override; |
41 virtual void RunTurnOffFlow() override; | 41 void RunTurnOffFlow() override; |
42 virtual void ResetTurnOffFlow() override; | 42 void ResetTurnOffFlow() override; |
43 virtual TurnOffFlowStatus GetTurnOffFlowStatus() const override; | 43 TurnOffFlowStatus GetTurnOffFlowStatus() const override; |
44 virtual std::string GetChallenge() const override; | 44 std::string GetChallenge() const override; |
45 virtual std::string GetWrappedSecret() const override; | 45 std::string GetWrappedSecret() const override; |
46 virtual void InitializeInternal() override; | 46 void InitializeInternal() override; |
47 virtual void ShutdownInternal() override; | 47 void ShutdownInternal() override; |
48 virtual bool IsAllowedInternal() override; | 48 bool IsAllowedInternal() override; |
49 | 49 |
50 // Callback when the controlling pref changes. | 50 // Callback when the controlling pref changes. |
51 void OnPrefsChanged(); | 51 void OnPrefsChanged(); |
52 | 52 |
53 // Sets the new turn-off flow status. | 53 // Sets the new turn-off flow status. |
54 void SetTurnOffFlowStatus(TurnOffFlowStatus status); | 54 void SetTurnOffFlowStatus(TurnOffFlowStatus status); |
55 | 55 |
56 // Callback invoked when turn off flow has finished. | 56 // Callback invoked when turn off flow has finished. |
57 void OnTurnOffFlowFinished(bool success); | 57 void OnTurnOffFlowFinished(bool success); |
58 | 58 |
59 PrefChangeRegistrar registrar_; | 59 PrefChangeRegistrar registrar_; |
60 | 60 |
61 TurnOffFlowStatus turn_off_flow_status_; | 61 TurnOffFlowStatus turn_off_flow_status_; |
62 scoped_ptr<EasyUnlockToggleFlow> turn_off_flow_; | 62 scoped_ptr<EasyUnlockToggleFlow> turn_off_flow_; |
63 | 63 |
64 DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceRegular); | 64 DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceRegular); |
65 }; | 65 }; |
66 | 66 |
67 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_ | 67 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_ |
OLD | NEW |