Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: chrome/browser/extensions/crx_installer.h

Issue 226023003: Create CrxInstaller directly in WebstoreInstaller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 146 // The download ID should be set when the WebstoreInstaller is tracking the
150 // tracking the installation. The WebstoreInstaller uses this URL to match 147 // installation. The WebstoreInstaller uses it to match events to the
151 // failure notifications to the extension. 148 // particular installation.
152 const GURL& original_download_url() const { return original_download_url_; } 149 void set_download_id(uint32 download_id) { download_id_ = download_id; }
153 void set_original_download_url(const GURL& url) { 150 uint32 download_id() const { return download_id_; }
154 original_download_url_ = url;
155 }
156 151
157 // If |apps_require_extension_mime_type_| is set to true, be sure to set 152 // If |apps_require_extension_mime_type_| is set to true, be sure to set
158 // |original_mime_type_| as well. 153 // |original_mime_type_| as well.
159 void set_apps_require_extension_mime_type( 154 void set_apps_require_extension_mime_type(
160 bool apps_require_extension_mime_type) { 155 bool apps_require_extension_mime_type) {
161 apps_require_extension_mime_type_ = apps_require_extension_mime_type; 156 apps_require_extension_mime_type_ = apps_require_extension_mime_type;
162 } 157 }
163 158
164 void set_original_mime_type(const std::string& original_mime_type) { 159 void set_original_mime_type(const std::string& original_mime_type) {
165 original_mime_type_ = original_mime_type; 160 original_mime_type_ = original_mime_type;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 301
307 // Whether manual extension installation is enabled. We can't just check this 302 // 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 303 // before trying to install because themes are special-cased to always be
309 // allowed. 304 // allowed.
310 bool extensions_enabled_; 305 bool extensions_enabled_;
311 306
312 // Whether we're supposed to delete the source file on destruction. Defaults 307 // Whether we're supposed to delete the source file on destruction. Defaults
313 // to false. 308 // to false.
314 bool delete_source_; 309 bool delete_source_;
315 310
316 // The download URL, before redirects, if this is a gallery install. 311 // The download ID, if this is a gallery install.
317 GURL original_download_url_; 312 uint32 download_id_;
not at google - send to devlin 2014/04/07 16:51:40 This needs to be initialised to something. Is ther
318 313
319 // Whether to create an app shortcut after successful installation. This is 314 // 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 315 // set based on the user's selection in the UI and can only ever be true for
321 // apps. 316 // apps.
322 bool create_app_shortcut_; 317 bool create_app_shortcut_;
323 318
324 // The ordinal of the NTP apps page |extension_| will be shown on. 319 // The ordinal of the NTP apps page |extension_| will be shown on.
325 syncer::StringOrdinal page_ordinal_; 320 syncer::StringOrdinal page_ordinal_;
326 321
327 // A parsed copy of the unmodified original manifest, before any 322 // A parsed copy of the unmodified original manifest, before any
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 401
407 // Gives access to common methods and data of an extension installer. 402 // Gives access to common methods and data of an extension installer.
408 ExtensionInstaller installer_; 403 ExtensionInstaller installer_;
409 404
410 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); 405 DISALLOW_COPY_AND_ASSIGN(CrxInstaller);
411 }; 406 };
412 407
413 } // namespace extensions 408 } // namespace extensions
414 409
415 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ 410 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698