| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // currently necessary. This is the |id| of an extension to be installed | 52 // currently necessary. This is the |id| of an extension to be installed |
| 53 // *by the web store only* which should not get the permissions install | 53 // *by the web store only* which should not get the permissions install |
| 54 // prompt. This should only be called on the UI thread. | 54 // prompt. This should only be called on the UI thread. |
| 55 // crbug.com/54916 | 55 // crbug.com/54916 |
| 56 static void SetWhitelistedInstallId(const std::string& id); | 56 static void SetWhitelistedInstallId(const std::string& id); |
| 57 | 57 |
| 58 struct WhitelistEntry { | 58 struct WhitelistEntry { |
| 59 WhitelistEntry(); | 59 WhitelistEntry(); |
| 60 ~WhitelistEntry(); | 60 ~WhitelistEntry(); |
| 61 | 61 |
| 62 scoped_ptr<DictionaryValue> parsed_manifest; | 62 scoped_ptr<base::DictionaryValue> parsed_manifest; |
| 63 std::string localized_name; | 63 std::string localized_name; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 // Exempt the next extension install with |id| from displaying a confirmation | 66 // Exempt the next extension install with |id| from displaying a confirmation |
| 67 // prompt, since the user already agreed to the install via | 67 // prompt, since the user already agreed to the install via |
| 68 // beginInstallWithManifest. We require that the extension manifest matches | 68 // beginInstallWithManifest. We require that the extension manifest matches |
| 69 // the manifest in |entry|, which is what was used to prompt with. Ownership | 69 // the manifest in |entry|, which is what was used to prompt with. Ownership |
| 70 // of |entry| is transferred here. | 70 // of |entry| is transferred here. |
| 71 static void SetWhitelistEntry(const std::string& id, WhitelistEntry* entry); | 71 static void SetWhitelistEntry(const std::string& id, WhitelistEntry* entry); |
| 72 | 72 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 void ConvertWebAppOnFileThread(const WebApplicationInfo& web_app); | 161 void ConvertWebAppOnFileThread(const WebApplicationInfo& web_app); |
| 162 | 162 |
| 163 // Called after OnUnpackSuccess as a last check to see whether the install | 163 // Called after OnUnpackSuccess as a last check to see whether the install |
| 164 // should complete. | 164 // should complete. |
| 165 bool AllowInstall(const Extension* extension, std::string* error); | 165 bool AllowInstall(const Extension* extension, std::string* error); |
| 166 | 166 |
| 167 // SandboxedExtensionUnpackerClient | 167 // SandboxedExtensionUnpackerClient |
| 168 virtual void OnUnpackFailure(const std::string& error_message); | 168 virtual void OnUnpackFailure(const std::string& error_message); |
| 169 virtual void OnUnpackSuccess(const FilePath& temp_dir, | 169 virtual void OnUnpackSuccess(const FilePath& temp_dir, |
| 170 const FilePath& extension_dir, | 170 const FilePath& extension_dir, |
| 171 const DictionaryValue* original_manifest, | 171 const base::DictionaryValue* original_manifest, |
| 172 const Extension* extension); | 172 const Extension* extension); |
| 173 | 173 |
| 174 // Returns true if we can skip confirmation because the install was | 174 // Returns true if we can skip confirmation because the install was |
| 175 // whitelisted. | 175 // whitelisted. |
| 176 bool CanSkipConfirmation(); | 176 bool CanSkipConfirmation(); |
| 177 | 177 |
| 178 // Runs on the UI thread. Confirms with the user (via ExtensionInstallUI) that | 178 // Runs on the UI thread. Confirms with the user (via ExtensionInstallUI) that |
| 179 // it is OK to install this extension. | 179 // it is OK to install this extension. |
| 180 void ConfirmInstall(); | 180 void ConfirmInstall(); |
| 181 | 181 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 // set based on the user's selection in the UI and can only ever be true for | 230 // set based on the user's selection in the UI and can only ever be true for |
| 231 // apps. | 231 // apps. |
| 232 bool create_app_shortcut_; | 232 bool create_app_shortcut_; |
| 233 | 233 |
| 234 // The extension we're installing. We own this and either pass it off to | 234 // The extension we're installing. We own this and either pass it off to |
| 235 // ExtensionService on success, or delete it on failure. | 235 // ExtensionService on success, or delete it on failure. |
| 236 scoped_refptr<const Extension> extension_; | 236 scoped_refptr<const Extension> extension_; |
| 237 | 237 |
| 238 // A parsed copy of the unmodified original manifest, before any | 238 // A parsed copy of the unmodified original manifest, before any |
| 239 // transformations like localization have taken place. | 239 // transformations like localization have taken place. |
| 240 scoped_ptr<DictionaryValue> original_manifest_; | 240 scoped_ptr<base::DictionaryValue> original_manifest_; |
| 241 | 241 |
| 242 // If non-empty, contains the current version of the extension we're | 242 // If non-empty, contains the current version of the extension we're |
| 243 // installing (for upgrades). | 243 // installing (for upgrades). |
| 244 std::string current_version_; | 244 std::string current_version_; |
| 245 | 245 |
| 246 // The icon we will display in the installation UI, if any. | 246 // The icon we will display in the installation UI, if any. |
| 247 scoped_ptr<SkBitmap> install_icon_; | 247 scoped_ptr<SkBitmap> install_icon_; |
| 248 | 248 |
| 249 // The temp directory extension resources were unpacked to. We own this and | 249 // The temp directory extension resources were unpacked to. We own this and |
| 250 // must delete it when we are done with it. | 250 // must delete it when we are done with it. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 279 std::string original_mime_type_; | 279 std::string original_mime_type_; |
| 280 | 280 |
| 281 // What caused this install? Used only for histograms that report | 281 // What caused this install? Used only for histograms that report |
| 282 // on failure rates, broken down by the cause of the install. | 282 // on failure rates, broken down by the cause of the install. |
| 283 extension_misc::CrxInstallCause install_cause_; | 283 extension_misc::CrxInstallCause install_cause_; |
| 284 | 284 |
| 285 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); | 285 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); |
| 286 }; | 286 }; |
| 287 | 287 |
| 288 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ | 288 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ |
| OLD | NEW |