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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 return in_synchronous_profile_launch_; | 264 return in_synchronous_profile_launch_; |
265 } | 265 } |
266 | 266 |
267 bool StartupBrowserCreator::LaunchBrowser( | 267 bool StartupBrowserCreator::LaunchBrowser( |
268 const CommandLine& command_line, | 268 const CommandLine& command_line, |
269 Profile* profile, | 269 Profile* profile, |
270 const base::FilePath& cur_dir, | 270 const base::FilePath& cur_dir, |
271 chrome::startup::IsProcessStartup process_startup, | 271 chrome::startup::IsProcessStartup process_startup, |
272 chrome::startup::IsFirstRun is_first_run, | 272 chrome::startup::IsFirstRun is_first_run, |
273 int* return_code) { | 273 int* return_code) { |
274 | |
275 in_synchronous_profile_launch_ = | 274 in_synchronous_profile_launch_ = |
276 process_startup == chrome::startup::IS_PROCESS_STARTUP; | 275 process_startup == chrome::startup::IS_PROCESS_STARTUP; |
277 DCHECK(profile); | 276 DCHECK(profile); |
278 | 277 |
279 // Continue with the incognito profile from here on if Incognito mode | 278 // Continue with the incognito profile from here on if Incognito mode |
280 // is forced. | 279 // is forced. |
281 if (IncognitoModePrefs::ShouldLaunchIncognito(command_line, | 280 if (IncognitoModePrefs::ShouldLaunchIncognito(command_line, |
282 profile->GetPrefs())) { | 281 profile->GetPrefs())) { |
283 profile = profile->GetOffTheRecordProfile(); | 282 profile = profile->GetOffTheRecordProfile(); |
284 } else if (command_line.HasSwitch(switches::kIncognito)) { | 283 } else if (command_line.HasSwitch(switches::kIncognito)) { |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 } | 724 } |
726 | 725 |
727 if (command_line.HasSwitch(switches::kProfileDirectory)) { | 726 if (command_line.HasSwitch(switches::kProfileDirectory)) { |
728 return user_data_dir.Append( | 727 return user_data_dir.Append( |
729 command_line.GetSwitchValuePath(switches::kProfileDirectory)); | 728 command_line.GetSwitchValuePath(switches::kProfileDirectory)); |
730 } | 729 } |
731 | 730 |
732 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 731 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
733 user_data_dir); | 732 user_data_dir); |
734 } | 733 } |
OLD | NEW |