| 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_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/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // Convert the specified web app into an extension and install it. | 103 // Convert the specified web app into an extension and install it. |
| 104 void InstallWebApp(const WebApplicationInfo& web_app); | 104 void InstallWebApp(const WebApplicationInfo& web_app); |
| 105 | 105 |
| 106 // Overridden from ExtensionInstallPrompt::Delegate: | 106 // Overridden from ExtensionInstallPrompt::Delegate: |
| 107 virtual void InstallUIProceed() OVERRIDE; | 107 virtual void InstallUIProceed() OVERRIDE; |
| 108 virtual void InstallUIAbort(bool user_initiated) OVERRIDE; | 108 virtual void InstallUIAbort(bool user_initiated) OVERRIDE; |
| 109 | 109 |
| 110 int creation_flags() const { return creation_flags_; } | 110 int creation_flags() const { return creation_flags_; } |
| 111 void set_creation_flags(int val) { creation_flags_ = val; } | 111 void set_creation_flags(int val) { creation_flags_ = val; } |
| 112 | 112 |
| 113 const GURL& download_url() const { return download_url_; } | |
| 114 void set_download_url(const GURL& val) { download_url_ = val; } | |
| 115 | |
| 116 const base::FilePath& source_file() const { return source_file_; } | 113 const base::FilePath& source_file() const { return source_file_; } |
| 117 | 114 |
| 118 Manifest::Location install_source() const { | 115 Manifest::Location install_source() const { |
| 119 return install_source_; | 116 return install_source_; |
| 120 } | 117 } |
| 121 void set_install_source(Manifest::Location source) { | 118 void set_install_source(Manifest::Location source) { |
| 122 install_source_ = source; | 119 install_source_ = source; |
| 123 } | 120 } |
| 124 | 121 |
| 125 const std::string& expected_id() const { return expected_id_; } | 122 const std::string& expected_id() const { return expected_id_; } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 139 bool is_gallery_install() const { | 136 bool is_gallery_install() const { |
| 140 return (creation_flags_ & Extension::FROM_WEBSTORE) > 0; | 137 return (creation_flags_ & Extension::FROM_WEBSTORE) > 0; |
| 141 } | 138 } |
| 142 void set_is_gallery_install(bool val) { | 139 void set_is_gallery_install(bool val) { |
| 143 if (val) | 140 if (val) |
| 144 creation_flags_ |= Extension::FROM_WEBSTORE; | 141 creation_flags_ |= Extension::FROM_WEBSTORE; |
| 145 else | 142 else |
| 146 creation_flags_ &= ~Extension::FROM_WEBSTORE; | 143 creation_flags_ &= ~Extension::FROM_WEBSTORE; |
| 147 } | 144 } |
| 148 | 145 |
| 149 // The original download URL should be set when the WebstoreInstaller is | |
| 150 // tracking the installation. The WebstoreInstaller uses this URL to match | |
| 151 // failure notifications to the extension. | |
| 152 const GURL& original_download_url() const { return original_download_url_; } | |
| 153 void set_original_download_url(const GURL& url) { | |
| 154 original_download_url_ = url; | |
| 155 } | |
| 156 | |
| 157 // If |apps_require_extension_mime_type_| is set to true, be sure to set | 146 // If |apps_require_extension_mime_type_| is set to true, be sure to set |
| 158 // |original_mime_type_| as well. | 147 // |original_mime_type_| as well. |
| 159 void set_apps_require_extension_mime_type( | 148 void set_apps_require_extension_mime_type( |
| 160 bool apps_require_extension_mime_type) { | 149 bool apps_require_extension_mime_type) { |
| 161 apps_require_extension_mime_type_ = apps_require_extension_mime_type; | 150 apps_require_extension_mime_type_ = apps_require_extension_mime_type; |
| 162 } | 151 } |
| 163 | 152 |
| 164 void set_original_mime_type(const std::string& original_mime_type) { | 153 void set_original_mime_type(const std::string& original_mime_type) { |
| 165 original_mime_type_ = original_mime_type; | 154 original_mime_type_ = original_mime_type; |
| 166 } | 155 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 296 |
| 308 // Whether manual extension installation is enabled. We can't just check this | 297 // Whether manual extension installation is enabled. We can't just check this |
| 309 // before trying to install because themes are special-cased to always be | 298 // before trying to install because themes are special-cased to always be |
| 310 // allowed. | 299 // allowed. |
| 311 bool extensions_enabled_; | 300 bool extensions_enabled_; |
| 312 | 301 |
| 313 // Whether we're supposed to delete the source file on destruction. Defaults | 302 // Whether we're supposed to delete the source file on destruction. Defaults |
| 314 // to false. | 303 // to false. |
| 315 bool delete_source_; | 304 bool delete_source_; |
| 316 | 305 |
| 317 // The download URL, before redirects, if this is a gallery install. | |
| 318 GURL original_download_url_; | |
| 319 | |
| 320 // Whether to create an app shortcut after successful installation. This is | 306 // Whether to create an app shortcut after successful installation. This is |
| 321 // set based on the user's selection in the UI and can only ever be true for | 307 // set based on the user's selection in the UI and can only ever be true for |
| 322 // apps. | 308 // apps. |
| 323 bool create_app_shortcut_; | 309 bool create_app_shortcut_; |
| 324 | 310 |
| 325 // The ordinal of the NTP apps page |extension_| will be shown on. | 311 // The ordinal of the NTP apps page |extension_| will be shown on. |
| 326 syncer::StringOrdinal page_ordinal_; | 312 syncer::StringOrdinal page_ordinal_; |
| 327 | 313 |
| 328 // A parsed copy of the unmodified original manifest, before any | 314 // A parsed copy of the unmodified original manifest, before any |
| 329 // transformations like localization have taken place. | 315 // transformations like localization have taken place. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 | 393 |
| 408 // Gives access to common methods and data of an extension installer. | 394 // Gives access to common methods and data of an extension installer. |
| 409 ExtensionInstaller installer_; | 395 ExtensionInstaller installer_; |
| 410 | 396 |
| 411 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); | 397 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); |
| 412 }; | 398 }; |
| 413 | 399 |
| 414 } // namespace extensions | 400 } // namespace extensions |
| 415 | 401 |
| 416 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ | 402 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ |
| OLD | NEW |