Chromium Code Reviews| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 void set_expected_version(const Version& val) { | 130 void set_expected_version(const Version& val) { |
| 131 expected_version_.reset(val.Clone()); | 131 expected_version_.reset(val.Clone()); |
| 132 } | 132 } |
| 133 | 133 |
| 134 bool delete_source() const { return delete_source_; } | 134 bool delete_source() const { return delete_source_; } |
| 135 void set_delete_source(bool val) { delete_source_ = val; } | 135 void set_delete_source(bool val) { delete_source_ = val; } |
| 136 | 136 |
| 137 bool allow_silent_install() const { return allow_silent_install_; } | 137 bool allow_silent_install() const { return allow_silent_install_; } |
| 138 void set_allow_silent_install(bool val) { allow_silent_install_ = val; } | 138 void set_allow_silent_install(bool val) { allow_silent_install_ = val; } |
| 139 | 139 |
| 140 bool is_gallery_install() const { return is_gallery_install_; } | 140 bool is_gallery_install() const { |
| 141 void set_is_gallery_install(bool val) { is_gallery_install_ = val; } | 141 return creation_flags_ & Extension::FROM_WEBSTORE; |
|
Matt Perry
2011/10/31 18:55:14
was this a functional change, or just a cleanup?
Aaron Boodman
2011/10/31 20:04:12
The overall change is a functional addition. The p
| |
| 142 } | |
| 143 void set_is_gallery_install(bool val) { | |
| 144 if (val) creation_flags_ |= Extension::FROM_WEBSTORE; | |
| 145 else creation_flags_ &= ~Extension::FROM_WEBSTORE; | |
| 146 } | |
| 142 | 147 |
| 143 // The original download URL should be set when the WebstoreInstaller is | 148 // The original download URL should be set when the WebstoreInstaller is |
| 144 // tracking the installation. The WebstoreInstaller uses this URL to match | 149 // tracking the installation. The WebstoreInstaller uses this URL to match |
| 145 // failure notifications to the extension. | 150 // failure notifications to the extension. |
| 146 const GURL& original_download_url() const { return original_download_url_; } | 151 const GURL& original_download_url() const { return original_download_url_; } |
| 147 void set_original_download_url(const GURL& url) { | 152 void set_original_download_url(const GURL& url) { |
| 148 original_download_url_ = url; | 153 original_download_url_ = url; |
| 149 } | 154 } |
| 150 | 155 |
| 151 // If |apps_require_extension_mime_type_| is set to true, be sure to set | 156 // If |apps_require_extension_mime_type_| is set to true, be sure to set |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 240 | 245 |
| 241 // Whether manual extension installation is enabled. We can't just check this | 246 // Whether manual extension installation is enabled. We can't just check this |
| 242 // before trying to install because themes are special-cased to always be | 247 // before trying to install because themes are special-cased to always be |
| 243 // allowed. | 248 // allowed. |
| 244 bool extensions_enabled_; | 249 bool extensions_enabled_; |
| 245 | 250 |
| 246 // Whether we're supposed to delete the source file on destruction. Defaults | 251 // Whether we're supposed to delete the source file on destruction. Defaults |
| 247 // to false. | 252 // to false. |
| 248 bool delete_source_; | 253 bool delete_source_; |
| 249 | 254 |
| 250 // Whether the install originated from the gallery. | |
| 251 bool is_gallery_install_; | |
| 252 | |
| 253 // The download URL, before redirects, if this is a gallery install. | 255 // The download URL, before redirects, if this is a gallery install. |
| 254 GURL original_download_url_; | 256 GURL original_download_url_; |
| 255 | 257 |
| 256 // Whether to create an app shortcut after successful installation. This is | 258 // Whether to create an app shortcut after successful installation. This is |
| 257 // set based on the user's selection in the UI and can only ever be true for | 259 // set based on the user's selection in the UI and can only ever be true for |
| 258 // apps. | 260 // apps. |
| 259 bool create_app_shortcut_; | 261 bool create_app_shortcut_; |
| 260 | 262 |
| 261 // The extension we're installing. We own this and either pass it off to | 263 // The extension we're installing. We own this and either pass it off to |
| 262 // ExtensionService on success, or delete it on failure. | 264 // ExtensionService on success, or delete it on failure. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 316 extension_misc::CrxInstallCause install_cause_; | 318 extension_misc::CrxInstallCause install_cause_; |
| 317 | 319 |
| 318 // Creation flags to use for the extension. These flags will be used | 320 // Creation flags to use for the extension. These flags will be used |
| 319 // when calling Extenion::Create() by the crx installer. | 321 // when calling Extenion::Create() by the crx installer. |
| 320 int creation_flags_; | 322 int creation_flags_; |
| 321 | 323 |
| 322 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); | 324 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); |
| 323 }; | 325 }; |
| 324 | 326 |
| 325 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ | 327 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ |
| OLD | NEW |