| 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 "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 return in_synchronous_profile_launch_; | 245 return in_synchronous_profile_launch_; |
| 246 } | 246 } |
| 247 | 247 |
| 248 bool StartupBrowserCreator::LaunchBrowser( | 248 bool StartupBrowserCreator::LaunchBrowser( |
| 249 const CommandLine& command_line, | 249 const CommandLine& command_line, |
| 250 Profile* profile, | 250 Profile* profile, |
| 251 const base::FilePath& cur_dir, | 251 const base::FilePath& cur_dir, |
| 252 chrome::startup::IsProcessStartup process_startup, | 252 chrome::startup::IsProcessStartup process_startup, |
| 253 chrome::startup::IsFirstRun is_first_run, | 253 chrome::startup::IsFirstRun is_first_run, |
| 254 int* return_code) { | 254 int* return_code) { |
| 255 |
| 256 if (command_line.HasSwitch(switches::kSilentLaunch)) { |
| 257 //return true; |
| 258 } |
| 259 |
| 255 in_synchronous_profile_launch_ = | 260 in_synchronous_profile_launch_ = |
| 256 process_startup == chrome::startup::IS_PROCESS_STARTUP; | 261 process_startup == chrome::startup::IS_PROCESS_STARTUP; |
| 257 DCHECK(profile); | 262 DCHECK(profile); |
| 258 | 263 |
| 259 // Continue with the incognito profile from here on if Incognito mode | 264 // Continue with the incognito profile from here on if Incognito mode |
| 260 // is forced. | 265 // is forced. |
| 261 if (IncognitoModePrefs::ShouldLaunchIncognito(command_line, | 266 if (IncognitoModePrefs::ShouldLaunchIncognito(command_line, |
| 262 profile->GetPrefs())) { | 267 profile->GetPrefs())) { |
| 263 profile = profile->GetOffTheRecordProfile(); | 268 profile = profile->GetOffTheRecordProfile(); |
| 264 } else if (command_line.HasSwitch(switches::kIncognito)) { | 269 } else if (command_line.HasSwitch(switches::kIncognito)) { |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 | 726 |
| 722 // static | 727 // static |
| 723 bool StartupBrowserCreator::ActivatedProfile() { | 728 bool StartupBrowserCreator::ActivatedProfile() { |
| 724 return profile_launch_observer.Get().activated_profile(); | 729 return profile_launch_observer.Get().activated_profile(); |
| 725 } | 730 } |
| 726 | 731 |
| 727 bool HasPendingUncleanExit(Profile* profile) { | 732 bool HasPendingUncleanExit(Profile* profile) { |
| 728 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && | 733 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && |
| 729 !profile_launch_observer.Get().HasBeenLaunched(profile); | 734 !profile_launch_observer.Get().HasBeenLaunched(profile); |
| 730 } | 735 } |
| OLD | NEW |