Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: chrome/browser/chromeos/login/app_launch_controller.cc

Issue 900553006: Updated KioskAppManager to track whether an app was auto-launched. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment cleanup Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "chrome/browser/chromeos/login/app_launch_controller.h" 5 #include "chrome/browser/chromeos/login/app_launch_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/json/json_file_value_serializer.h" 10 #include "base/json/json_file_value_serializer.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 network_wait_timedout_(false), 119 network_wait_timedout_(false),
120 showing_network_dialog_(false), 120 showing_network_dialog_(false),
121 network_config_requested_(false), 121 network_config_requested_(false),
122 launch_splash_start_time_(0) { 122 launch_splash_start_time_(0) {
123 } 123 }
124 124
125 AppLaunchController::~AppLaunchController() { 125 AppLaunchController::~AppLaunchController() {
126 app_launch_splash_screen_actor_->SetDelegate(NULL); 126 app_launch_splash_screen_actor_->SetDelegate(NULL);
127 } 127 }
128 128
129 void AppLaunchController::StartAppLaunch() { 129 void AppLaunchController::StartAppLaunch(bool is_auto_launch) {
130 DVLOG(1) << "Starting kiosk mode..."; 130 DVLOG(1) << "Starting kiosk mode...";
131 131
132 webui_visible_ = host_->GetWebUILoginView()->webui_visible(); 132 webui_visible_ = host_->GetWebUILoginView()->webui_visible();
133 if (!webui_visible_) { 133 if (!webui_visible_) {
134 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, 134 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
135 content::NotificationService::AllSources()); 135 content::NotificationService::AllSources());
136 } 136 }
137 launch_splash_start_time_ = base::TimeTicks::Now().ToInternalValue(); 137 launch_splash_start_time_ = base::TimeTicks::Now().ToInternalValue();
138 138
139 // TODO(tengs): Add a loading profile app launch state. 139 // TODO(tengs): Add a loading profile app launch state.
140 app_launch_splash_screen_actor_->SetDelegate(this); 140 app_launch_splash_screen_actor_->SetDelegate(this);
141 app_launch_splash_screen_actor_->Show(app_id_); 141 app_launch_splash_screen_actor_->Show(app_id_);
142 142
143 KioskAppManager::App app; 143 KioskAppManager::App app;
144 CHECK(KioskAppManager::Get()); 144 CHECK(KioskAppManager::Get());
145 CHECK(KioskAppManager::Get()->GetApp(app_id_, &app)); 145 CHECK(KioskAppManager::Get()->GetApp(app_id_, &app));
146
147 if (is_auto_launch) {
148 int delay;
149 if (!CrosSettings::Get()->GetInteger(
150 kAccountsPrefDeviceLocalAccountAutoLoginDelay, &delay)) {
bartfab (slow) 2015/02/06 12:07:39 Nit: #include "chromeos/settings/cros_settings_nam
Andrew T Wilson (Slow) 2015/02/06 13:24:20 Done.
151 delay = 0;
152 }
153 DCHECK_EQ(0, delay) << "Kiosks do not support non-zero auto-login delays";
bartfab (slow) 2015/02/06 12:07:39 It is great that you are putting this check in pla
Andrew T Wilson (Slow) 2015/02/06 13:24:20 Done.
154
155 // If we are launching a kiosk app with zero delay, mark it as
156 // auto-launched.
157 if (delay == 0)
158 KioskAppManager::Get()->SetAppWasAutoLaunched(app_id_);
159 }
160
146 kiosk_profile_loader_.reset( 161 kiosk_profile_loader_.reset(
147 new KioskProfileLoader(app.user_id, false, this)); 162 new KioskProfileLoader(app.user_id, false, this));
148 kiosk_profile_loader_->Start(); 163 kiosk_profile_loader_->Start();
149 } 164 }
150 165
151 // static 166 // static
152 void AppLaunchController::SkipSplashWaitForTesting() { 167 void AppLaunchController::SkipSplashWaitForTesting() {
153 skip_splash_wait_ = true; 168 skip_splash_wait_ = true;
154 } 169 }
155 170
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 KioskAppLaunchError::Save(error); 433 KioskAppLaunchError::Save(error);
419 chrome::AttemptUserExit(); 434 chrome::AttemptUserExit();
420 CleanUp(); 435 CleanUp();
421 } 436 }
422 437
423 bool AppLaunchController::IsShowingNetworkConfigScreen() { 438 bool AppLaunchController::IsShowingNetworkConfigScreen() {
424 return network_config_requested_; 439 return network_config_requested_;
425 } 440 }
426 441
427 } // namespace chromeos 442 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698