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
3 // found in the LICENSE file.
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_
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"
13 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h"
17 class ErrorScreenActor
;
19 // A class that handles the WebUI hooks for the app launch splash screen.
20 class AppLaunchSplashScreenHandler
21 : public BaseScreenHandler
,
22 public AppLaunchSplashScreenActor
,
23 public NetworkStateInformer::NetworkStateInformerObserver
{
25 AppLaunchSplashScreenHandler(
26 const scoped_refptr
<NetworkStateInformer
>& network_state_informer
,
27 ErrorScreenActor
* error_screen_actor
);
28 virtual ~AppLaunchSplashScreenHandler();
30 // BaseScreenHandler implementation:
31 virtual void DeclareLocalizedValues(LocalizedValuesBuilder
* builder
) OVERRIDE
;
32 virtual void Initialize() OVERRIDE
;
34 // WebUIMessageHandler implementation:
35 virtual void RegisterMessages() OVERRIDE
;
37 // AppLaunchSplashScreenActor implementation:
38 virtual void Show(const std::string
& app_id
) OVERRIDE
;
39 virtual void PrepareToShow() OVERRIDE
;
40 virtual void Hide() OVERRIDE
;
41 virtual void ToggleNetworkConfig(bool visible
) OVERRIDE
;
42 virtual void UpdateAppLaunchState(AppLaunchState state
) OVERRIDE
;
43 virtual void SetDelegate(
44 AppLaunchSplashScreenHandler::Delegate
* delegate
) OVERRIDE
;
45 virtual void ShowNetworkConfigureUI() OVERRIDE
;
47 // NetworkStateInformer::NetworkStateInformerObserver implementation:
48 virtual void OnNetworkReady() OVERRIDE
;
49 virtual void UpdateState(ErrorScreenActor::ErrorReason reason
) OVERRIDE
;
52 void PopulateAppInfo(base::DictionaryValue
* out_info
);
53 void SetLaunchText(const std::string
& text
);
54 int GetProgressMessageFromState(AppLaunchState state
);
55 void HandleConfigureNetwork();
56 void HandleCancelAppLaunch();
58 AppLaunchSplashScreenHandler::Delegate
* delegate_
;
61 AppLaunchState state_
;
63 scoped_refptr
<NetworkStateInformer
> network_state_informer_
;
64 ErrorScreenActor
* error_screen_actor_
;
66 DISALLOW_COPY_AND_ASSIGN(AppLaunchSplashScreenHandler
);
69 } // namespace chromeos
71 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_APP_LAUNCH_SPLASH_SCREEN_HANDLER_H_