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