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 #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 Loading... | |
| 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 Loading... | |
| 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_ |
| OLD | NEW |