Chromium Code Reviews| 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 defined(OS_CHROMEOS) | |
| 257 // Don't open default Chrome window for the first login of a new | |
| 258 // user because it will hide the Getting Started App window (which is | |
| 259 // launched automatically in that situation). | |
| 260 // | |
| 261 // Note: Ideally this check should be put in ProcessCmdLineImpl() | |
| 262 // before calling this function. However, chromeos/login/login_utils.cc | |
| 263 // calls this function directly (see comments there) so I have to get it | |
| 264 // down here. | |
| 265 if (chromeos::UserManager::Get()->IsCurrentUserNew()) | |
| 266 return true; | |
| 267 #endif | |
| 268 | |
| 255 in_synchronous_profile_launch_ = | 269 in_synchronous_profile_launch_ = |
| 256 process_startup == chrome::startup::IS_PROCESS_STARTUP; | 270 process_startup == chrome::startup::IS_PROCESS_STARTUP; |
| 257 DCHECK(profile); | 271 DCHECK(profile); |
| 258 | 272 |
| 259 // Continue with the incognito profile from here on if Incognito mode | 273 // Continue with the incognito profile from here on if Incognito mode |
| 260 // is forced. | 274 // is forced. |
| 261 if (IncognitoModePrefs::ShouldLaunchIncognito(command_line, | 275 if (IncognitoModePrefs::ShouldLaunchIncognito(command_line, |
| 262 profile->GetPrefs())) { | 276 profile->GetPrefs())) { |
| 263 profile = profile->GetOffTheRecordProfile(); | 277 profile = profile->GetOffTheRecordProfile(); |
| 264 } else if (command_line.HasSwitch(switches::kIncognito)) { | 278 } else if (command_line.HasSwitch(switches::kIncognito)) { |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 576 | 590 |
| 577 if (chrome::IsRunningInAppMode() && | 591 if (chrome::IsRunningInAppMode() && |
| 578 command_line.HasSwitch(switches::kAppId)) { | 592 command_line.HasSwitch(switches::kAppId)) { |
| 579 // StartupAppLauncher deletes itself when done. | 593 // StartupAppLauncher deletes itself when done. |
| 580 (new chromeos::StartupAppLauncher( | 594 (new chromeos::StartupAppLauncher( |
| 581 last_used_profile, | 595 last_used_profile, |
| 582 command_line.GetSwitchValueASCII(switches::kAppId)))->Start(); | 596 command_line.GetSwitchValueASCII(switches::kAppId)))->Start(); |
| 583 | 597 |
| 584 // Skip browser launch since app mode launches its app window. | 598 // Skip browser launch since app mode launches its app window. |
| 585 silent_launch = true; | 599 silent_launch = true; |
| 586 } | 600 } |
|
sky
2013/05/15 15:21:55
Can you do your check here instead and set silent_
cylee1
2013/05/15 18:10:44
That was my first try. But somewhere in chromeos/
| |
| 587 #endif | 601 #endif |
| 588 | 602 |
| 589 #if defined(TOOLKIT_VIEWS) && defined(USE_X11) | 603 #if defined(TOOLKIT_VIEWS) && defined(USE_X11) |
| 590 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); | 604 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); |
| 591 #endif | 605 #endif |
| 592 | 606 |
| 593 // If we don't want to launch a new browser window or tab (in the case | 607 // If we don't want to launch a new browser window or tab (in the case |
| 594 // of an automation request), we are done here. | 608 // of an automation request), we are done here. |
| 595 if (silent_launch) | 609 if (silent_launch) |
| 596 return true; | 610 return true; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 721 | 735 |
| 722 // static | 736 // static |
| 723 bool StartupBrowserCreator::ActivatedProfile() { | 737 bool StartupBrowserCreator::ActivatedProfile() { |
| 724 return profile_launch_observer.Get().activated_profile(); | 738 return profile_launch_observer.Get().activated_profile(); |
| 725 } | 739 } |
| 726 | 740 |
| 727 bool HasPendingUncleanExit(Profile* profile) { | 741 bool HasPendingUncleanExit(Profile* profile) { |
| 728 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && | 742 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && |
| 729 !profile_launch_observer.Get().HasBeenLaunched(profile); | 743 !profile_launch_observer.Get().HasBeenLaunched(profile); |
| 730 } | 744 } |
| OLD | NEW |