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

Unified Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 22914008: Refactor kiosk app launch to be part of login screen UI flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/chrome_browser_main_chromeos.cc
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
index d6a251eb0f3910aa5af6532bf0f5e32a12d286e3..08261d234e910cdc248185030d4978b4cc1b30cb 100644
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -27,7 +27,6 @@
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h"
-#include "chrome/browser/chromeos/app_mode/kiosk_app_launcher.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
#include "chrome/browser/chromeos/boot_times_loader.h"
#include "chrome/browser/chromeos/contacts/contact_manager.h"
@@ -202,9 +201,20 @@ bool ShouldAutoLaunchKioskApp(const CommandLine& command_line) {
KioskAppLaunchError::Get() == KioskAppLaunchError::NONE;
}
+void RunAutoLaunchKioskApp() {
+ ShowLoginWizard(chromeos::WizardController::kAppLaunchSplashScreenName);
+
+ // Login screen is skipped but 'login-prompt-visible' signal is still needed.
+ LOG(INFO) << "Kiosk app auto launch >> login-prompt-visible";
+ DBusThreadManager::Get()->GetSessionManagerClient()->
+ EmitLoginPromptVisible();
+}
+
void OptionallyRunChromeOSLoginManager(const CommandLine& parsed_command_line,
Profile* profile) {
- if (parsed_command_line.HasSwitch(switches::kLoginManager)) {
+ if (ShouldAutoLaunchKioskApp(parsed_command_line)) {
+ RunAutoLaunchKioskApp();
+ } else if (parsed_command_line.HasSwitch(switches::kLoginManager)) {
const std::string first_screen =
parsed_command_line.HasSwitch(switches::kLoginScreen) ?
WizardController::kLoginScreenName : std::string();
@@ -234,17 +244,6 @@ void OptionallyRunChromeOSLoginManager(const CommandLine& parsed_command_line,
}
}
-void RunAutoLaunchKioskApp() {
- // KioskAppLauncher deletes itself when done.
- (new KioskAppLauncher(KioskAppManager::Get(),
- KioskAppManager::Get()->GetAutoLaunchApp()))->Start();
-
- // Login screen is skipped but 'login-prompt-visible' signal is still needed.
- LOG(INFO) << "Kiosk app auto launch >> login-prompt-visible";
- DBusThreadManager::Get()->GetSessionManagerClient()->
- EmitLoginPromptVisible();
-}
-
} // namespace
namespace internal {
@@ -597,11 +596,7 @@ void ChromeBrowserMainPartsChromeos::PostProfileInit() {
// Thus only show login manager in normal (non-testing) mode.
if (!parameters().ui_task ||
parsed_command_line().HasSwitch(switches::kForceLoginManagerInTests)) {
- if (ShouldAutoLaunchKioskApp(parsed_command_line())) {
- RunAutoLaunchKioskApp();
- } else {
- OptionallyRunChromeOSLoginManager(parsed_command_line(), profile());
- }
+ OptionallyRunChromeOSLoginManager(parsed_command_line(), profile());
}
// These observers must be initialized after the profile because
« no previous file with comments | « chrome/browser/chromeos/app_mode/startup_app_launcher.cc ('k') | chrome/browser/chromeos/login/app_launch_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698