| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 // Changes internal state to |new_state| and updates the user's screenlock | 55 // Changes internal state to |new_state| and updates the user's screenlock |
| 56 // accordingly. | 56 // accordingly. |
| 57 void ChangeState(State new_state); | 57 void ChangeState(State new_state); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 // ScreenlockBridge::Observer: | 60 // ScreenlockBridge::Observer: |
| 61 virtual void OnScreenDidLock() OVERRIDE; | 61 virtual void OnScreenDidLock() OVERRIDE; |
| 62 virtual void OnScreenDidUnlock() OVERRIDE; | 62 virtual void OnScreenDidUnlock() OVERRIDE; |
| 63 | 63 |
| 64 // Updates icon's tooltip options. |
| 65 // |trial_run|: Whether the trial Easy Unlock run is in progress. |
| 64 void UpdateTooltipOptions( | 66 void UpdateTooltipOptions( |
| 67 bool trial_run, |
| 65 ScreenlockBridge::UserPodCustomIconOptions* icon_options); | 68 ScreenlockBridge::UserPodCustomIconOptions* icon_options); |
| 66 | 69 |
| 67 // Whether the tutorial message should be shown to the user. The message is | 70 // Whether this is the first, trial Easy Unlock run. If this is the case, a |
| 68 // shown only once, when the user encounters STATE_AUTHENTICATED for the first | 71 // tutorial message should be shown and hard-locking be disabled in |
| 69 // time (across sessions). After the tutorial message is shown, | 72 // Authenticated state. The trial run will be active if Easy Unlock never |
| 70 // |MarkTutorialShown| should be called to prevent further tutorial message. | 73 // entered Authenticated state (across sessions). |
| 71 bool ShouldShowTutorial(); | 74 bool IsTrialRun(); |
| 72 | 75 |
| 73 // Sets user preference that prevents showing of tutorial messages. | 76 // Sets user preference that marks trial run completed. |
| 74 void MarkTutorialShown(); | 77 void MarkTrialRunComplete(); |
| 75 | 78 |
| 76 // Gets the name to be used for the device. The name depends on the device | 79 // Gets the name to be used for the device. The name depends on the device |
| 77 // type (example values: Chromebook and Chromebox). | 80 // type (example values: Chromebook and Chromebox). |
| 78 base::string16 GetDeviceName(); | 81 base::string16 GetDeviceName(); |
| 79 | 82 |
| 80 // Updates the screenlock auth type if it has to be changed. | 83 // Updates the screenlock auth type if it has to be changed. |
| 81 void UpdateScreenlockAuthType(); | 84 void UpdateScreenlockAuthType(); |
| 82 | 85 |
| 83 State state_; | 86 State state_; |
| 84 std::string user_email_; | 87 std::string user_email_; |
| 85 PrefService* pref_service_; | 88 PrefService* pref_service_; |
| 86 ScreenlockBridge* screenlock_bridge_; | 89 ScreenlockBridge* screenlock_bridge_; |
| 87 | 90 |
| 88 DISALLOW_COPY_AND_ASSIGN(EasyUnlockScreenlockStateHandler); | 91 DISALLOW_COPY_AND_ASSIGN(EasyUnlockScreenlockStateHandler); |
| 89 }; | 92 }; |
| 90 | 93 |
| 91 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SCREENLOCK_STATE_HANDLER_H_ | 94 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SCREENLOCK_STATE_HANDLER_H_ |
| OLD | NEW |