| 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_CHROMEOS_LOGIN_LOCK_WEBUI_SCREEN_LOCKER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_WEBUI_SCREEN_LOCKER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_WEBUI_SCREEN_LOCKER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_WEBUI_SCREEN_LOCKER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 class WebUIScreenLocker : public WebUILoginView, | 48 class WebUIScreenLocker : public WebUILoginView, |
| 49 public LoginDisplay::Delegate, | 49 public LoginDisplay::Delegate, |
| 50 public ash::LockStateObserver, | 50 public ash::LockStateObserver, |
| 51 public views::WidgetObserver, | 51 public views::WidgetObserver, |
| 52 public PowerManagerClient::Observer, | 52 public PowerManagerClient::Observer, |
| 53 public ash::ShellObserver, | 53 public ash::ShellObserver, |
| 54 public keyboard::KeyboardControllerObserver, | 54 public keyboard::KeyboardControllerObserver, |
| 55 public display::DisplayObserver, | 55 public display::DisplayObserver, |
| 56 public content::WebContentsObserver { | 56 public content::WebContentsObserver { |
| 57 public: | 57 public: |
| 58 // Returns true if the lock screen should be shared. | 58 // Request lock screen preload when the user is idle. Does nothing if |
| 59 static bool ShouldShareLockScreen(); | 59 // preloading is disabled or if the preload hueristics return false. |
| 60 static void Preload(); | 60 static void RequestPreload(); |
| 61 | 61 |
| 62 explicit WebUIScreenLocker(ScreenLocker* screen_locker); | 62 explicit WebUIScreenLocker(ScreenLocker* screen_locker); |
| 63 ~WebUIScreenLocker() override; | 63 ~WebUIScreenLocker() override; |
| 64 | 64 |
| 65 // Begin initializing the widget and views::WebView that show the lock screen. | 65 // Begin initializing the widget and views::WebView that show the lock screen. |
| 66 // ScreenLockReady is called when all initialization has finished. | 66 // ScreenLockReady is called when all initialization has finished. |
| 67 void LockScreen(); | 67 void LockScreen(); |
| 68 | 68 |
| 69 // Enable/disable password input. | 69 // Enable/disable password input. |
| 70 void SetInputEnabled(bool enabled); | 70 void SetInputEnabled(bool enabled); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 88 | 88 |
| 89 // Called when webui lock screen wallpaper is loaded and displayed. | 89 // Called when webui lock screen wallpaper is loaded and displayed. |
| 90 void OnLockBackgroundDisplayed(); | 90 void OnLockBackgroundDisplayed(); |
| 91 | 91 |
| 92 // Called when the webui header bar becomes visible. | 92 // Called when the webui header bar becomes visible. |
| 93 void OnHeaderBarVisible(); | 93 void OnHeaderBarVisible(); |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 friend class test::WebUIScreenLockerTester; | 96 friend class test::WebUIScreenLockerTester; |
| 97 | 97 |
| 98 // Returns true if the lock screen should be preloaded. |
| 99 static bool ShouldPreloadLockScreen(); |
| 100 // Helper function that creates and preloads a views::WebView. |
| 101 static std::unique_ptr<views::WebView> DoPreload(Profile* profile); |
| 102 |
| 98 // LoginDisplay::Delegate: | 103 // LoginDisplay::Delegate: |
| 99 void CancelPasswordChangedFlow() override; | 104 void CancelPasswordChangedFlow() override; |
| 100 void CompleteLogin(const UserContext& user_context) override; | 105 void CompleteLogin(const UserContext& user_context) override; |
| 101 base::string16 GetConnectedNetworkName() override; | 106 base::string16 GetConnectedNetworkName() override; |
| 102 bool IsSigninInProgress() const override; | 107 bool IsSigninInProgress() const override; |
| 103 void Login(const UserContext& user_context, | 108 void Login(const UserContext& user_context, |
| 104 const SigninSpecifics& specifics) override; | 109 const SigninSpecifics& specifics) override; |
| 105 void MigrateUserData(const std::string& old_password) override; | 110 void MigrateUserData(const std::string& old_password) override; |
| 106 void OnSigninScreenReady() override; | 111 void OnSigninScreenReady() override; |
| 107 void OnGaiaScreenReady() override; | 112 void OnGaiaScreenReady() override; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 156 |
| 152 // Returns the native window displaying the lock screen. | 157 // Returns the native window displaying the lock screen. |
| 153 gfx::NativeWindow GetNativeWindow() const; | 158 gfx::NativeWindow GetNativeWindow() const; |
| 154 | 159 |
| 155 // Ensures that user pod is focused. | 160 // Ensures that user pod is focused. |
| 156 void FocusUserPod(); | 161 void FocusUserPod(); |
| 157 | 162 |
| 158 // Reset user pod and ensures that user pod is focused. | 163 // Reset user pod and ensures that user pod is focused. |
| 159 void ResetAndFocusUserPod(); | 164 void ResetAndFocusUserPod(); |
| 160 | 165 |
| 166 // Configuration settings. |
| 167 WebViewSettings BuildConfigSettings(); |
| 168 |
| 161 // The ScreenLocker that owns this instance. | 169 // The ScreenLocker that owns this instance. |
| 162 ScreenLocker* screen_locker_ = nullptr; | 170 ScreenLocker* screen_locker_ = nullptr; |
| 163 | 171 |
| 164 // The screen locker window. | 172 // The screen locker window. |
| 165 LockWindow* lock_window_ = nullptr; | 173 LockWindow* lock_window_ = nullptr; |
| 166 | 174 |
| 167 // Sign-in Screen controller instance (owns login screens). | 175 // Sign-in Screen controller instance (owns login screens). |
| 168 std::unique_ptr<SignInScreenController> signin_screen_controller_; | 176 std::unique_ptr<SignInScreenController> signin_screen_controller_; |
| 169 | 177 |
| 170 // Login UI implementation instance. | 178 // Login UI implementation instance. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 185 bool is_observing_keyboard_ = false; | 193 bool is_observing_keyboard_ = false; |
| 186 | 194 |
| 187 base::WeakPtrFactory<WebUIScreenLocker> weak_factory_; | 195 base::WeakPtrFactory<WebUIScreenLocker> weak_factory_; |
| 188 | 196 |
| 189 DISALLOW_COPY_AND_ASSIGN(WebUIScreenLocker); | 197 DISALLOW_COPY_AND_ASSIGN(WebUIScreenLocker); |
| 190 }; | 198 }; |
| 191 | 199 |
| 192 } // namespace chromeos | 200 } // namespace chromeos |
| 193 | 201 |
| 194 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_WEBUI_SCREEN_LOCKER_H_ | 202 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_WEBUI_SCREEN_LOCKER_H_ |
| OLD | NEW |