| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "ash/public/interfaces/touch_view.mojom.h" | 13 #include "ash/public/interfaces/touch_view.mojom.h" |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/containers/hash_tables.h" | 16 #include "base/containers/hash_tables.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/scoped_observer.h" | 20 #include "base/scoped_observer.h" |
| 21 #include "chrome/browser/chromeos/lock_screen_apps/state_observer.h" | 21 #include "chrome/browser/chromeos/lock_screen_apps/state_observer.h" |
| 22 #include "chrome/browser/chromeos/login/screens/error_screen.h" | 22 #include "chrome/browser/chromeos/login/screens/error_screen.h" |
| 23 #include "chrome/browser/chromeos/login/signin_specifics.h" | 23 #include "chrome/browser/chromeos/login/signin_specifics.h" |
| 24 #include "chrome/browser/chromeos/login/ui/login_display.h" | 24 #include "chrome/browser/chromeos/login/ui/login_display.h" |
| 25 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
| 25 #include "chrome/browser/chromeos/settings/cros_settings.h" | 26 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 26 #include "chrome/browser/ui/webui/chromeos/login/base_webui_handler.h" | 27 #include "chrome/browser/ui/webui/chromeos/login/base_webui_handler.h" |
| 27 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 28 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
| 28 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 29 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 29 #include "chromeos/dbus/power_manager_client.h" | 30 #include "chromeos/dbus/power_manager_client.h" |
| 30 #include "chromeos/network/portal_detector/network_portal_detector.h" | 31 #include "chromeos/network/portal_detector/network_portal_detector.h" |
| 31 #include "components/proximity_auth/screenlock_bridge.h" | 32 #include "components/proximity_auth/screenlock_bridge.h" |
| 32 #include "components/user_manager/user_manager.h" | 33 #include "components/user_manager/user_manager.h" |
| 33 #include "content/public/browser/notification_observer.h" | 34 #include "content/public/browser/notification_observer.h" |
| 34 #include "content/public/browser/notification_registrar.h" | 35 #include "content/public/browser/notification_registrar.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 // LoginDisplay. | 233 // LoginDisplay. |
| 233 class SigninScreenHandler | 234 class SigninScreenHandler |
| 234 : public BaseWebUIHandler, | 235 : public BaseWebUIHandler, |
| 235 public LoginDisplayWebUIHandler, | 236 public LoginDisplayWebUIHandler, |
| 236 public content::NotificationObserver, | 237 public content::NotificationObserver, |
| 237 public NetworkStateInformer::NetworkStateInformerObserver, | 238 public NetworkStateInformer::NetworkStateInformerObserver, |
| 238 public PowerManagerClient::Observer, | 239 public PowerManagerClient::Observer, |
| 239 public input_method::ImeKeyboard::Observer, | 240 public input_method::ImeKeyboard::Observer, |
| 240 public ash::mojom::TouchViewObserver, | 241 public ash::mojom::TouchViewObserver, |
| 241 public lock_screen_apps::StateObserver, | 242 public lock_screen_apps::StateObserver, |
| 242 public OobeUI::Observer { | 243 public OobeUI::Observer, |
| 244 public wallpaper::WallpaperManagerBase::Observer { |
| 243 public: | 245 public: |
| 244 SigninScreenHandler( | 246 SigninScreenHandler( |
| 245 const scoped_refptr<NetworkStateInformer>& network_state_informer, | 247 const scoped_refptr<NetworkStateInformer>& network_state_informer, |
| 246 ErrorScreen* error_screen, | 248 ErrorScreen* error_screen, |
| 247 CoreOobeView* core_oobe_view, | 249 CoreOobeView* core_oobe_view, |
| 248 GaiaScreenHandler* gaia_screen_handler, | 250 GaiaScreenHandler* gaia_screen_handler, |
| 249 JSCallsContainer* js_calls_container); | 251 JSCallsContainer* js_calls_container); |
| 250 ~SigninScreenHandler() override; | 252 ~SigninScreenHandler() override; |
| 251 | 253 |
| 252 static std::string GetUserLastInputMethod(const std::string& username); | 254 static std::string GetUserLastInputMethod(const std::string& username); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 270 void OnNetworkReady() override; | 272 void OnNetworkReady() override; |
| 271 void UpdateState(NetworkError::ErrorReason reason) override; | 273 void UpdateState(NetworkError::ErrorReason reason) override; |
| 272 | 274 |
| 273 // Required Local State preferences. | 275 // Required Local State preferences. |
| 274 static void RegisterPrefs(PrefRegistrySimple* registry); | 276 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 275 | 277 |
| 276 // OobeUI::Observer implemetation. | 278 // OobeUI::Observer implemetation. |
| 277 void OnCurrentScreenChanged(OobeScreen current_screen, | 279 void OnCurrentScreenChanged(OobeScreen current_screen, |
| 278 OobeScreen new_screen) override; | 280 OobeScreen new_screen) override; |
| 279 | 281 |
| 282 // wallpaper::WallpaperManagerBase::Observer implementation. |
| 283 void OnWallpaperColorsChanged() override; |
| 284 void OnWallpaperAnimationFinished(const AccountId& account_id) override; |
| 285 |
| 280 void SetFocusPODCallbackForTesting(base::Closure callback); | 286 void SetFocusPODCallbackForTesting(base::Closure callback); |
| 281 | 287 |
| 282 // To avoid spurious error messages on flaky networks, the offline message is | 288 // To avoid spurious error messages on flaky networks, the offline message is |
| 283 // only shown if the network is offline for a threshold number of seconds. | 289 // only shown if the network is offline for a threshold number of seconds. |
| 284 // This method reduces the threshold to zero, allowing the offline message to | 290 // This method reduces the threshold to zero, allowing the offline message to |
| 285 // show instantaneously in tests. | 291 // show instantaneously in tests. |
| 286 void ZeroOfflineTimeoutForTesting(); | 292 void ZeroOfflineTimeoutForTesting(); |
| 287 | 293 |
| 288 // Gets the keyboard remapped pref value for |pref_name| key. Returns true if | 294 // Gets the keyboard remapped pref value for |pref_name| key. Returns true if |
| 289 // successful, otherwise returns false. | 295 // successful, otherwise returns false. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 307 // |params| argument. | 313 // |params| argument. |
| 308 void UpdateUIState(UIState ui_state, base::DictionaryValue* params); | 314 void UpdateUIState(UIState ui_state, base::DictionaryValue* params); |
| 309 | 315 |
| 310 void UpdateStateInternal(NetworkError::ErrorReason reason, bool force_update); | 316 void UpdateStateInternal(NetworkError::ErrorReason reason, bool force_update); |
| 311 void SetupAndShowOfflineMessage(NetworkStateInformer::State state, | 317 void SetupAndShowOfflineMessage(NetworkStateInformer::State state, |
| 312 NetworkError::ErrorReason reason); | 318 NetworkError::ErrorReason reason); |
| 313 void HideOfflineMessage(NetworkStateInformer::State state, | 319 void HideOfflineMessage(NetworkStateInformer::State state, |
| 314 NetworkError::ErrorReason reason); | 320 NetworkError::ErrorReason reason); |
| 315 void ReloadGaia(bool force_reload); | 321 void ReloadGaia(bool force_reload); |
| 316 | 322 |
| 323 // Sets signin screen overlay colors based on the wallpaper color extraction |
| 324 // results. |
| 325 void SetSigninScreenColors(SkColor dm_color); |
| 326 |
| 317 // BaseScreenHandler implementation: | 327 // BaseScreenHandler implementation: |
| 318 void DeclareLocalizedValues( | 328 void DeclareLocalizedValues( |
| 319 ::login::LocalizedValuesBuilder* builder) override; | 329 ::login::LocalizedValuesBuilder* builder) override; |
| 320 void Initialize() override; | 330 void Initialize() override; |
| 321 gfx::NativeWindow GetNativeWindow() override; | 331 gfx::NativeWindow GetNativeWindow() override; |
| 322 | 332 |
| 323 // WebUIMessageHandler implementation: | 333 // WebUIMessageHandler implementation: |
| 324 void RegisterMessages() override; | 334 void RegisterMessages() override; |
| 325 | 335 |
| 326 // LoginDisplayWebUIHandler implementation: | 336 // LoginDisplayWebUIHandler implementation: |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 lock_screen_apps_observer_; | 566 lock_screen_apps_observer_; |
| 557 | 567 |
| 558 base::WeakPtrFactory<SigninScreenHandler> weak_factory_; | 568 base::WeakPtrFactory<SigninScreenHandler> weak_factory_; |
| 559 | 569 |
| 560 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); | 570 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); |
| 561 }; | 571 }; |
| 562 | 572 |
| 563 } // namespace chromeos | 573 } // namespace chromeos |
| 564 | 574 |
| 565 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 575 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
| OLD | NEW |