| 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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 } | 535 } |
| 536 | 536 |
| 537 if (command_line.HasSwitch(switches::kInstallFromWebstore)) { | 537 if (command_line.HasSwitch(switches::kInstallFromWebstore)) { |
| 538 extensions::StartupHelper helper; | 538 extensions::StartupHelper helper; |
| 539 helper.InstallFromWebstore(command_line, last_used_profile); | 539 helper.InstallFromWebstore(command_line, last_used_profile); |
| 540 // Nothing more needs to be done, so return false to stop launching and | 540 // Nothing more needs to be done, so return false to stop launching and |
| 541 // quit. | 541 // quit. |
| 542 return false; | 542 return false; |
| 543 } | 543 } |
| 544 | 544 |
| 545 if (command_line.HasSwitch(switches::kValidateCrx)) { |
| 546 if (!process_startup) { |
| 547 LOG(ERROR) << "chrome is already running; you must close all running " |
| 548 << "instances before running with the --" |
| 549 << switches::kValidateCrx << " flag"; |
| 550 return false; |
| 551 } |
| 552 extensions::StartupHelper helper; |
| 553 helper.ValidateCrx(command_line); |
| 554 return false; |
| 555 } |
| 556 |
| 545 if (command_line.HasSwitch(switches::kLimitedInstallFromWebstore)) { | 557 if (command_line.HasSwitch(switches::kLimitedInstallFromWebstore)) { |
| 546 extensions::StartupHelper helper; | 558 extensions::StartupHelper helper; |
| 547 helper.LimitedInstallFromWebstore(command_line, last_used_profile, | 559 helper.LimitedInstallFromWebstore(command_line, last_used_profile, |
| 548 base::Bind(&base::DoNothing)); | 560 base::Bind(&base::DoNothing)); |
| 549 } | 561 } |
| 550 | 562 |
| 551 #if defined(OS_CHROMEOS) | 563 #if defined(OS_CHROMEOS) |
| 552 // The browser will be launched after the user logs in. | 564 // The browser will be launched after the user logs in. |
| 553 if (command_line.HasSwitch(switches::kLoginManager) || | 565 if (command_line.HasSwitch(switches::kLoginManager) || |
| 554 command_line.HasSwitch(switches::kLoginPassword)) { | 566 command_line.HasSwitch(switches::kLoginPassword)) { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 | 714 |
| 703 // static | 715 // static |
| 704 bool StartupBrowserCreator::ActivatedProfile() { | 716 bool StartupBrowserCreator::ActivatedProfile() { |
| 705 return profile_launch_observer.Get().activated_profile(); | 717 return profile_launch_observer.Get().activated_profile(); |
| 706 } | 718 } |
| 707 | 719 |
| 708 bool HasPendingUncleanExit(Profile* profile) { | 720 bool HasPendingUncleanExit(Profile* profile) { |
| 709 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && | 721 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && |
| 710 !profile_launch_observer.Get().HasBeenLaunched(profile); | 722 !profile_launch_observer.Get().HasBeenLaunched(profile); |
| 711 } | 723 } |
| OLD | NEW |