| 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" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 13 #include "base/timer.h" | 14 #include "base/timer.h" |
| 14 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" | 15 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" |
| 15 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 17 #include "net/base/network_change_notifier.h" | 18 #include "net/base/network_change_notifier.h" |
| 18 #include "ui/base/events/event_handler.h" | 19 #include "ui/base/events/event_handler.h" |
| 19 | 20 |
| 20 class Profile; | 21 class Profile; |
| 21 | 22 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 47 void Start(); | 48 void Start(); |
| 48 | 49 |
| 49 private: | 50 private: |
| 50 // OAuth parameters from /home/chronos/kiosk_auth file. | 51 // OAuth parameters from /home/chronos/kiosk_auth file. |
| 51 struct KioskOAuthParams { | 52 struct KioskOAuthParams { |
| 52 std::string refresh_token; | 53 std::string refresh_token; |
| 53 std::string client_id; | 54 std::string client_id; |
| 54 std::string client_secret; | 55 std::string client_secret; |
| 55 }; | 56 }; |
| 56 | 57 |
| 58 // A class to watch for app window creation. |
| 59 class AppWindowWatcher; |
| 60 |
| 57 // Private dtor because this class manages its own lifetime. | 61 // Private dtor because this class manages its own lifetime. |
| 58 virtual ~StartupAppLauncher(); | 62 virtual ~StartupAppLauncher(); |
| 59 | 63 |
| 60 void Cleanup(); | 64 void Cleanup(); |
| 61 void OnLaunchSuccess(); | 65 void OnLaunchSuccess(); |
| 62 void OnLaunchFailure(KioskAppLaunchError::Error error); | 66 void OnLaunchFailure(KioskAppLaunchError::Error error); |
| 63 | 67 |
| 64 void Launch(); | 68 void Launch(); |
| 65 | 69 |
| 66 void BeginInstall(); | 70 void BeginInstall(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 90 Profile* profile_; | 94 Profile* profile_; |
| 91 const std::string app_id_; | 95 const std::string app_id_; |
| 92 | 96 |
| 93 int64 launch_splash_start_time_; | 97 int64 launch_splash_start_time_; |
| 94 | 98 |
| 95 scoped_refptr<extensions::WebstoreStandaloneInstaller> installer_; | 99 scoped_refptr<extensions::WebstoreStandaloneInstaller> installer_; |
| 96 content::NotificationRegistrar registrar_; | 100 content::NotificationRegistrar registrar_; |
| 97 base::OneShotTimer<StartupAppLauncher> network_wait_timer_; | 101 base::OneShotTimer<StartupAppLauncher> network_wait_timer_; |
| 98 KioskOAuthParams auth_params_; | 102 KioskOAuthParams auth_params_; |
| 99 | 103 |
| 104 scoped_ptr<AppWindowWatcher> app_window_watcher_; |
| 105 |
| 100 DISALLOW_COPY_AND_ASSIGN(StartupAppLauncher); | 106 DISALLOW_COPY_AND_ASSIGN(StartupAppLauncher); |
| 101 }; | 107 }; |
| 102 | 108 |
| 103 } // namespace chromeos | 109 } // namespace chromeos |
| 104 | 110 |
| 105 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_STARTUP_APP_LAUNCHER_H_ | 111 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_STARTUP_APP_LAUNCHER_H_ |
| OLD | NEW |