diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-25 00:56:57 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-25 00:56:57 +0000 |
commit | c03984f2519776fb76530fe58231cc4f35351424 (patch) | |
tree | 9fa5e22473f4b2a3040dce01018f3bb9ea041a3a | |
parent | 8d72993ee340712ec3f789806153675a19f37767 (diff) | |
download | chromium_src-c03984f2519776fb76530fe58231cc4f35351424.zip chromium_src-c03984f2519776fb76530fe58231cc4f35351424.tar.gz chromium_src-c03984f2519776fb76530fe58231cc4f35351424.tar.bz2 |
cros: Fix demo app could bring up CCD.
The bug happens because kiosk command switches is in place after
profile is loaded. As a result, CCD app is loaded.
BUG=366382
Review URL: https://codereview.chromium.org/256633002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266075 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 8 insertions, 7 deletions
diff --git a/chrome/browser/chromeos/login/demo_mode/demo_app_launcher.cc b/chrome/browser/chromeos/login/demo_mode/demo_app_launcher.cc index d1f14dc..63464c4 100644 --- a/chrome/browser/chromeos/login/demo_mode/demo_app_launcher.cc +++ b/chrome/browser/chromeos/login/demo_mode/demo_app_launcher.cc @@ -29,6 +29,7 @@ namespace chromeos { const char DemoAppLauncher::kDemoUserName[] = "demouser@demo.app.local"; +const char DemoAppLauncher::kDemoAppId[] = "klimoghijjogocdbaikffefjfcfheiel"; const base::FilePath::CharType kDefaultDemoAppPath[] = FILE_PATH_LITERAL("/usr/share/chromeos-assets/demo_app"); @@ -85,10 +86,6 @@ void DemoAppLauncher::OnProfileLoaded(Profile* profile) { return; } - CommandLine* command_line = CommandLine::ForCurrentProcess(); - command_line->AppendSwitch(switches::kForceAppMode); - command_line->AppendSwitchASCII(switches::kAppId, extension_id); - // Disable network before launching the app. LOG(WARNING) << "Disabling network before launching demo app.."; NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); diff --git a/chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h b/chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h index 4a82ea8..9abd6b3 100644 --- a/chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h +++ b/chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h @@ -30,6 +30,7 @@ class DemoAppLauncher : public KioskProfileLoader::Delegate { static void SetDemoAppPathForTesting(const base::FilePath& path); static const char kDemoUserName[]; + static const char kDemoAppId[]; private: friend class DemoAppLauncherTest; diff --git a/chrome/browser/chromeos/login/demo_mode/demo_app_launcher_browsertest.cc b/chrome/browser/chromeos/login/demo_mode/demo_app_launcher_browsertest.cc index 7986d19..bc4cb2f 100644 --- a/chrome/browser/chromeos/login/demo_mode/demo_app_launcher_browsertest.cc +++ b/chrome/browser/chromeos/login/demo_mode/demo_app_launcher_browsertest.cc @@ -29,8 +29,6 @@ namespace chromeos { namespace { -char kDemoAppId[] = "klimoghijjogocdbaikffefjfcfheiel"; - base::FilePath GetTestDemoAppPath() { base::FilePath test_data_dir; EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir)); @@ -51,7 +49,7 @@ Profile* WaitForProfile() { bool VerifyDemoAppLaunch() { Profile* profile = WaitForProfile(); return AppWindowWaiter(apps::AppWindowRegistry::Get(profile), - kDemoAppId).Wait() != NULL; + DemoAppLauncher::kDemoAppId).Wait() != NULL; } bool VerifyNetworksDisabled() { diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc index e2c31b1..9fcd332 100644 --- a/chrome/browser/chromeos/login/user_manager_impl.cc +++ b/chrome/browser/chromeos/login/user_manager_impl.cc @@ -1517,6 +1517,11 @@ void UserManagerImpl::DemoAccountLoggedIn() { active_user_->SetStubImage(User::kInvalidImageIndex, false); WallpaperManager::Get()->SetUserWallpaperNow(DemoAppLauncher::kDemoUserName); + CommandLine* command_line = CommandLine::ForCurrentProcess(); + command_line->AppendSwitch(::switches::kForceAppMode); + command_line->AppendSwitchASCII(::switches::kAppId, + DemoAppLauncher::kDemoAppId); + // Disable window animation since the demo app runs in a single full screen // window and window animation causes start-up janks. CommandLine::ForCurrentProcess()->AppendSwitch( |