| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_APP_LAUNCH_SPLASH_SCREEN_HANDLER_
H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_APP_LAUNCH_SPLASH_SCREEN_HANDLER_
H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_APP_LAUNCH_SPLASH_SCREEN_HANDLER_
H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_APP_LAUNCH_SPLASH_SCREEN_HANDLER_
H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "chrome/browser/chromeos/login/screens/app_launch_splash_screen_actor.h
" | 12 #include "chrome/browser/chromeos/login/screens/app_launch_splash_screen_actor.h
" |
| 13 #include "chrome/browser/chromeos/login/screens/network_error_model.h" | 13 #include "chrome/browser/chromeos/login/screens/error_screen.h" |
| 14 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 14 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
| 15 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 15 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
| 16 | 16 |
| 17 namespace chromeos { | 17 namespace chromeos { |
| 18 | 18 |
| 19 // A class that handles the WebUI hooks for the app launch splash screen. | 19 // A class that handles the WebUI hooks for the app launch splash screen. |
| 20 class AppLaunchSplashScreenHandler | 20 class AppLaunchSplashScreenHandler |
| 21 : public BaseScreenHandler, | 21 : public BaseScreenHandler, |
| 22 public AppLaunchSplashScreenActor, | 22 public AppLaunchSplashScreenActor, |
| 23 public NetworkStateInformer::NetworkStateInformerObserver { | 23 public NetworkStateInformer::NetworkStateInformerObserver { |
| 24 public: | 24 public: |
| 25 AppLaunchSplashScreenHandler( | 25 AppLaunchSplashScreenHandler( |
| 26 const scoped_refptr<NetworkStateInformer>& network_state_informer, | 26 const scoped_refptr<NetworkStateInformer>& network_state_informer, |
| 27 NetworkErrorModel* network_error_model); | 27 ErrorScreen* error_screen); |
| 28 ~AppLaunchSplashScreenHandler() override; | 28 ~AppLaunchSplashScreenHandler() override; |
| 29 | 29 |
| 30 // BaseScreenHandler implementation: | 30 // BaseScreenHandler implementation: |
| 31 void DeclareLocalizedValues( | 31 void DeclareLocalizedValues( |
| 32 ::login::LocalizedValuesBuilder* builder) override; | 32 ::login::LocalizedValuesBuilder* builder) override; |
| 33 void Initialize() override; | 33 void Initialize() override; |
| 34 | 34 |
| 35 // WebUIMessageHandler implementation: | 35 // WebUIMessageHandler implementation: |
| 36 void RegisterMessages() override; | 36 void RegisterMessages() override; |
| 37 | 37 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 void PopulateAppInfo(base::DictionaryValue* out_info); | 52 void PopulateAppInfo(base::DictionaryValue* out_info); |
| 53 void SetLaunchText(const std::string& text); | 53 void SetLaunchText(const std::string& text); |
| 54 int GetProgressMessageFromState(AppLaunchState state); | 54 int GetProgressMessageFromState(AppLaunchState state); |
| 55 void HandleConfigureNetwork(); | 55 void HandleConfigureNetwork(); |
| 56 void HandleCancelAppLaunch(); | 56 void HandleCancelAppLaunch(); |
| 57 void HandleContinueAppLaunch(); | 57 void HandleContinueAppLaunch(); |
| 58 void HandleNetworkConfigRequested(); | 58 void HandleNetworkConfigRequested(); |
| 59 | 59 |
| 60 AppLaunchSplashScreenHandler::Delegate* delegate_; | 60 AppLaunchSplashScreenHandler::Delegate* delegate_ = nullptr; |
| 61 bool show_on_init_; | 61 bool show_on_init_ = false; |
| 62 std::string app_id_; | 62 std::string app_id_; |
| 63 AppLaunchState state_; | 63 AppLaunchState state_ = APP_LAUNCH_STATE_LOADING_AUTH_FILE; |
| 64 | 64 |
| 65 scoped_refptr<NetworkStateInformer> network_state_informer_; | 65 scoped_refptr<NetworkStateInformer> network_state_informer_; |
| 66 NetworkErrorModel* network_error_model_; | 66 ErrorScreen* error_screen_; |
| 67 | 67 |
| 68 // True if we are online. | 68 // True if we are online. |
| 69 bool online_state_; | 69 bool online_state_ = false; |
| 70 | 70 |
| 71 // True if we have network config screen was already shown before. | 71 // True if we have network config screen was already shown before. |
| 72 bool network_config_done_; | 72 bool network_config_done_ = false; |
| 73 | 73 |
| 74 // True if we have manually requested network config screen. | 74 // True if we have manually requested network config screen. |
| 75 bool network_config_requested_; | 75 bool network_config_requested_ = false; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(AppLaunchSplashScreenHandler); | 77 DISALLOW_COPY_AND_ASSIGN(AppLaunchSplashScreenHandler); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace chromeos | 80 } // namespace chromeos |
| 81 | 81 |
| 82 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_APP_LAUNCH_SPLASH_SCREEN_HANDL
ER_H_ | 82 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_APP_LAUNCH_SPLASH_SCREEN_HANDL
ER_H_ |
| OLD | NEW |