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" |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/version.h" | 14 #include "base/version.h" |
15 #include "chrome/browser/extensions/crx_installer_error.h" | 15 #include "chrome/browser/extensions/crx_installer_error.h" |
16 #include "chrome/browser/extensions/extension_install_prompt.h" | 16 #include "chrome/browser/extensions/extension_install_prompt.h" |
17 #include "chrome/browser/extensions/sandboxed_unpacker.h" | 17 #include "chrome/browser/extensions/sandboxed_unpacker.h" |
18 #include "chrome/browser/extensions/webstore_installer.h" | 18 #include "chrome/browser/extensions/webstore_installer.h" |
19 #include "chrome/common/extensions/extension.h" | 19 #include "chrome/common/extensions/extension.h" |
20 #include "chrome/common/string_ordinal.h" | |
21 #include "chrome/common/web_apps.h" | 20 #include "chrome/common/web_apps.h" |
| 21 #include "sync/api/string_ordinal.h" |
22 | 22 |
23 class ExtensionService; | 23 class ExtensionService; |
24 class SkBitmap; | 24 class SkBitmap; |
25 | 25 |
26 namespace extensions { | 26 namespace extensions { |
27 class ExtensionUpdaterTest; | 27 class ExtensionUpdaterTest; |
28 | 28 |
29 // This class installs a crx file into a profile. | 29 // This class installs a crx file into a profile. |
30 // | 30 // |
31 // Installing a CRX is a multi-step process, including unpacking the crx, | 31 // Installing a CRX is a multi-step process, including unpacking the crx, |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 install_cause_ = install_cause; | 154 install_cause_ = install_cause; |
155 } | 155 } |
156 | 156 |
157 OffStoreInstallAllowReason off_store_install_allow_reason() const { | 157 OffStoreInstallAllowReason off_store_install_allow_reason() const { |
158 return off_store_install_allow_reason_; | 158 return off_store_install_allow_reason_; |
159 } | 159 } |
160 void set_off_store_install_allow_reason(OffStoreInstallAllowReason reason) { | 160 void set_off_store_install_allow_reason(OffStoreInstallAllowReason reason) { |
161 off_store_install_allow_reason_ = reason; | 161 off_store_install_allow_reason_ = reason; |
162 } | 162 } |
163 | 163 |
164 void set_page_ordinal(const StringOrdinal& page_ordinal) { | 164 void set_page_ordinal(const syncer::StringOrdinal& page_ordinal) { |
165 page_ordinal_ = page_ordinal; | 165 page_ordinal_ = page_ordinal; |
166 } | 166 } |
167 | 167 |
168 bool did_handle_successfully() const { return did_handle_successfully_; } | 168 bool did_handle_successfully() const { return did_handle_successfully_; } |
169 | 169 |
170 Profile* profile() { return profile_; } | 170 Profile* profile() { return profile_; } |
171 | 171 |
172 private: | 172 private: |
173 friend class ExtensionUpdaterTest; | 173 friend class ExtensionUpdaterTest; |
174 friend class ExtensionCrxInstallerTest; | 174 friend class ExtensionCrxInstallerTest; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // Whether to create an app shortcut after successful installation. This is | 263 // Whether to create an app shortcut after successful installation. This is |
264 // set based on the user's selection in the UI and can only ever be true for | 264 // set based on the user's selection in the UI and can only ever be true for |
265 // apps. | 265 // apps. |
266 bool create_app_shortcut_; | 266 bool create_app_shortcut_; |
267 | 267 |
268 // The extension we're installing. We own this and either pass it off to | 268 // The extension we're installing. We own this and either pass it off to |
269 // ExtensionService on success, or delete it on failure. | 269 // ExtensionService on success, or delete it on failure. |
270 scoped_refptr<const Extension> extension_; | 270 scoped_refptr<const Extension> extension_; |
271 | 271 |
272 // The ordinal of the NTP apps page |extension_| will be shown on. | 272 // The ordinal of the NTP apps page |extension_| will be shown on. |
273 StringOrdinal page_ordinal_; | 273 syncer::StringOrdinal page_ordinal_; |
274 | 274 |
275 // A parsed copy of the unmodified original manifest, before any | 275 // A parsed copy of the unmodified original manifest, before any |
276 // transformations like localization have taken place. | 276 // transformations like localization have taken place. |
277 scoped_ptr<base::DictionaryValue> original_manifest_; | 277 scoped_ptr<base::DictionaryValue> original_manifest_; |
278 | 278 |
279 // If non-empty, contains the current version of the extension we're | 279 // If non-empty, contains the current version of the extension we're |
280 // installing (for upgrades). | 280 // installing (for upgrades). |
281 std::string current_version_; | 281 std::string current_version_; |
282 | 282 |
283 // The icon we will display in the installation UI, if any. | 283 // The icon we will display in the installation UI, if any. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 | 338 |
339 // Whether we should record an oauth2 grant upon successful install. | 339 // Whether we should record an oauth2 grant upon successful install. |
340 bool record_oauth2_grant_; | 340 bool record_oauth2_grant_; |
341 | 341 |
342 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); | 342 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); |
343 }; | 343 }; |
344 | 344 |
345 } // namespace extensions | 345 } // namespace extensions |
346 | 346 |
347 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ | 347 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ |
OLD | NEW |