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_CHROMEOS_APP_MODE_STARTUP_APP_LAUNCHER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_STARTUP_APP_LAUNCHER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_STARTUP_APP_LAUNCHER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_STARTUP_APP_LAUNCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 // Returns true if Internet is online. | 44 // Returns true if Internet is online. |
45 virtual bool IsNetworkReady() = 0; | 45 virtual bool IsNetworkReady() = 0; |
46 | 46 |
47 virtual void OnLoadingOAuthFile() = 0; | 47 virtual void OnLoadingOAuthFile() = 0; |
48 virtual void OnInitializingTokenService() = 0; | 48 virtual void OnInitializingTokenService() = 0; |
49 virtual void OnInstallingApp() = 0; | 49 virtual void OnInstallingApp() = 0; |
50 virtual void OnReadyToLaunch() = 0; | 50 virtual void OnReadyToLaunch() = 0; |
51 virtual void OnLaunchSucceeded() = 0; | 51 virtual void OnLaunchSucceeded() = 0; |
52 virtual void OnLaunchFailed(KioskAppLaunchError::Error error) = 0; | 52 virtual void OnLaunchFailed(KioskAppLaunchError::Error error) = 0; |
53 virtual bool IsShowingNetworkConfigScreen() = 0; | |
54 | 53 |
55 protected: | 54 protected: |
56 virtual ~Delegate() {} | 55 virtual ~Delegate() {} |
57 }; | 56 }; |
58 | 57 |
59 StartupAppLauncher(Profile* profile, | 58 StartupAppLauncher(Profile* profile, |
60 const std::string& app_id, | 59 const std::string& app_id, |
61 bool diagnostic_mode, | 60 bool diagnostic_mode, |
62 Delegate* delegate); | 61 Delegate* delegate); |
63 | 62 |
64 virtual ~StartupAppLauncher(); | 63 virtual ~StartupAppLauncher(); |
65 | 64 |
66 // Prepares the environment for an app launch. | 65 // Prepares the environment for an app launch. |
67 void Initialize(); | 66 void Initialize(); |
68 | 67 |
69 // Continues the initialization after network is ready. | 68 // Continues the initialization after network is ready. |
70 void ContinueWithNetworkReady(); | 69 void ContinueWithNetworkReady(); |
71 | 70 |
72 // Launches the app after the initialization is successful. | 71 // Launches the app after the initialization is successful. |
73 void LaunchApp(); | 72 void LaunchApp(); |
74 | 73 |
75 // Restarts launcher; | |
76 void RestartLauncher(); | |
77 | |
78 private: | 74 private: |
79 // OAuth parameters from /home/chronos/kiosk_auth file. | 75 // OAuth parameters from /home/chronos/kiosk_auth file. |
80 struct KioskOAuthParams { | 76 struct KioskOAuthParams { |
81 std::string refresh_token; | 77 std::string refresh_token; |
82 std::string client_id; | 78 std::string client_id; |
83 std::string client_secret; | 79 std::string client_secret; |
84 }; | 80 }; |
85 | 81 |
86 void OnLaunchSuccess(); | 82 void OnLaunchSuccess(); |
87 void OnLaunchFailure(KioskAppLaunchError::Error error); | 83 void OnLaunchFailure(KioskAppLaunchError::Error error); |
(...skipping 29 matching lines...) Expand all Loading... |
117 | 113 |
118 scoped_refptr<extensions::WebstoreStandaloneInstaller> installer_; | 114 scoped_refptr<extensions::WebstoreStandaloneInstaller> installer_; |
119 KioskOAuthParams auth_params_; | 115 KioskOAuthParams auth_params_; |
120 | 116 |
121 DISALLOW_COPY_AND_ASSIGN(StartupAppLauncher); | 117 DISALLOW_COPY_AND_ASSIGN(StartupAppLauncher); |
122 }; | 118 }; |
123 | 119 |
124 } // namespace chromeos | 120 } // namespace chromeos |
125 | 121 |
126 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_STARTUP_APP_LAUNCHER_H_ | 122 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_STARTUP_APP_LAUNCHER_H_ |
OLD | NEW |