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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 #include "chrome/installer/util/browser_distribution.h" | 58 #include "chrome/installer/util/browser_distribution.h" |
59 #include "content/public/browser/browser_thread.h" | 59 #include "content/public/browser/browser_thread.h" |
60 #include "content/public/browser/child_process_security_policy.h" | 60 #include "content/public/browser/child_process_security_policy.h" |
61 #include "content/public/browser/navigation_controller.h" | 61 #include "content/public/browser/navigation_controller.h" |
62 #include "grit/locale_settings.h" | 62 #include "grit/locale_settings.h" |
63 #include "net/base/net_util.h" | 63 #include "net/base/net_util.h" |
64 #include "ui/base/l10n/l10n_util.h" | 64 #include "ui/base/l10n/l10n_util.h" |
65 #include "ui/base/resource/resource_bundle.h" | 65 #include "ui/base/resource/resource_bundle.h" |
66 | 66 |
67 #if defined(OS_CHROMEOS) | 67 #if defined(OS_CHROMEOS) |
68 #include "chrome/browser/chromeos/app_mode/startup_app_launcher.h" | |
69 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 68 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
70 #include "chrome/browser/chromeos/login/user_manager.h" | 69 #include "chrome/browser/chromeos/login/user_manager.h" |
71 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 70 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
72 #include "chromeos/chromeos_switches.h" | 71 #include "chromeos/chromeos_switches.h" |
73 #endif | 72 #endif |
74 | 73 |
75 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) | 74 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) |
76 #include "ui/base/touch/touch_factory_x11.h" | 75 #include "ui/base/touch/touch_factory_x11.h" |
77 #endif | 76 #endif |
78 | 77 |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
586 base::Bind(&base::DoNothing)); | 585 base::Bind(&base::DoNothing)); |
587 } | 586 } |
588 | 587 |
589 #if defined(OS_CHROMEOS) | 588 #if defined(OS_CHROMEOS) |
590 // The browser will be launched after the user logs in. | 589 // The browser will be launched after the user logs in. |
591 if (command_line.HasSwitch(chromeos::switches::kLoginManager) || | 590 if (command_line.HasSwitch(chromeos::switches::kLoginManager) || |
592 command_line.HasSwitch(chromeos::switches::kLoginPassword)) { | 591 command_line.HasSwitch(chromeos::switches::kLoginPassword)) { |
593 silent_launch = true; | 592 silent_launch = true; |
594 } | 593 } |
595 | 594 |
596 if (chrome::IsRunningInAppMode() && | |
597 command_line.HasSwitch(switches::kAppId)) { | |
598 // StartupAppLauncher deletes itself when done. | |
599 (new chromeos::StartupAppLauncher( | |
600 last_used_profile, | |
601 command_line.GetSwitchValueASCII(switches::kAppId)))->Start(); | |
602 | |
603 // Skip browser launch since app mode launches its app window. | |
604 silent_launch = true; | |
605 } | |
xiyuan
2013/08/15 18:19:42
We would need to do something here to handle relau
Tim Song
2013/08/16 19:07:59
Done.
| |
606 #endif | 595 #endif |
607 | 596 |
608 #if defined(TOOLKIT_VIEWS) && defined(USE_X11) | 597 #if defined(TOOLKIT_VIEWS) && defined(USE_X11) |
609 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); | 598 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); |
610 #endif | 599 #endif |
611 | 600 |
612 // If we don't want to launch a new browser window or tab (in the case | 601 // If we don't want to launch a new browser window or tab (in the case |
613 // of an automation request), we are done here. | 602 // of an automation request), we are done here. |
614 if (silent_launch) | 603 if (silent_launch) |
615 return true; | 604 return true; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
744 | 733 |
745 // static | 734 // static |
746 bool StartupBrowserCreator::ActivatedProfile() { | 735 bool StartupBrowserCreator::ActivatedProfile() { |
747 return profile_launch_observer.Get().activated_profile(); | 736 return profile_launch_observer.Get().activated_profile(); |
748 } | 737 } |
749 | 738 |
750 bool HasPendingUncleanExit(Profile* profile) { | 739 bool HasPendingUncleanExit(Profile* profile) { |
751 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && | 740 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && |
752 !profile_launch_observer.Get().HasBeenLaunched(profile); | 741 !profile_launch_observer.Get().HasBeenLaunched(profile); |
753 } | 742 } |
OLD | NEW |