OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 virtual ~CrxInstaller(); | 192 virtual ~CrxInstaller(); |
193 | 193 |
194 // Converts the source user script to an extension. | 194 // Converts the source user script to an extension. |
195 void ConvertUserScriptOnFileThread(); | 195 void ConvertUserScriptOnFileThread(); |
196 | 196 |
197 // Converts the source web app to an extension. | 197 // Converts the source web app to an extension. |
198 void ConvertWebAppOnFileThread(const WebApplicationInfo& web_app); | 198 void ConvertWebAppOnFileThread(const WebApplicationInfo& web_app); |
199 | 199 |
200 // Called after OnUnpackSuccess as a last check to see whether the install | 200 // Called after OnUnpackSuccess as a last check to see whether the install |
201 // should complete. | 201 // should complete. |
202 bool AllowInstall(const Extension* extension, std::string* error); | 202 bool AllowInstall(const Extension* extension, string16* error); |
203 | 203 |
204 // SandboxedExtensionUnpackerClient | 204 // SandboxedExtensionUnpackerClient |
205 virtual void OnUnpackFailure(const std::string& error_message) OVERRIDE; | 205 virtual void OnUnpackFailure(const string16& error_message) OVERRIDE; |
206 virtual void OnUnpackSuccess(const FilePath& temp_dir, | 206 virtual void OnUnpackSuccess(const FilePath& temp_dir, |
207 const FilePath& extension_dir, | 207 const FilePath& extension_dir, |
208 const base::DictionaryValue* original_manifest, | 208 const base::DictionaryValue* original_manifest, |
209 const Extension* extension) OVERRIDE; | 209 const Extension* extension) OVERRIDE; |
210 | 210 |
211 // Returns true if we can skip confirmation because the install was | 211 // Returns true if we can skip confirmation because the install was |
212 // whitelisted. | 212 // whitelisted. |
213 bool CanSkipConfirmation(); | 213 bool CanSkipConfirmation(); |
214 | 214 |
215 // Runs on the UI thread. Confirms with the user (via ExtensionInstallUI) that | 215 // Runs on the UI thread. Confirms with the user (via ExtensionInstallUI) that |
216 // it is OK to install this extension. | 216 // it is OK to install this extension. |
217 void ConfirmInstall(); | 217 void ConfirmInstall(); |
218 | 218 |
219 // Runs on File thread. Install the unpacked extension into the profile and | 219 // Runs on File thread. Install the unpacked extension into the profile and |
220 // notify the frontend. | 220 // notify the frontend. |
221 void CompleteInstall(); | 221 void CompleteInstall(); |
222 | 222 |
223 // Result reporting. | 223 // Result reporting. |
224 void ReportFailureFromFileThread(const std::string& error); | 224 void ReportFailureFromFileThread(const string16& error); |
225 void ReportFailureFromUIThread(const std::string& error); | 225 void ReportFailureFromUIThread(const string16& error); |
226 void ReportSuccessFromFileThread(); | 226 void ReportSuccessFromFileThread(); |
227 void ReportSuccessFromUIThread(); | 227 void ReportSuccessFromUIThread(); |
228 void NotifyCrxInstallComplete(const Extension* extension); | 228 void NotifyCrxInstallComplete(const Extension* extension); |
229 | 229 |
230 // The file we're installing. | 230 // The file we're installing. |
231 FilePath source_file_; | 231 FilePath source_file_; |
232 | 232 |
233 // The URL the file was downloaded from. | 233 // The URL the file was downloaded from. |
234 GURL download_url_; | 234 GURL download_url_; |
235 | 235 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 extension_misc::CrxInstallCause install_cause_; | 326 extension_misc::CrxInstallCause install_cause_; |
327 | 327 |
328 // Creation flags to use for the extension. These flags will be used | 328 // Creation flags to use for the extension. These flags will be used |
329 // when calling Extenion::Create() by the crx installer. | 329 // when calling Extenion::Create() by the crx installer. |
330 int creation_flags_; | 330 int creation_flags_; |
331 | 331 |
332 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); | 332 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); |
333 }; | 333 }; |
334 | 334 |
335 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ | 335 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ |
OLD | NEW |