app_launch_splash_screen_actor.h revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
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_CHROMEOS_LOGIN_SCREENS_APP_LAUNCH_SPLASH_SCREEN_ACTOR_H_ 6#define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_APP_LAUNCH_SPLASH_SCREEN_ACTOR_H_ 7 8#include "base/strings/string16.h" 9 10namespace chromeos { 11 12// Interface for UI implemenations of the ApplaunchSplashScreen. 13class AppLaunchSplashScreenActor { 14 public: 15 enum AppLaunchState { 16 APP_LAUNCH_STATE_LOADING_AUTH_FILE, 17 APP_LAUNCH_STATE_LOADING_TOKEN_SERVICE, 18 APP_LAUNCH_STATE_PREPARING_NETWORK, 19 APP_LAUNCH_STATE_INSTALLING_APPLICATION, 20 APP_LAUNCH_STATE_WAITING_APP_WINDOW, 21 APP_LAUNCH_STATE_NETWORK_WAIT_TIMEOUT, 22 }; 23 24 class Delegate { 25 public: 26 // Invoked when the configure network control is clicked. 27 virtual void OnConfigureNetwork() = 0; 28 29 // Invoked when the app launch bailout shortcut key is pressed. 30 virtual void OnCancelAppLaunch() = 0; 31 32 // Invoked when network state is changed. |online| is true if the device 33 // is connected to the Internet. 34 virtual void OnNetworkStateChanged(bool online) = 0; 35 36 protected: 37 virtual ~Delegate() {} 38 }; 39 40 virtual ~AppLaunchSplashScreenActor() {} 41 42 // Sets screen this actor belongs to. 43 virtual void SetDelegate(Delegate* screen) = 0; 44 45 // Prepare the contents to showing. 46 virtual void PrepareToShow() = 0; 47 48 // Shows the contents of the screen. 49 virtual void Show(const std::string& app_id) = 0; 50 51 // Hides the contents of the screen. 52 virtual void Hide() = 0; 53 54 // Set the current app launch state. 55 virtual void UpdateAppLaunchState(AppLaunchState state) = 0; 56 57 // Sets whether configure network control is visible. 58 virtual void ToggleNetworkConfig(bool visible) = 0; 59 60 // Shows the network error and configure UI. 61 virtual void ShowNetworkConfigureUI() = 0; 62 63 // Returns true if the default network has Internet access. 64 virtual bool IsNetworkReady() = 0; 65}; 66 67} // namespace chromeos 68 69#endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_APP_LAUNCH_SPLASH_SCREEN_ACTOR_H_ 70