OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_CRX_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 allow_privilege_increase_ = val; | 83 allow_privilege_increase_ = val; |
84 } | 84 } |
85 | 85 |
86 bool limit_web_extent_to_download_host() const { | 86 bool limit_web_extent_to_download_host() const { |
87 return limit_web_extent_to_download_host_; | 87 return limit_web_extent_to_download_host_; |
88 } | 88 } |
89 void set_limit_web_extent_to_download_host(bool val) { | 89 void set_limit_web_extent_to_download_host(bool val) { |
90 limit_web_extent_to_download_host_ = val; | 90 limit_web_extent_to_download_host_ = val; |
91 } | 91 } |
92 | 92 |
| 93 // If |apps_require_extension_mime_type_| is set to true, be sure to set |
| 94 // |original_mime_type_| as well. |
| 95 void set_apps_require_extension_mime_type( |
| 96 bool apps_require_extension_mime_type) { |
| 97 apps_require_extension_mime_type_ = apps_require_extension_mime_type; |
| 98 } |
| 99 |
| 100 void set_original_mime_type(const std::string& original_mime_type) { |
| 101 original_mime_type_ = original_mime_type; |
| 102 } |
| 103 |
93 private: | 104 private: |
94 ~CrxInstaller(); | 105 ~CrxInstaller(); |
95 | 106 |
96 // Converts the source user script to an extension. | 107 // Converts the source user script to an extension. |
97 void ConvertUserScriptOnFileThread(); | 108 void ConvertUserScriptOnFileThread(); |
98 | 109 |
99 // SandboxedExtensionUnpackerClient | 110 // SandboxedExtensionUnpackerClient |
100 virtual void OnUnpackFailure(const std::string& error_message); | 111 virtual void OnUnpackFailure(const std::string& error_message); |
101 virtual void OnUnpackSuccess(const FilePath& temp_dir, | 112 virtual void OnUnpackSuccess(const FilePath& temp_dir, |
102 const FilePath& extension_dir, | 113 const FilePath& extension_dir, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 // The client we will work with to do the installation. This can be NULL, in | 192 // The client we will work with to do the installation. This can be NULL, in |
182 // which case the install is silent. | 193 // which case the install is silent. |
183 // NOTE: we may be deleted on the file thread. To ensure the UI is deleted on | 194 // NOTE: we may be deleted on the file thread. To ensure the UI is deleted on |
184 // the main thread we don't use a scoped_ptr here. | 195 // the main thread we don't use a scoped_ptr here. |
185 ExtensionInstallUI* client_; | 196 ExtensionInstallUI* client_; |
186 | 197 |
187 // The root of the unpacked extension directory. This is a subdirectory of | 198 // The root of the unpacked extension directory. This is a subdirectory of |
188 // temp_dir_, so we don't have to delete it explicitly. | 199 // temp_dir_, so we don't have to delete it explicitly. |
189 FilePath unpacked_extension_root_; | 200 FilePath unpacked_extension_root_; |
190 | 201 |
| 202 // True when the CRX being installed was just downloaded. |
| 203 // Used to trigger extra checks before installing. |
| 204 bool apps_require_extension_mime_type_; |
| 205 |
| 206 // The value of the content type header sent with the CRX. |
| 207 // Ignorred unless |require_extension_mime_type_| is true. |
| 208 std::string original_mime_type_; |
| 209 |
191 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); | 210 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); |
192 }; | 211 }; |
193 | 212 |
194 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ | 213 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ |
OLD | NEW |