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 22 matching lines...) Expand all Loading... | |
33 #include "chrome/browser/automation/automation_provider.h" | 33 #include "chrome/browser/automation/automation_provider.h" |
34 #include "chrome/browser/automation/automation_provider_list.h" | 34 #include "chrome/browser/automation/automation_provider_list.h" |
35 #include "chrome/browser/automation/testing_automation_provider.h" | 35 #include "chrome/browser/automation/testing_automation_provider.h" |
36 #include "chrome/browser/browser_process.h" | 36 #include "chrome/browser/browser_process.h" |
37 #include "chrome/browser/chrome_notification_types.h" | 37 #include "chrome/browser/chrome_notification_types.h" |
38 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 38 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
39 #include "chrome/browser/extensions/startup_helper.h" | 39 #include "chrome/browser/extensions/startup_helper.h" |
40 #include "chrome/browser/extensions/unpacked_installer.h" | 40 #include "chrome/browser/extensions/unpacked_installer.h" |
41 #include "chrome/browser/first_run/first_run.h" | 41 #include "chrome/browser/first_run/first_run.h" |
42 #include "chrome/browser/google/google_util.h" | 42 #include "chrome/browser/google/google_util.h" |
43 #include "chrome/browser/lifetime/application_lifetime.h" | |
43 #include "chrome/browser/notifications/desktop_notification_service.h" | 44 #include "chrome/browser/notifications/desktop_notification_service.h" |
44 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 45 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
45 #include "chrome/browser/prefs/session_startup_pref.h" | 46 #include "chrome/browser/prefs/session_startup_pref.h" |
46 #include "chrome/browser/profiles/profile.h" | 47 #include "chrome/browser/profiles/profile.h" |
47 #include "chrome/browser/profiles/profile_manager.h" | 48 #include "chrome/browser/profiles/profile_manager.h" |
48 #include "chrome/browser/profiles/profiles_state.h" | 49 #include "chrome/browser/profiles/profiles_state.h" |
49 #include "chrome/browser/search_engines/util.h" | 50 #include "chrome/browser/search_engines/util.h" |
50 #include "chrome/browser/ui/app_list/app_list_service.h" | 51 #include "chrome/browser/ui/app_list/app_list_service.h" |
51 #include "chrome/browser/ui/browser.h" | 52 #include "chrome/browser/ui/browser.h" |
52 #include "chrome/browser/ui/browser_dialogs.h" | 53 #include "chrome/browser/ui/browser_dialogs.h" |
(...skipping 14 matching lines...) Expand all Loading... | |
67 #include "content/public/browser/child_process_security_policy.h" | 68 #include "content/public/browser/child_process_security_policy.h" |
68 #include "content/public/browser/navigation_controller.h" | 69 #include "content/public/browser/navigation_controller.h" |
69 #include "grit/locale_settings.h" | 70 #include "grit/locale_settings.h" |
70 #include "net/base/net_util.h" | 71 #include "net/base/net_util.h" |
71 #include "ui/base/l10n/l10n_util.h" | 72 #include "ui/base/l10n/l10n_util.h" |
72 #include "ui/base/resource/resource_bundle.h" | 73 #include "ui/base/resource/resource_bundle.h" |
73 | 74 |
74 #if defined(OS_CHROMEOS) | 75 #if defined(OS_CHROMEOS) |
75 #include "chrome/browser/chromeos/app_mode/app_launch_utils.h" | 76 #include "chrome/browser/chromeos/app_mode/app_launch_utils.h" |
76 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 77 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
78 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | |
77 #include "chrome/browser/chromeos/login/user_manager.h" | 79 #include "chrome/browser/chromeos/login/user_manager.h" |
78 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 80 #include "chrome/browser/chromeos/profiles/profile_helper.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) |
(...skipping 522 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 (chromeos::DemoAppLauncher::IsDemoAppSession( | |
xiyuan
2014/02/12 00:03:22
nit: Add a comment to explain why we terminate ses
rkc
2014/02/12 00:08:07
Done.
| |
623 command_line.GetSwitchValueASCII(chromeos::switches::kLoginUser))) { | |
624 chrome::AttemptUserExit(); | |
625 return false; | |
626 } | |
619 #endif | 627 #endif |
620 | 628 |
621 #if defined(TOOLKIT_VIEWS) && defined(USE_X11) | 629 #if defined(TOOLKIT_VIEWS) && defined(USE_X11) |
622 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); | 630 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); |
623 #endif | 631 #endif |
624 | 632 |
625 if (!process_startup && | 633 if (!process_startup && |
626 command_line.HasSwitch(switches::kDumpBrowserHistograms)) { | 634 command_line.HasSwitch(switches::kDumpBrowserHistograms)) { |
627 // Only handle --dump-browser-histograms from a rendezvous. In this case, do | 635 // 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. | 636 // 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 } | 814 } |
807 | 815 |
808 if (command_line.HasSwitch(switches::kProfileDirectory)) { | 816 if (command_line.HasSwitch(switches::kProfileDirectory)) { |
809 return user_data_dir.Append( | 817 return user_data_dir.Append( |
810 command_line.GetSwitchValuePath(switches::kProfileDirectory)); | 818 command_line.GetSwitchValuePath(switches::kProfileDirectory)); |
811 } | 819 } |
812 | 820 |
813 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 821 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
814 user_data_dir); | 822 user_data_dir); |
815 } | 823 } |
OLD | NEW |