| 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. |
| 34 // If the return value is false, a description of the problem may be written |
| 35 // into |error|. |
| 36 bool ValidateCrx(const CommandLine& cmd_line, std::string* error); |
| 37 |
| 32 // Handle --uninstall-extension flag from the |cmd_line| by uninstalling the | 38 // Handle --uninstall-extension flag from the |cmd_line| by uninstalling the |
| 33 // specified extension from |profile|. Returns false if the uninstall job | 39 // specified extension from |profile|. Returns false if the uninstall job |
| 34 // could not be started. | 40 // could not be started. |
| 35 bool UninstallExtension(const CommandLine& cmd_line, Profile* profile); | 41 bool UninstallExtension(const CommandLine& cmd_line, Profile* profile); |
| 36 | 42 |
| 37 // Handle --install-from-webstore flag from |cmd_line| by downloading | 43 // Handle --install-from-webstore flag from |cmd_line| by downloading |
| 38 // metadata from the webstore for the given id, prompting the user to | 44 // metadata from the webstore for the given id, prompting the user to |
| 39 // confirm, and then downloading the crx and installing it. | 45 // confirm, and then downloading the crx and installing it. |
| 40 bool InstallFromWebstore(const CommandLine& cmd_line, Profile* profile); | 46 bool InstallFromWebstore(const CommandLine& cmd_line, Profile* profile); |
| 41 | 47 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 54 private: | 60 private: |
| 55 scoped_refptr<PackExtensionJob> pack_job_; | 61 scoped_refptr<PackExtensionJob> pack_job_; |
| 56 bool pack_job_succeeded_; | 62 bool pack_job_succeeded_; |
| 57 | 63 |
| 58 DISALLOW_COPY_AND_ASSIGN(StartupHelper); | 64 DISALLOW_COPY_AND_ASSIGN(StartupHelper); |
| 59 }; | 65 }; |
| 60 | 66 |
| 61 } // namespace extensions | 67 } // namespace extensions |
| 62 | 68 |
| 63 #endif // CHROME_BROWSER_EXTENSIONS_STARTUP_HELPER_H_ | 69 #endif // CHROME_BROWSER_EXTENSIONS_STARTUP_HELPER_H_ |
| OLD | NEW |