| 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_SCREENLOCK_STATE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SCREENLOCK_STATE_HANDLER_H_ |
| 6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SCREENLOCK_STATE_HANDLER_H_ | 6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SCREENLOCK_STATE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // The device can be unlocked using Easy Unlock. | 44 // The device can be unlocked using Easy Unlock. |
| 45 STATE_AUTHENTICATED | 45 STATE_AUTHENTICATED |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 // |user_email|: The email for the user associated with the profile to which | 48 // |user_email|: The email for the user associated with the profile to which |
| 49 // this class is attached. | 49 // this class is attached. |
| 50 // |pref_service|: The profile preferences. | 50 // |pref_service|: The profile preferences. |
| 51 // |screenlock_bridge|: The screenlock bridge used to update the screen lock | 51 // |screenlock_bridge|: The screenlock bridge used to update the screen lock |
| 52 // state. | 52 // state. |
| 53 EasyUnlockScreenlockStateHandler(const std::string& user_email, | 53 EasyUnlockScreenlockStateHandler(const std::string& user_email, |
| 54 bool initially_hardlocked, |
| 54 PrefService* pref_service, | 55 PrefService* pref_service, |
| 55 ScreenlockBridge* screenlock_bridge); | 56 ScreenlockBridge* screenlock_bridge); |
| 56 virtual ~EasyUnlockScreenlockStateHandler(); | 57 virtual ~EasyUnlockScreenlockStateHandler(); |
| 57 | 58 |
| 58 // Changes internal state to |new_state| and updates the user's screenlock | 59 // Changes internal state to |new_state| and updates the user's screenlock |
| 59 // accordingly. | 60 // accordingly. |
| 60 void ChangeState(State new_state); | 61 void ChangeState(State new_state); |
| 61 | 62 |
| 63 // Updates the screenlock state according to whether the pod is hardlocked or |
| 64 // not. |
| 65 void SetHardlocked(bool value); |
| 66 |
| 62 private: | 67 private: |
| 63 // ScreenlockBridge::Observer: | 68 // ScreenlockBridge::Observer: |
| 64 virtual void OnScreenDidLock() OVERRIDE; | 69 virtual void OnScreenDidLock() OVERRIDE; |
| 65 virtual void OnScreenDidUnlock() OVERRIDE; | 70 virtual void OnScreenDidUnlock() OVERRIDE; |
| 66 virtual void OnFocusedUserChanged(const std::string& user_id) OVERRIDE; | 71 virtual void OnFocusedUserChanged(const std::string& user_id) OVERRIDE; |
| 67 | 72 |
| 73 void ShowHardlockUI(); |
| 74 |
| 68 // Updates icon's tooltip options. | 75 // Updates icon's tooltip options. |
| 69 // |trial_run|: Whether the trial Easy Unlock run is in progress. | 76 // |trial_run|: Whether the trial Easy Unlock run is in progress. |
| 70 void UpdateTooltipOptions( | 77 void UpdateTooltipOptions( |
| 71 bool trial_run, | 78 bool trial_run, |
| 72 ScreenlockBridge::UserPodCustomIconOptions* icon_options); | 79 ScreenlockBridge::UserPodCustomIconOptions* icon_options); |
| 73 | 80 |
| 74 // Whether this is the first, trial Easy Unlock run. If this is the case, a | 81 // Whether this is the first, trial Easy Unlock run. If this is the case, a |
| 75 // tutorial message should be shown and hard-locking be disabled in | 82 // tutorial message should be shown and hard-locking be disabled in |
| 76 // Authenticated state. The trial run will be active if Easy Unlock never | 83 // Authenticated state. The trial run will be active if Easy Unlock never |
| 77 // entered Authenticated state (across sessions). | 84 // entered Authenticated state (across sessions). |
| 78 bool IsTrialRun(); | 85 bool IsTrialRun(); |
| 79 | 86 |
| 80 // Sets user preference that marks trial run completed. | 87 // Sets user preference that marks trial run completed. |
| 81 void MarkTrialRunComplete(); | 88 void MarkTrialRunComplete(); |
| 82 | 89 |
| 83 // Gets the name to be used for the device. The name depends on the device | 90 // Gets the name to be used for the device. The name depends on the device |
| 84 // type (example values: Chromebook and Chromebox). | 91 // type (example values: Chromebook and Chromebox). |
| 85 base::string16 GetDeviceName(); | 92 base::string16 GetDeviceName(); |
| 86 | 93 |
| 87 // Updates the screenlock auth type if it has to be changed. | 94 // Updates the screenlock auth type if it has to be changed. |
| 88 void UpdateScreenlockAuthType(); | 95 void UpdateScreenlockAuthType(); |
| 89 | 96 |
| 90 State state_; | 97 State state_; |
| 91 std::string user_email_; | 98 std::string user_email_; |
| 92 PrefService* pref_service_; | 99 PrefService* pref_service_; |
| 93 ScreenlockBridge* screenlock_bridge_; | 100 ScreenlockBridge* screenlock_bridge_; |
| 94 | 101 |
| 102 // Whether the easy unlock is disabled due to user hardlocking the pod. |
| 103 bool hardlocked_; |
| 104 bool hardlock_ui_shown_; |
| 105 |
| 95 DISALLOW_COPY_AND_ASSIGN(EasyUnlockScreenlockStateHandler); | 106 DISALLOW_COPY_AND_ASSIGN(EasyUnlockScreenlockStateHandler); |
| 96 }; | 107 }; |
| 97 | 108 |
| 98 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SCREENLOCK_STATE_HANDLER_H_ | 109 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SCREENLOCK_STATE_HANDLER_H_ |
| OLD | NEW |