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_UNPACKED_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_UNPACKED_INSTALLER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_UNPACKED_INSTALLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_UNPACKED_INSTALLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // ExtensionService::AddExtension() is called. | 43 // ExtensionService::AddExtension() is called. |
44 void Load(const base::FilePath& extension_path); | 44 void Load(const base::FilePath& extension_path); |
45 | 45 |
46 // Loads the extension from the directory |extension_path|; | 46 // Loads the extension from the directory |extension_path|; |
47 // for use with command line switch --load-extension=path or | 47 // for use with command line switch --load-extension=path or |
48 // --load-and-launch-app=path. | 48 // --load-and-launch-app=path. |
49 // This is equivalent to Load, except that it reads the extension from | 49 // This is equivalent to Load, except that it reads the extension from |
50 // |extension_path| synchronously. | 50 // |extension_path| synchronously. |
51 // The return value indicates whether the installation has begun successfully. | 51 // The return value indicates whether the installation has begun successfully. |
52 // The id of the extension being loaded is returned in |extension_id|. | 52 // The id of the extension being loaded is returned in |extension_id|. |
| 53 // |only_allow_apps| is used to avoid side-loading of non-app extensions. |
53 bool LoadFromCommandLine(const base::FilePath& extension_path, | 54 bool LoadFromCommandLine(const base::FilePath& extension_path, |
54 std::string* extension_id); | 55 std::string* extension_id, |
| 56 bool only_allow_apps); |
55 | 57 |
56 // Allows prompting for plugins to be disabled; intended for testing only. | 58 // Allows prompting for plugins to be disabled; intended for testing only. |
57 bool prompt_for_plugins() { return prompt_for_plugins_; } | 59 bool prompt_for_plugins() { return prompt_for_plugins_; } |
58 void set_prompt_for_plugins(bool val) { prompt_for_plugins_ = val; } | 60 void set_prompt_for_plugins(bool val) { prompt_for_plugins_ = val; } |
59 | 61 |
60 // Allows overriding of whether modern manifest versions are required; | 62 // Allows overriding of whether modern manifest versions are required; |
61 // intended for testing. | 63 // intended for testing. |
62 bool require_modern_manifest_version() const { | 64 bool require_modern_manifest_version() const { |
63 return require_modern_manifest_version_; | 65 return require_modern_manifest_version_; |
64 } | 66 } |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 ExtensionInstallChecker install_checker_; | 142 ExtensionInstallChecker install_checker_; |
141 | 143 |
142 CompletionCallback callback_; | 144 CompletionCallback callback_; |
143 | 145 |
144 DISALLOW_COPY_AND_ASSIGN(UnpackedInstaller); | 146 DISALLOW_COPY_AND_ASSIGN(UnpackedInstaller); |
145 }; | 147 }; |
146 | 148 |
147 } // namespace extensions | 149 } // namespace extensions |
148 | 150 |
149 #endif // CHROME_BROWSER_EXTENSIONS_UNPACKED_INSTALLER_H_ | 151 #endif // CHROME_BROWSER_EXTENSIONS_UNPACKED_INSTALLER_H_ |
OLD | NEW |