Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator.cc

Issue 12660017: Add a commandline flag to chrome to validate crx files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: small cleanup to string handling Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/startup_helper_browsertest.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/startup_helper_browsertest.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698