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 "chrome/browser/chromeos/login/screens/app_launch_splash_screen_actor.h
" | 11 #include "chrome/browser/chromeos/login/screens/app_launch_splash_screen_actor.h
" |
12 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 12 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
| 13 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
13 | 14 |
14 namespace chromeos { | 15 namespace chromeos { |
15 | 16 |
| 17 class ErrorScreenActor; |
| 18 |
16 // 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. |
17 class AppLaunchSplashScreenHandler : public BaseScreenHandler, | 20 class AppLaunchSplashScreenHandler |
18 public AppLaunchSplashScreenActor { | 21 : public BaseScreenHandler, |
| 22 public AppLaunchSplashScreenActor, |
| 23 public NetworkStateInformer::NetworkStateInformerObserver { |
19 public: | 24 public: |
20 AppLaunchSplashScreenHandler(); | 25 AppLaunchSplashScreenHandler( |
| 26 const scoped_refptr<NetworkStateInformer>& network_state_informer, |
| 27 ErrorScreenActor* error_screen_actor); |
21 virtual ~AppLaunchSplashScreenHandler(); | 28 virtual ~AppLaunchSplashScreenHandler(); |
22 | 29 |
23 // BaseScreenHandler implementation: | 30 // BaseScreenHandler implementation: |
24 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) OVERRIDE; | 31 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) OVERRIDE; |
25 virtual void Initialize() OVERRIDE; | 32 virtual void Initialize() OVERRIDE; |
26 | 33 |
27 // WebUIMessageHandler implementation: | 34 // WebUIMessageHandler implementation: |
28 virtual void RegisterMessages() OVERRIDE; | 35 virtual void RegisterMessages() OVERRIDE; |
29 | 36 |
30 // AppLaunchSplashScreenActor implementation: | 37 // AppLaunchSplashScreenActor implementation: |
31 virtual void Show(const std::string& app_id) OVERRIDE; | 38 virtual void Show(const std::string& app_id) OVERRIDE; |
32 virtual void PrepareToShow() OVERRIDE; | 39 virtual void PrepareToShow() OVERRIDE; |
33 virtual void Hide() OVERRIDE; | 40 virtual void Hide() OVERRIDE; |
34 virtual void ToggleNetworkConfig(bool visible) OVERRIDE; | 41 virtual void ToggleNetworkConfig(bool visible) OVERRIDE; |
35 virtual void UpdateAppLaunchState(AppLaunchState state) OVERRIDE; | 42 virtual void UpdateAppLaunchState(AppLaunchState state) OVERRIDE; |
36 virtual void SetDelegate( | 43 virtual void SetDelegate( |
37 AppLaunchSplashScreenHandler::Delegate* delegate) OVERRIDE; | 44 AppLaunchSplashScreenHandler::Delegate* delegate) OVERRIDE; |
| 45 virtual void ShowNetworkConfigureUI() OVERRIDE; |
| 46 |
| 47 // NetworkStateInformer::NetworkStateInformerObserver implementation: |
| 48 virtual void OnNetworkReady() OVERRIDE; |
| 49 virtual void UpdateState(ErrorScreenActor::ErrorReason reason) OVERRIDE; |
38 | 50 |
39 private: | 51 private: |
40 void PopulateAppInfo(base::DictionaryValue* out_info); | 52 void PopulateAppInfo(base::DictionaryValue* out_info); |
41 void SetLaunchText(const std::string& text); | 53 void SetLaunchText(const std::string& text); |
42 int GetProgressMessageFromState(AppLaunchState state); | 54 int GetProgressMessageFromState(AppLaunchState state); |
43 void HandleConfigureNetwork(); | 55 void HandleConfigureNetwork(); |
44 void HandleCancelAppLaunch(); | 56 void HandleCancelAppLaunch(); |
45 | 57 |
46 AppLaunchSplashScreenHandler::Delegate* delegate_; | 58 AppLaunchSplashScreenHandler::Delegate* delegate_; |
47 bool show_on_init_; | 59 bool show_on_init_; |
48 std::string app_id_; | 60 std::string app_id_; |
49 AppLaunchState state_; | 61 AppLaunchState state_; |
50 | 62 |
| 63 scoped_refptr<NetworkStateInformer> network_state_informer_; |
| 64 ErrorScreenActor* error_screen_actor_; |
| 65 |
51 DISALLOW_COPY_AND_ASSIGN(AppLaunchSplashScreenHandler); | 66 DISALLOW_COPY_AND_ASSIGN(AppLaunchSplashScreenHandler); |
52 }; | 67 }; |
53 | 68 |
54 } // namespace chromeos | 69 } // namespace chromeos |
55 | 70 |
56 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_APP_LAUNCH_SPLASH_SCREEN_HANDL
ER_H_ | 71 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_APP_LAUNCH_SPLASH_SCREEN_HANDL
ER_H_ |
OLD | NEW |