Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_CHROMEOS_LOGIN_LOCK_VIEWS_SCREEN_LOCKER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_VIEWS_SCREEN_LOCKER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_VIEWS_SCREEN_LOCKER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_VIEWS_SCREEN_LOCKER_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 9 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| 10 #include "chrome/browser/chromeos/settings/cros_settings.h" | |
| 10 #include "chrome/browser/ui/ash/lock_screen_client.h" | 11 #include "chrome/browser/ui/ash/lock_screen_client.h" |
| 12 #include "chromeos/dbus/power_manager_client.h" | |
| 11 | 13 |
| 12 namespace chromeos { | 14 namespace chromeos { |
| 13 | 15 |
| 14 class UserSelectionScreen; | 16 class UserSelectionScreen; |
| 15 class UserSelectionScreenProxy; | 17 class UserSelectionScreenProxy; |
| 16 | 18 |
| 17 // ViewsScreenLocker acts like LockScreenClient::Delegate which handles method | 19 // ViewsScreenLocker acts like LockScreenClient::Delegate which handles method |
| 18 // calls coming from ash into chrome. | 20 // calls coming from ash into chrome. |
| 19 // It is also a ScreenLocker::Delegate which handles calls from chrome into | 21 // It is also a ScreenLocker::Delegate which handles calls from chrome into |
| 20 // ash (views-based lockscreen). | 22 // ash (views-based lockscreen). |
| 21 class ViewsScreenLocker : public LockScreenClient::Delegate, | 23 class ViewsScreenLocker : public LockScreenClient::Delegate, |
| 22 public ScreenLocker::Delegate { | 24 public ScreenLocker::Delegate, |
| 25 public PowerManagerClient::Observer { | |
| 23 public: | 26 public: |
| 24 explicit ViewsScreenLocker(ScreenLocker* screen_locker); | 27 explicit ViewsScreenLocker(ScreenLocker* screen_locker); |
| 25 ~ViewsScreenLocker() override; | 28 ~ViewsScreenLocker() override; |
| 26 | 29 |
| 27 // ScreenLocker::Delegate: | 30 // ScreenLocker::Delegate: |
| 28 void SetPasswordInputEnabled(bool enabled) override; | 31 void SetPasswordInputEnabled(bool enabled) override; |
| 29 void ShowErrorMessage(int error_msg_id, | 32 void ShowErrorMessage(int error_msg_id, |
| 30 HelpAppLauncher::HelpTopic help_topic_id) override; | 33 HelpAppLauncher::HelpTopic help_topic_id) override; |
| 31 void ClearErrors() override; | 34 void ClearErrors() override; |
| 32 void AnimateAuthenticationSuccess() override; | 35 void AnimateAuthenticationSuccess() override; |
| 33 void OnLockWebUIReady() override; | 36 void OnLockWebUIReady() override; |
| 34 void OnLockBackgroundDisplayed() override; | 37 void OnLockBackgroundDisplayed() override; |
| 35 void OnHeaderBarVisible() override; | 38 void OnHeaderBarVisible() override; |
| 36 void OnAshLockAnimationFinished() override; | 39 void OnAshLockAnimationFinished() override; |
| 37 void SetFingerprintState(const AccountId& account_id, | 40 void SetFingerprintState(const AccountId& account_id, |
| 38 ScreenLocker::FingerprintState state) override; | 41 ScreenLocker::FingerprintState state) override; |
| 39 content::WebContents* GetWebContents() override; | 42 content::WebContents* GetWebContents() override; |
| 40 | 43 |
| 41 void Init(); | 44 void Init(); |
| 42 void OnLockScreenReady(); | 45 void OnLockScreenReady(); |
| 43 | 46 |
| 44 private: | 47 private: |
| 45 // LockScreenClient::Delegate | 48 // LockScreenClient::Delegate |
| 49 void HandleAuthenticateUser(const AccountId& account_id, | |
| 50 const std::string& hashed_password, | |
| 51 bool authenticated_by_pin) override; | |
| 46 void HandleAttemptUnlock(const AccountId& account_id) override; | 52 void HandleAttemptUnlock(const AccountId& account_id) override; |
| 47 void HandleHardlockPod(const AccountId& account_id) override; | 53 void HandleHardlockPod(const AccountId& account_id) override; |
| 48 void HandleRecordClickOnLockIcon(const AccountId& account_id) override; | 54 void HandleRecordClickOnLockIcon(const AccountId& account_id) override; |
| 55 void HandleFocusPod(const AccountId& account_id) override; | |
| 56 void HandleNoPodFocused() override; | |
| 57 | |
| 58 // PowerManagerClient::Observer: | |
| 59 void SuspendDone(const base::TimeDelta& sleep_duration) override; | |
| 60 | |
| 61 void UpdatePinKeyboardState(const AccountId& account_id); | |
|
jdufault
2017/06/08 21:12:06
These methods should go above the overrides.
xiaoyinh(OOO Sep 11-29)
2017/06/09 00:47:11
Done.
| |
| 62 void OnAllowedInputMethodsChanged(); | |
| 49 | 63 |
| 50 std::unique_ptr<UserSelectionScreenProxy> user_selection_screen_proxy_; | 64 std::unique_ptr<UserSelectionScreenProxy> user_selection_screen_proxy_; |
| 51 std::unique_ptr<UserSelectionScreen> user_selection_screen_; | 65 std::unique_ptr<UserSelectionScreen> user_selection_screen_; |
| 52 | 66 |
| 53 // The ScreenLocker that owns this instance. | 67 // The ScreenLocker that owns this instance. |
| 54 ScreenLocker* const screen_locker_ = nullptr; | 68 ScreenLocker* const screen_locker_ = nullptr; |
| 55 | 69 |
| 56 // Time when lock was initiated, required for metrics. | 70 // Time when lock was initiated, required for metrics. |
| 57 base::TimeTicks lock_time_; | 71 base::TimeTicks lock_time_; |
| 58 | 72 |
| 73 std::unique_ptr<AccountId> focused_pod_account_id_; | |
|
jdufault
2017/06/08 21:12:06
base::Optional
- avoids heap allocation
- I'm g
xiaoyinh(OOO Sep 11-29)
2017/06/09 00:47:11
Done.
| |
| 74 | |
| 75 // Input Method Engine state used at lock screen. | |
| 76 scoped_refptr<input_method::InputMethodManager::State> ime_state_; | |
| 77 | |
| 78 std::unique_ptr<CrosSettings::ObserverSubscription> | |
| 79 allowed_input_methods_subscription_; | |
| 80 | |
| 81 bool lock_screen_ready_ = false; | |
| 82 | |
| 59 base::WeakPtrFactory<ViewsScreenLocker> weak_factory_; | 83 base::WeakPtrFactory<ViewsScreenLocker> weak_factory_; |
| 60 | 84 |
| 61 DISALLOW_COPY_AND_ASSIGN(ViewsScreenLocker); | 85 DISALLOW_COPY_AND_ASSIGN(ViewsScreenLocker); |
| 62 }; | 86 }; |
| 63 | 87 |
| 64 } // namespace chromeos | 88 } // namespace chromeos |
| 65 | 89 |
| 66 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_VIEWS_SCREEN_LOCKER_H_ | 90 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_VIEWS_SCREEN_LOCKER_H_ |
| OLD | NEW |