Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/startup/startup_browser_creator.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 6 | 6 |
| 7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "apps/app_load_service.h" | 10 #include "apps/app_load_service.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 #include "content/public/browser/child_process_security_policy.h" | 67 #include "content/public/browser/child_process_security_policy.h" |
| 68 #include "content/public/browser/navigation_controller.h" | 68 #include "content/public/browser/navigation_controller.h" |
| 69 #include "grit/locale_settings.h" | 69 #include "grit/locale_settings.h" |
| 70 #include "net/base/net_util.h" | 70 #include "net/base/net_util.h" |
| 71 #include "ui/base/l10n/l10n_util.h" | 71 #include "ui/base/l10n/l10n_util.h" |
| 72 #include "ui/base/resource/resource_bundle.h" | 72 #include "ui/base/resource/resource_bundle.h" |
| 73 | 73 |
| 74 #if defined(OS_CHROMEOS) | 74 #if defined(OS_CHROMEOS) |
| 75 #include "chrome/browser/chromeos/app_mode/app_launch_utils.h" | 75 #include "chrome/browser/chromeos/app_mode/app_launch_utils.h" |
| 76 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 76 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
| 77 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | |
| 77 #include "chrome/browser/chromeos/login/user_manager.h" | 78 #include "chrome/browser/chromeos/login/user_manager.h" |
| 78 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 79 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 80 #include "chrome/browser/lifetime/application_lifetime.h" | |
| 79 #include "chromeos/chromeos_switches.h" | 81 #include "chromeos/chromeos_switches.h" |
| 80 #endif | 82 #endif |
| 81 | 83 |
| 82 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) | 84 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) |
| 83 #include "ui/events/x/touch_factory_x11.h" | 85 #include "ui/events/x/touch_factory_x11.h" |
| 84 #endif | 86 #endif |
| 85 | 87 |
| 86 #if defined(OS_WIN) | 88 #if defined(OS_WIN) |
| 87 #include "chrome/browser/ui/startup/startup_browser_creator_win.h" | 89 #include "chrome/browser/ui/startup/startup_browser_creator_win.h" |
| 88 #endif | 90 #endif |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 609 | 611 |
| 610 if (chrome::IsRunningInAppMode() && | 612 if (chrome::IsRunningInAppMode() && |
| 611 command_line.HasSwitch(switches::kAppId)) { | 613 command_line.HasSwitch(switches::kAppId)) { |
| 612 chromeos::LaunchAppOrDie( | 614 chromeos::LaunchAppOrDie( |
| 613 last_used_profile, | 615 last_used_profile, |
| 614 command_line.GetSwitchValueASCII(switches::kAppId)); | 616 command_line.GetSwitchValueASCII(switches::kAppId)); |
| 615 | 617 |
| 616 // Skip browser launch since app mode launches its app window. | 618 // Skip browser launch since app mode launches its app window. |
| 617 silent_launch = true; | 619 silent_launch = true; |
| 618 } | 620 } |
| 621 | |
| 622 // If we are a demo app session and we crashed, there is no safe recovery | |
| 623 // possible. We should instead cleanly exit and go back to the OOBE screen, | |
| 624 // where we will launch again after the timeout has expired. | |
| 625 if (chromeos::DemoAppLauncher::IsDemoAppSession( | |
| 626 command_line.GetSwitchValueASCII(chromeos::switches::kLoginUser))) { | |
| 627 chrome::AttemptUserExit(); | |
|
bartfab (slow)
2014/02/13 19:51:53
Have you tested this? In my experience, Chrome is
rkc
2014/02/13 23:22:01
Yes, multiple times. Works fine.
If you also look
| |
| 628 return false; | |
| 629 } | |
| 619 #endif | 630 #endif |
| 620 | 631 |
| 621 #if defined(TOOLKIT_VIEWS) && defined(USE_X11) | 632 #if defined(TOOLKIT_VIEWS) && defined(USE_X11) |
| 622 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); | 633 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); |
| 623 #endif | 634 #endif |
| 624 | 635 |
| 625 if (!process_startup && | 636 if (!process_startup && |
| 626 command_line.HasSwitch(switches::kDumpBrowserHistograms)) { | 637 command_line.HasSwitch(switches::kDumpBrowserHistograms)) { |
| 627 // Only handle --dump-browser-histograms from a rendezvous. In this case, do | 638 // Only handle --dump-browser-histograms from a rendezvous. In this case, do |
| 628 // not open a new browser window even if no output file was given. | 639 // not open a new browser window even if no output file was given. |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 806 } | 817 } |
| 807 | 818 |
| 808 if (command_line.HasSwitch(switches::kProfileDirectory)) { | 819 if (command_line.HasSwitch(switches::kProfileDirectory)) { |
| 809 return user_data_dir.Append( | 820 return user_data_dir.Append( |
| 810 command_line.GetSwitchValuePath(switches::kProfileDirectory)); | 821 command_line.GetSwitchValuePath(switches::kProfileDirectory)); |
| 811 } | 822 } |
| 812 | 823 |
| 813 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 824 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
| 814 user_data_dir); | 825 user_data_dir); |
| 815 } | 826 } |
| OLD | NEW |