- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / webui / chromeos / login / app_launch_splash_screen_handler.h
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.
4
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_
7
8 #include <set>
9 #include <string>
10
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
14 namespace chromeos {
15
16 // A class that handles the WebUI hooks for the app launch splash screen.
17 class AppLaunchSplashScreenHandler : public BaseScreenHandler,
18                                      public AppLaunchSplashScreenActor {
19  public:
20   AppLaunchSplashScreenHandler();
21   virtual ~AppLaunchSplashScreenHandler();
22
23   // BaseScreenHandler implementation:
24   virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) OVERRIDE;
25   virtual void Initialize() OVERRIDE;
26
27   // WebUIMessageHandler implementation:
28   virtual void RegisterMessages() OVERRIDE;
29
30   // AppLaunchSplashScreenActor implementation:
31   virtual void Show(const std::string& app_id) OVERRIDE;
32   virtual void PrepareToShow() OVERRIDE;
33   virtual void Hide() OVERRIDE;
34   virtual void ToggleNetworkConfig(bool visible) OVERRIDE;
35   virtual void UpdateAppLaunchState(AppLaunchState state) OVERRIDE;
36   virtual void SetDelegate(
37       AppLaunchSplashScreenHandler::Delegate* delegate) OVERRIDE;
38
39  private:
40   void PopulateAppInfo(base::DictionaryValue* out_info);
41   void SetLaunchText(const std::string& text);
42   int GetProgressMessageFromState(AppLaunchState state);
43   void HandleConfigureNetwork();
44   void HandleCancelAppLaunch();
45
46   AppLaunchSplashScreenHandler::Delegate* delegate_;
47   bool show_on_init_;
48   std::string app_id_;
49   AppLaunchState state_;
50
51   DISALLOW_COPY_AND_ASSIGN(AppLaunchSplashScreenHandler);
52 };
53
54 }  // namespace chromeos
55
56 #endif  // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_APP_LAUNCH_SPLASH_SCREEN_HANDLER_H_