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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 } | 146 } |
147 | 147 |
148 extension_misc::CrxInstallCause install_cause() const { | 148 extension_misc::CrxInstallCause install_cause() const { |
149 return install_cause_; | 149 return install_cause_; |
150 } | 150 } |
151 | 151 |
152 void set_install_cause(extension_misc::CrxInstallCause install_cause) { | 152 void set_install_cause(extension_misc::CrxInstallCause install_cause) { |
153 install_cause_ = install_cause; | 153 install_cause_ = install_cause; |
154 } | 154 } |
155 | 155 |
| 156 void set_page_index(int page_index) { |
| 157 page_index_ = page_index; |
| 158 } |
| 159 |
156 private: | 160 private: |
157 friend class ExtensionUpdaterTest; | 161 friend class ExtensionUpdaterTest; |
158 | 162 |
159 virtual ~CrxInstaller(); | 163 virtual ~CrxInstaller(); |
160 | 164 |
161 // Converts the source user script to an extension. | 165 // Converts the source user script to an extension. |
162 void ConvertUserScriptOnFileThread(); | 166 void ConvertUserScriptOnFileThread(); |
163 | 167 |
164 // Converts the source web app to an extension. | 168 // Converts the source web app to an extension. |
165 void ConvertWebAppOnFileThread(const WebApplicationInfo& web_app); | 169 void ConvertWebAppOnFileThread(const WebApplicationInfo& web_app); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 236 |
233 // Whether to create an app shortcut after successful installation. This is | 237 // Whether to create an app shortcut after successful installation. This is |
234 // set based on the user's selection in the UI and can only ever be true for | 238 // set based on the user's selection in the UI and can only ever be true for |
235 // apps. | 239 // apps. |
236 bool create_app_shortcut_; | 240 bool create_app_shortcut_; |
237 | 241 |
238 // The extension we're installing. We own this and either pass it off to | 242 // The extension we're installing. We own this and either pass it off to |
239 // ExtensionService on success, or delete it on failure. | 243 // ExtensionService on success, or delete it on failure. |
240 scoped_refptr<const Extension> extension_; | 244 scoped_refptr<const Extension> extension_; |
241 | 245 |
| 246 // The index of the NTP apps page |extension_| will be shown on. |
| 247 int page_index_; |
| 248 |
242 // A parsed copy of the unmodified original manifest, before any | 249 // A parsed copy of the unmodified original manifest, before any |
243 // transformations like localization have taken place. | 250 // transformations like localization have taken place. |
244 scoped_ptr<base::DictionaryValue> original_manifest_; | 251 scoped_ptr<base::DictionaryValue> original_manifest_; |
245 | 252 |
246 // If non-empty, contains the current version of the extension we're | 253 // If non-empty, contains the current version of the extension we're |
247 // installing (for upgrades). | 254 // installing (for upgrades). |
248 std::string current_version_; | 255 std::string current_version_; |
249 | 256 |
250 // The icon we will display in the installation UI, if any. | 257 // The icon we will display in the installation UI, if any. |
251 scoped_ptr<SkBitmap> install_icon_; | 258 scoped_ptr<SkBitmap> install_icon_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 std::string original_mime_type_; | 290 std::string original_mime_type_; |
284 | 291 |
285 // What caused this install? Used only for histograms that report | 292 // What caused this install? Used only for histograms that report |
286 // on failure rates, broken down by the cause of the install. | 293 // on failure rates, broken down by the cause of the install. |
287 extension_misc::CrxInstallCause install_cause_; | 294 extension_misc::CrxInstallCause install_cause_; |
288 | 295 |
289 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); | 296 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); |
290 }; | 297 }; |
291 | 298 |
292 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ | 299 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ |
OLD | NEW |