OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 EXTENSIONS_COMMON_EXTENSION_H_ | 5 #ifndef EXTENSIONS_COMMON_EXTENSION_H_ |
6 #define EXTENSIONS_COMMON_EXTENSION_H_ | 6 #define EXTENSIONS_COMMON_EXTENSION_H_ |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 bool is_legacy_packaged_app() const; | 344 bool is_legacy_packaged_app() const; |
345 bool is_extension() const; | 345 bool is_extension() const; |
346 bool is_shared_module() const; | 346 bool is_shared_module() const; |
347 bool is_theme() const; | 347 bool is_theme() const; |
348 | 348 |
349 bool can_be_incognito_enabled() const; | 349 bool can_be_incognito_enabled() const; |
350 | 350 |
351 void AddWebExtentPattern(const URLPattern& pattern); | 351 void AddWebExtentPattern(const URLPattern& pattern); |
352 const URLPatternSet& web_extent() const { return extent_; } | 352 const URLPatternSet& web_extent() const { return extent_; } |
353 | 353 |
| 354 bool HasPlatformSpecificResources() const; |
| 355 bool HasResourcesForPlatform(const std::string& arch) const; |
| 356 |
354 private: | 357 private: |
355 friend class base::RefCountedThreadSafe<Extension>; | 358 friend class base::RefCountedThreadSafe<Extension>; |
356 | 359 |
357 // Chooses the extension ID for an extension based on a variety of criteria. | 360 // Chooses the extension ID for an extension based on a variety of criteria. |
358 // The chosen ID will be set in |manifest|. | 361 // The chosen ID will be set in |manifest|. |
359 static bool InitExtensionID(extensions::Manifest* manifest, | 362 static bool InitExtensionID(extensions::Manifest* manifest, |
360 const base::FilePath& path, | 363 const base::FilePath& path, |
361 const ExtensionId& explicit_id, | 364 const ExtensionId& explicit_id, |
362 int creation_flags, | 365 int creation_flags, |
363 base::string16* error); | 366 base::string16* error); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 bool display_in_new_tab_page_; | 476 bool display_in_new_tab_page_; |
474 | 477 |
475 // Whether the extension has host permissions or user script patterns that | 478 // Whether the extension has host permissions or user script patterns that |
476 // imply access to file:/// scheme URLs (the user may not have actually | 479 // imply access to file:/// scheme URLs (the user may not have actually |
477 // granted it that access). | 480 // granted it that access). |
478 bool wants_file_access_; | 481 bool wants_file_access_; |
479 | 482 |
480 // The flags that were passed to InitFromValue. | 483 // The flags that were passed to InitFromValue. |
481 int creation_flags_; | 484 int creation_flags_; |
482 | 485 |
| 486 // The set of archs for which platform-specific resources are present in |
| 487 // this extension installation. |
| 488 std::set<std::string> platform_specific_resource_archs_; |
| 489 |
483 DISALLOW_COPY_AND_ASSIGN(Extension); | 490 DISALLOW_COPY_AND_ASSIGN(Extension); |
484 }; | 491 }; |
485 | 492 |
486 typedef std::vector<scoped_refptr<const Extension> > ExtensionList; | 493 typedef std::vector<scoped_refptr<const Extension> > ExtensionList; |
487 typedef std::set<ExtensionId> ExtensionIdSet; | 494 typedef std::set<ExtensionId> ExtensionIdSet; |
488 typedef std::vector<ExtensionId> ExtensionIdList; | 495 typedef std::vector<ExtensionId> ExtensionIdList; |
489 | 496 |
490 // Handy struct to pass core extension info around. | 497 // Handy struct to pass core extension info around. |
491 struct ExtensionInfo { | 498 struct ExtensionInfo { |
492 ExtensionInfo(const base::DictionaryValue* manifest, | 499 ExtensionInfo(const base::DictionaryValue* manifest, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 | 571 |
565 UpdatedExtensionPermissionsInfo( | 572 UpdatedExtensionPermissionsInfo( |
566 const Extension* extension, | 573 const Extension* extension, |
567 const PermissionSet* permissions, | 574 const PermissionSet* permissions, |
568 Reason reason); | 575 Reason reason); |
569 }; | 576 }; |
570 | 577 |
571 } // namespace extensions | 578 } // namespace extensions |
572 | 579 |
573 #endif // EXTENSIONS_COMMON_EXTENSION_H_ | 580 #endif // EXTENSIONS_COMMON_EXTENSION_H_ |
OLD | NEW |