OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_LOGIN_DEMO_MODE_DEMO_APP_LAUNCHER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_DEMO_MODE_DEMO_APP_LAUNCHER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_DEMO_MODE_DEMO_APP_LAUNCHER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_DEMO_MODE_DEMO_APP_LAUNCHER_H_ |
7 | 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" |
8 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/chromeos/app_mode/kiosk_profile_loader.h" | 13 #include "chrome/browser/chromeos/app_mode/kiosk_profile_loader.h" |
10 | 14 |
11 class Profile; | 15 namespace base { |
| 16 class FilePath; |
| 17 } |
12 | 18 |
13 namespace chromeos { | 19 namespace chromeos { |
14 | 20 |
15 // Class responsible for launching the demo app under a kiosk session. | 21 // Class responsible for launching the demo app under a kiosk session. |
16 class DemoAppLauncher : public KioskProfileLoader::Delegate { | 22 class DemoAppLauncher : public KioskProfileLoader::Delegate { |
17 public: | 23 public: |
18 DemoAppLauncher(); | 24 DemoAppLauncher(); |
19 virtual ~DemoAppLauncher(); | 25 virtual ~DemoAppLauncher(); |
20 | 26 |
21 void StartDemoAppLaunch(); | 27 void StartDemoAppLaunch(); |
22 | 28 |
23 static bool IsDemoAppSession(const std::string& user_id); | 29 static bool IsDemoAppSession(const std::string& user_id); |
| 30 static void SetDemoAppPathForTesting(const base::FilePath& path); |
| 31 |
24 static const char kDemoUserName[]; | 32 static const char kDemoUserName[]; |
25 | 33 |
26 private: | 34 private: |
| 35 friend class DemoAppLauncherTest; |
| 36 |
27 // KioskProfileLoader::Delegate overrides: | 37 // KioskProfileLoader::Delegate overrides: |
28 virtual void OnProfileLoaded(Profile* profile) OVERRIDE; | 38 virtual void OnProfileLoaded(Profile* profile) OVERRIDE; |
29 virtual void OnProfileLoadFailed(KioskAppLaunchError::Error error) OVERRIDE; | 39 virtual void OnProfileLoadFailed(KioskAppLaunchError::Error error) OVERRIDE; |
30 | 40 |
31 Profile* profile_; | |
32 scoped_ptr<KioskProfileLoader> kiosk_profile_loader_; | 41 scoped_ptr<KioskProfileLoader> kiosk_profile_loader_; |
33 | 42 |
| 43 static base::FilePath* demo_app_path_; |
| 44 |
34 DISALLOW_COPY_AND_ASSIGN(DemoAppLauncher); | 45 DISALLOW_COPY_AND_ASSIGN(DemoAppLauncher); |
35 }; | 46 }; |
36 | 47 |
37 } // namespace chromeos | 48 } // namespace chromeos |
38 | 49 |
39 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_DEMO_MODE_DEMO_APP_LAUNCHER_H_ | 50 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_DEMO_MODE_DEMO_APP_LAUNCHER_H_ |
OLD | NEW |