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

Side by Side Diff: chrome/browser/extensions/startup_helper.h

Issue 12660017: Add a commandline flag to chrome to validate crx files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added browser test 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
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 #ifndef CHROME_BROWSER_EXTENSIONS_STARTUP_HELPER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_STARTUP_HELPER_H_
6 #define CHROME_BROWSER_EXTENSIONS_STARTUP_HELPER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_STARTUP_HELPER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "chrome/browser/extensions/pack_extension_job.h" 9 #include "chrome/browser/extensions/pack_extension_job.h"
10 10
(...skipping 11 matching lines...) Expand all
22 virtual void OnPackSuccess( 22 virtual void OnPackSuccess(
23 const base::FilePath& crx_path, 23 const base::FilePath& crx_path,
24 const base::FilePath& output_private_key_path) OVERRIDE; 24 const base::FilePath& output_private_key_path) OVERRIDE;
25 virtual void OnPackFailure(const std::string& error_message, 25 virtual void OnPackFailure(const std::string& error_message,
26 ExtensionCreator::ErrorType type) OVERRIDE; 26 ExtensionCreator::ErrorType type) OVERRIDE;
27 27
28 // Handle --pack-extension flag from the |cmd_line| by packing the specified 28 // Handle --pack-extension flag from the |cmd_line| by packing the specified
29 // extension. Returns false if the pack job failed. 29 // extension. Returns false if the pack job failed.
30 bool PackExtension(const CommandLine& cmd_line); 30 bool PackExtension(const CommandLine& cmd_line);
31 31
32 // Validates a crx at the path given by the --validate-extension flag - can
33 // it be installed? Returns true if the crx is valid, or false otherwise.
Matt Perry 2013/03/20 19:52:15 The code just unpacks it. That doesn't necessarily
asargent_no_longer_on_chrome 2013/03/21 21:34:44 As discussed offline, I think most 'error' checks
34 bool ValidateCrx(const CommandLine& cmd_line);
35
32 // Handle --uninstall-extension flag from the |cmd_line| by uninstalling the 36 // Handle --uninstall-extension flag from the |cmd_line| by uninstalling the
33 // specified extension from |profile|. Returns false if the uninstall job 37 // specified extension from |profile|. Returns false if the uninstall job
34 // could not be started. 38 // could not be started.
35 bool UninstallExtension(const CommandLine& cmd_line, Profile* profile); 39 bool UninstallExtension(const CommandLine& cmd_line, Profile* profile);
36 40
37 // Handle --install-from-webstore flag from |cmd_line| by downloading 41 // Handle --install-from-webstore flag from |cmd_line| by downloading
38 // metadata from the webstore for the given id, prompting the user to 42 // metadata from the webstore for the given id, prompting the user to
39 // confirm, and then downloading the crx and installing it. 43 // confirm, and then downloading the crx and installing it.
40 bool InstallFromWebstore(const CommandLine& cmd_line, Profile* profile); 44 bool InstallFromWebstore(const CommandLine& cmd_line, Profile* profile);
41 45
(...skipping 12 matching lines...) Expand all
54 private: 58 private:
55 scoped_refptr<PackExtensionJob> pack_job_; 59 scoped_refptr<PackExtensionJob> pack_job_;
56 bool pack_job_succeeded_; 60 bool pack_job_succeeded_;
57 61
58 DISALLOW_COPY_AND_ASSIGN(StartupHelper); 62 DISALLOW_COPY_AND_ASSIGN(StartupHelper);
59 }; 63 };
60 64
61 } // namespace extensions 65 } // namespace extensions
62 66
63 #endif // CHROME_BROWSER_EXTENSIONS_STARTUP_HELPER_H_ 67 #endif // CHROME_BROWSER_EXTENSIONS_STARTUP_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/startup_helper.cc » ('j') | chrome/browser/extensions/startup_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698