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_KIOSK_APP_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 // Gets the path and version of the cached crx with |app_id|. | 170 // Gets the path and version of the cached crx with |app_id|. |
171 // Returns true if the app is found in cache. | 171 // Returns true if the app is found in cache. |
172 bool GetCachedCrx(const std::string& app_id, | 172 bool GetCachedCrx(const std::string& app_id, |
173 base::FilePath* file_path, | 173 base::FilePath* file_path, |
174 std::string* version) const; | 174 std::string* version) const; |
175 | 175 |
176 void AddObserver(KioskAppManagerObserver* observer); | 176 void AddObserver(KioskAppManagerObserver* observer); |
177 void RemoveObserver(KioskAppManagerObserver* observer); | 177 void RemoveObserver(KioskAppManagerObserver* observer); |
178 | 178 |
179 // Creates extensions::ExternalLoader for installing kiosk apps during their | 179 // Creates extensions::ExternalLoader for installing the primary kiosk app |
180 // first time launch. | 180 // during its first time launch. |
181 extensions::ExternalLoader* CreateExternalLoader(); | 181 extensions::ExternalLoader* CreateExternalLoader(); |
182 | 182 |
| 183 // Creates extensions::ExternalLoader for installing secondary kiosk apps |
| 184 // before launching the primary app for the first time. |
| 185 extensions::ExternalLoader* CreateSecondaryAppExternalLoader(); |
| 186 |
183 // Installs kiosk app with |id| from cache. | 187 // Installs kiosk app with |id| from cache. |
184 void InstallFromCache(const std::string& id); | 188 void InstallFromCache(const std::string& id); |
185 | 189 |
| 190 // Installs the secondary apps listed in |ids|. |
| 191 void InstallSecondaryApps(const std::vector<std::string>& ids); |
| 192 |
186 void UpdateExternalCache(); | 193 void UpdateExternalCache(); |
187 | 194 |
188 // Monitors kiosk external update from usb stick. | 195 // Monitors kiosk external update from usb stick. |
189 void MonitorKioskExternalUpdate(); | 196 void MonitorKioskExternalUpdate(); |
190 | 197 |
191 // Invoked when kiosk app cache has been updated. | 198 // Invoked when kiosk app cache has been updated. |
192 void OnKioskAppCacheUpdated(const std::string& app_id); | 199 void OnKioskAppCacheUpdated(const std::string& app_id); |
193 | 200 |
194 // Invoked when kiosk app updating from usb stick has been completed. | 201 // Invoked when kiosk app updating from usb stick has been completed. |
195 // |success| indicates if all the updates are completed successfully. | 202 // |success| indicates if all the updates are completed successfully. |
196 void OnKioskAppExternalUpdateComplete(bool success); | 203 void OnKioskAppExternalUpdateComplete(bool success); |
197 | 204 |
198 // Installs the validated external extension into cache. | 205 // Installs the validated external extension into cache. |
199 void PutValidatedExternalExtension( | 206 void PutValidatedExternalExtension( |
200 const std::string& app_id, | 207 const std::string& app_id, |
201 const base::FilePath& crx_path, | 208 const base::FilePath& crx_path, |
202 const std::string& version, | 209 const std::string& version, |
203 const ExternalCache::PutExternalExtensionCallback& callback); | 210 const ExternalCache::PutExternalExtensionCallback& callback); |
204 | 211 |
205 bool external_loader_created() const { return external_loader_created_; } | 212 bool external_loader_created() const { return external_loader_created_; } |
| 213 bool secondary_app_external_loader_created() const { |
| 214 return secondary_app_external_loader_created_; |
| 215 } |
206 | 216 |
207 // Notifies the KioskAppManager that a given app was auto-launched | 217 // Notifies the KioskAppManager that a given app was auto-launched |
208 // automatically with no delay on startup. Certain privacy-sensitive | 218 // automatically with no delay on startup. Certain privacy-sensitive |
209 // kiosk-mode behavior (such as network reporting) is only enabled for | 219 // kiosk-mode behavior (such as network reporting) is only enabled for |
210 // kiosk apps that are immediately auto-launched on startup. | 220 // kiosk apps that are immediately auto-launched on startup. |
211 void SetAppWasAutoLaunchedWithZeroDelay(const std::string& app_id); | 221 void SetAppWasAutoLaunchedWithZeroDelay(const std::string& app_id); |
212 | 222 |
213 private: | 223 private: |
214 friend struct base::DefaultLazyInstanceTraits<KioskAppManager>; | 224 friend struct base::DefaultLazyInstanceTraits<KioskAppManager>; |
215 friend struct base::DefaultDeleter<KioskAppManager>; | 225 friend struct base::DefaultDeleter<KioskAppManager>; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 291 |
282 scoped_ptr<CrosSettings::ObserverSubscription> | 292 scoped_ptr<CrosSettings::ObserverSubscription> |
283 local_accounts_subscription_; | 293 local_accounts_subscription_; |
284 scoped_ptr<CrosSettings::ObserverSubscription> | 294 scoped_ptr<CrosSettings::ObserverSubscription> |
285 local_account_auto_login_id_subscription_; | 295 local_account_auto_login_id_subscription_; |
286 | 296 |
287 scoped_ptr<ExternalCache> external_cache_; | 297 scoped_ptr<ExternalCache> external_cache_; |
288 | 298 |
289 scoped_ptr<KioskExternalUpdater> usb_stick_updater_; | 299 scoped_ptr<KioskExternalUpdater> usb_stick_updater_; |
290 | 300 |
291 // The extension external loader for installing kiosk app. | 301 // The extension external loader for deploying primary app. |
292 bool external_loader_created_; | 302 bool external_loader_created_; |
293 base::WeakPtr<KioskAppExternalLoader> external_loader_; | 303 base::WeakPtr<KioskAppExternalLoader> external_loader_; |
294 | 304 |
| 305 // The extension external loader for deploying secondary apps. |
| 306 bool secondary_app_external_loader_created_; |
| 307 base::WeakPtr<KioskAppExternalLoader> secondary_app_external_loader_; |
| 308 |
295 DISALLOW_COPY_AND_ASSIGN(KioskAppManager); | 309 DISALLOW_COPY_AND_ASSIGN(KioskAppManager); |
296 }; | 310 }; |
297 | 311 |
298 } // namespace chromeos | 312 } // namespace chromeos |
299 | 313 |
300 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_MANAGER_H_ | 314 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_MANAGER_H_ |
OLD | NEW |