| 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 19 matching lines...) Expand all Loading... |
| 30 // Handle --pack-extension flag from the |cmd_line| by packing the specified | 30 // Handle --pack-extension flag from the |cmd_line| by packing the specified |
| 31 // extension. Returns false if the pack job failed. | 31 // extension. Returns false if the pack job failed. |
| 32 bool PackExtension(const base::CommandLine& cmd_line); | 32 bool PackExtension(const base::CommandLine& cmd_line); |
| 33 | 33 |
| 34 // Validates a crx at the path given by the --validate-extension flag - can | 34 // Validates a crx at the path given by the --validate-extension flag - can |
| 35 // it be installed? Returns true if the crx is valid, or false otherwise. | 35 // it be installed? Returns true if the crx is valid, or false otherwise. |
| 36 // If the return value is false, a description of the problem may be written | 36 // If the return value is false, a description of the problem may be written |
| 37 // into |error|. | 37 // into |error|. |
| 38 bool ValidateCrx(const base::CommandLine& cmd_line, std::string* error); | 38 bool ValidateCrx(const base::CommandLine& cmd_line, std::string* error); |
| 39 | 39 |
| 40 // Handle --install-ephemeral-app-from-webstore flag from |cmd_line| by | |
| 41 // downloading metadata from the webstore for the given id, prompting the | |
| 42 // user to confirm, and then downloading the crx and installing it. | |
| 43 bool InstallEphemeralApp(const base::CommandLine& cmd_line, Profile* profile); | |
| 44 | |
| 45 private: | 40 private: |
| 46 scoped_refptr<PackExtensionJob> pack_job_; | 41 scoped_refptr<PackExtensionJob> pack_job_; |
| 47 bool pack_job_succeeded_; | 42 bool pack_job_succeeded_; |
| 48 | 43 |
| 49 DISALLOW_COPY_AND_ASSIGN(StartupHelper); | 44 DISALLOW_COPY_AND_ASSIGN(StartupHelper); |
| 50 }; | 45 }; |
| 51 | 46 |
| 52 } // namespace extensions | 47 } // namespace extensions |
| 53 | 48 |
| 54 #endif // CHROME_BROWSER_EXTENSIONS_STARTUP_HELPER_H_ | 49 #endif // CHROME_BROWSER_EXTENSIONS_STARTUP_HELPER_H_ |
| OLD | NEW |