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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #include "chrome/common/chrome_result_codes.h" | 56 #include "chrome/common/chrome_result_codes.h" |
57 #include "chrome/common/chrome_switches.h" | 57 #include "chrome/common/chrome_switches.h" |
58 #include "chrome/common/chrome_version_info.h" | 58 #include "chrome/common/chrome_version_info.h" |
59 #include "chrome/common/pref_names.h" | 59 #include "chrome/common/pref_names.h" |
60 #include "chrome/common/url_constants.h" | 60 #include "chrome/common/url_constants.h" |
61 #include "chrome/installer/util/browser_distribution.h" | 61 #include "chrome/installer/util/browser_distribution.h" |
62 #include "components/google/core/browser/google_util.h" | 62 #include "components/google/core/browser/google_util.h" |
63 #include "components/search_engines/util.h" | 63 #include "components/search_engines/util.h" |
64 #include "components/signin/core/common/profile_management_switches.h" | 64 #include "components/signin/core/common/profile_management_switches.h" |
65 #include "components/url_fixer/url_fixer.h" | 65 #include "components/url_fixer/url_fixer.h" |
| 66 #include "components/user_manager/user_id.h" |
66 #include "content/public/browser/browser_thread.h" | 67 #include "content/public/browser/browser_thread.h" |
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 "content/public/common/content_switches.h" | 70 #include "content/public/common/content_switches.h" |
70 #include "extensions/common/switches.h" | 71 #include "extensions/common/switches.h" |
71 #include "net/base/net_util.h" | 72 #include "net/base/net_util.h" |
72 | 73 |
73 #if defined(USE_ASH) | 74 #if defined(USE_ASH) |
74 #include "ash/shell.h" | 75 #include "ash/shell.h" |
75 #endif | 76 #endif |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 command_line.GetSwitchValueASCII(switches::kAppId)); | 566 command_line.GetSwitchValueASCII(switches::kAppId)); |
566 | 567 |
567 // Skip browser launch since app mode launches its app window. | 568 // Skip browser launch since app mode launches its app window. |
568 silent_launch = true; | 569 silent_launch = true; |
569 } | 570 } |
570 | 571 |
571 // If we are a demo app session and we crashed, there is no safe recovery | 572 // If we are a demo app session and we crashed, there is no safe recovery |
572 // possible. We should instead cleanly exit and go back to the OOBE screen, | 573 // possible. We should instead cleanly exit and go back to the OOBE screen, |
573 // where we will launch again after the timeout has expired. | 574 // where we will launch again after the timeout has expired. |
574 if (chromeos::DemoAppLauncher::IsDemoAppSession( | 575 if (chromeos::DemoAppLauncher::IsDemoAppSession( |
575 command_line.GetSwitchValueASCII(chromeos::switches::kLoginUser))) { | 576 user_manager::UserID::FromUserEmail(command_line.GetSwitchValueASCII(chrom
eos::switches::kLoginUser)))) { |
576 chrome::AttemptUserExit(); | 577 chrome::AttemptUserExit(); |
577 return false; | 578 return false; |
578 } | 579 } |
579 #endif // OS_CHROMEOS | 580 #endif // OS_CHROMEOS |
580 | 581 |
581 #if defined(TOOLKIT_VIEWS) && defined(USE_X11) | 582 #if defined(TOOLKIT_VIEWS) && defined(USE_X11) |
582 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); | 583 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); |
583 #endif | 584 #endif |
584 | 585 |
585 VLOG(2) << "ProcessCmdLineImpl: PLACE 3"; | 586 VLOG(2) << "ProcessCmdLineImpl: PLACE 3"; |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 const base::FilePath& cur_dir, | 816 const base::FilePath& cur_dir, |
816 const base::FilePath& profile_path) { | 817 const base::FilePath& profile_path) { |
817 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 818 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
818 Profile* profile = profile_manager->GetProfileByPath(profile_path); | 819 Profile* profile = profile_manager->GetProfileByPath(profile_path); |
819 | 820 |
820 // The profile isn't loaded yet and so needs to be loaded asynchronously. | 821 // The profile isn't loaded yet and so needs to be loaded asynchronously. |
821 if (!profile) { | 822 if (!profile) { |
822 profile_manager->CreateProfileAsync(profile_path, | 823 profile_manager->CreateProfileAsync(profile_path, |
823 base::Bind(&StartupBrowserCreator::ProcessCommandLineOnProfileCreated, | 824 base::Bind(&StartupBrowserCreator::ProcessCommandLineOnProfileCreated, |
824 command_line, cur_dir), base::string16(), base::string16(), | 825 command_line, cur_dir), base::string16(), base::string16(), |
825 std::string()); | 826 user_manager::UserID(std::string(), std::string())); |
826 return; | 827 return; |
827 } | 828 } |
828 | 829 |
829 ProcessCmdLineImpl(command_line, cur_dir, false, profile, Profiles(), NULL); | 830 ProcessCmdLineImpl(command_line, cur_dir, false, profile, Profiles(), NULL); |
830 } | 831 } |
831 | 832 |
832 // static | 833 // static |
833 bool StartupBrowserCreator::ActivatedProfile() { | 834 bool StartupBrowserCreator::ActivatedProfile() { |
834 return profile_launch_observer.Get().activated_profile(); | 835 return profile_launch_observer.Get().activated_profile(); |
835 } | 836 } |
(...skipping 13 matching lines...) Expand all Loading... |
849 // If we are showing the app list then chrome isn't shown so load the app | 850 // If we are showing the app list then chrome isn't shown so load the app |
850 // list's profile rather than chrome's. | 851 // list's profile rather than chrome's. |
851 if (command_line.HasSwitch(switches::kShowAppList)) { | 852 if (command_line.HasSwitch(switches::kShowAppList)) { |
852 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> | 853 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> |
853 GetProfilePath(user_data_dir); | 854 GetProfilePath(user_data_dir); |
854 } | 855 } |
855 | 856 |
856 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 857 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
857 user_data_dir); | 858 user_data_dir); |
858 } | 859 } |
OLD | NEW |