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 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 std::string message; | |
| 554 std::string error; | |
| 555 if (helper.ValidateCrx(command_line, &error)) | |
| 556 message = std::string("ValidateCrx Success"); | |
| 557 else | |
| 558 message = std::string("ValidateCrx Failure: ") + error; | |
| 559 printf("%s\n", message.c_str()); | |
|
sky
2013/03/26 23:16:10
LOG?
| |
| 560 return false; | |
| 561 } | |
| 562 | |
| 545 if (command_line.HasSwitch(switches::kLimitedInstallFromWebstore)) { | 563 if (command_line.HasSwitch(switches::kLimitedInstallFromWebstore)) { |
| 546 extensions::StartupHelper helper; | 564 extensions::StartupHelper helper; |
| 547 helper.LimitedInstallFromWebstore(command_line, last_used_profile, | 565 helper.LimitedInstallFromWebstore(command_line, last_used_profile, |
| 548 base::Bind(&base::DoNothing)); | 566 base::Bind(&base::DoNothing)); |
| 549 } | 567 } |
| 550 | 568 |
| 551 #if defined(OS_CHROMEOS) | 569 #if defined(OS_CHROMEOS) |
| 552 // The browser will be launched after the user logs in. | 570 // The browser will be launched after the user logs in. |
| 553 if (command_line.HasSwitch(switches::kLoginManager) || | 571 if (command_line.HasSwitch(switches::kLoginManager) || |
| 554 command_line.HasSwitch(switches::kLoginPassword)) { | 572 command_line.HasSwitch(switches::kLoginPassword)) { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 702 | 720 |
| 703 // static | 721 // static |
| 704 bool StartupBrowserCreator::ActivatedProfile() { | 722 bool StartupBrowserCreator::ActivatedProfile() { |
| 705 return profile_launch_observer.Get().activated_profile(); | 723 return profile_launch_observer.Get().activated_profile(); |
| 706 } | 724 } |
| 707 | 725 |
| 708 bool HasPendingUncleanExit(Profile* profile) { | 726 bool HasPendingUncleanExit(Profile* profile) { |
| 709 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && | 727 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && |
| 710 !profile_launch_observer.Get().HasBeenLaunched(profile); | 728 !profile_launch_observer.Get().HasBeenLaunched(profile); |
| 711 } | 729 } |
| OLD | NEW |