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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
306 | 295 |
307 // Whether manual extension installation is enabled. We can't just check this | 296 // Whether manual extension installation is enabled. We can't just check this |
308 // before trying to install because themes are special-cased to always be | 297 // before trying to install because themes are special-cased to always be |
309 // allowed. | 298 // allowed. |
310 bool extensions_enabled_; | 299 bool extensions_enabled_; |
311 | 300 |
312 // Whether we're supposed to delete the source file on destruction. Defaults | 301 // Whether we're supposed to delete the source file on destruction. Defaults |
313 // to false. | 302 // to false. |
314 bool delete_source_; | 303 bool delete_source_; |
315 | 304 |
316 // The download URL, before redirects, if this is a gallery install. | 305 // The download ID, if this is a gallery install. |
317 GURL original_download_url_; | 306 uint32 download_id_; |
asargent_no_longer_on_chrome
2014/04/16 00:15:51
Did you accidentally leave this in? It doesn't loo
msimonides
2014/04/16 08:42:04
Done.
| |
318 | 307 |
319 // Whether to create an app shortcut after successful installation. This is | 308 // Whether to create an app shortcut after successful installation. This is |
320 // set based on the user's selection in the UI and can only ever be true for | 309 // set based on the user's selection in the UI and can only ever be true for |
321 // apps. | 310 // apps. |
322 bool create_app_shortcut_; | 311 bool create_app_shortcut_; |
323 | 312 |
324 // The ordinal of the NTP apps page |extension_| will be shown on. | 313 // The ordinal of the NTP apps page |extension_| will be shown on. |
325 syncer::StringOrdinal page_ordinal_; | 314 syncer::StringOrdinal page_ordinal_; |
326 | 315 |
327 // A parsed copy of the unmodified original manifest, before any | 316 // A parsed copy of the unmodified original manifest, before any |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
406 | 395 |
407 // Gives access to common methods and data of an extension installer. | 396 // Gives access to common methods and data of an extension installer. |
408 ExtensionInstaller installer_; | 397 ExtensionInstaller installer_; |
409 | 398 |
410 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); | 399 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); |
411 }; | 400 }; |
412 | 401 |
413 } // namespace extensions | 402 } // namespace extensions |
414 | 403 |
415 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ | 404 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ |
OLD | NEW |