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 CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 SYNC_TYPE_EXTENSION, | 106 SYNC_TYPE_EXTENSION, |
107 SYNC_TYPE_APP | 107 SYNC_TYPE_APP |
108 }; | 108 }; |
109 | 109 |
110 // An NaCl module included in the extension. | 110 // An NaCl module included in the extension. |
111 struct NaClModuleInfo { | 111 struct NaClModuleInfo { |
112 GURL url; | 112 GURL url; |
113 std::string mime_type; | 113 std::string mime_type; |
114 }; | 114 }; |
115 | 115 |
116 struct ImportInfo { | |
117 std::string extension_id; | |
118 std::string min_version; | |
119 }; | |
120 | |
116 // A base class for parsed manifest data that APIs want to store on | 121 // A base class for parsed manifest data that APIs want to store on |
117 // the extension. Related to base::SupportsUserData, but with an immutable | 122 // the extension. Related to base::SupportsUserData, but with an immutable |
118 // thread-safe interface to match Extension. | 123 // thread-safe interface to match Extension. |
119 struct ManifestData { | 124 struct ManifestData { |
120 virtual ~ManifestData() {} | 125 virtual ~ManifestData() {} |
121 }; | 126 }; |
122 | 127 |
123 enum InitFromValueFlags { | 128 enum InitFromValueFlags { |
124 NO_FLAGS = 0, | 129 NO_FLAGS = 0, |
125 | 130 |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
459 const std::string& launch_web_url() const { return launch_web_url_; } | 464 const std::string& launch_web_url() const { return launch_web_url_; } |
460 extension_misc::LaunchContainer launch_container() const { | 465 extension_misc::LaunchContainer launch_container() const { |
461 return launch_container_; | 466 return launch_container_; |
462 } | 467 } |
463 int launch_width() const { return launch_width_; } | 468 int launch_width() const { return launch_width_; } |
464 int launch_height() const { return launch_height_; } | 469 int launch_height() const { return launch_height_; } |
465 | 470 |
466 // Theme-related. | 471 // Theme-related. |
467 bool is_theme() const; | 472 bool is_theme() const; |
468 | 473 |
474 static void ParseImportedPath(const std::string& path, | |
475 std::string* import_id, | |
476 std::string* import_relative_path); | |
477 static bool IsImportedPath(const std::string& path); | |
478 bool Imports(const std::string& other_id) const; | |
479 bool IsExportAllowed(const std::string& relative_path) const; | |
480 | |
469 private: | 481 private: |
470 friend class base::RefCountedThreadSafe<Extension>; | 482 friend class base::RefCountedThreadSafe<Extension>; |
471 | 483 |
472 class RuntimeData { | 484 class RuntimeData { |
473 public: | 485 public: |
474 RuntimeData(); | 486 RuntimeData(); |
475 explicit RuntimeData(const PermissionSet* active); | 487 explicit RuntimeData(const PermissionSet* active); |
476 ~RuntimeData(); | 488 ~RuntimeData(); |
477 | 489 |
478 void SetActivePermissions(const PermissionSet* active); | 490 void SetActivePermissions(const PermissionSet* active); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
530 bool LoadAppFeatures(string16* error); | 542 bool LoadAppFeatures(string16* error); |
531 bool LoadExtent(const char* key, | 543 bool LoadExtent(const char* key, |
532 URLPatternSet* extent, | 544 URLPatternSet* extent, |
533 const char* list_error, | 545 const char* list_error, |
534 const char* value_error, | 546 const char* value_error, |
535 string16* error); | 547 string16* error); |
536 bool LoadLaunchContainer(string16* error); | 548 bool LoadLaunchContainer(string16* error); |
537 bool LoadLaunchURL(string16* error); | 549 bool LoadLaunchURL(string16* error); |
538 | 550 |
539 bool LoadSharedFeatures(string16* error); | 551 bool LoadSharedFeatures(string16* error); |
552 bool LoadSharedModuleFeatures(string16* error); | |
Matt Perry
2013/04/24 21:22:11
All the shared module stuff should move to its own
| |
540 bool LoadDescription(string16* error); | 553 bool LoadDescription(string16* error); |
541 bool LoadManifestVersion(string16* error); | 554 bool LoadManifestVersion(string16* error); |
542 bool LoadNaClModules(string16* error); | 555 bool LoadNaClModules(string16* error); |
543 | 556 |
544 // Returns true if the extension has more than one "UI surface". For example, | 557 // Returns true if the extension has more than one "UI surface". For example, |
545 // an extension that has a browser action and a page action. | 558 // an extension that has a browser action and a page action. |
546 bool HasMultipleUISurfaces() const; | 559 bool HasMultipleUISurfaces() const; |
547 | 560 |
548 // Updates the launch URL and extents for the extension using the given | 561 // Updates the launch URL and extents for the extension using the given |
549 // |override_url|. | 562 // |override_url|. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
597 // The API permission set; used during extension initialization. | 610 // The API permission set; used during extension initialization. |
598 // Cleared after permissions are finalized by SetActivePermissions. | 611 // Cleared after permissions are finalized by SetActivePermissions. |
599 scoped_ptr<APIPermissionSet> initial_api_permissions_; | 612 scoped_ptr<APIPermissionSet> initial_api_permissions_; |
600 | 613 |
601 // The set of permissions the extension can request at runtime. | 614 // The set of permissions the extension can request at runtime. |
602 scoped_refptr<const PermissionSet> optional_permission_set_; | 615 scoped_refptr<const PermissionSet> optional_permission_set_; |
603 | 616 |
604 // The extension's required / default set of permissions. | 617 // The extension's required / default set of permissions. |
605 scoped_refptr<const PermissionSet> required_permission_set_; | 618 scoped_refptr<const PermissionSet> required_permission_set_; |
606 | 619 |
620 // This extension exports the following resources to other extensions. | |
621 URLPatternSet exported_set_; | |
622 | |
623 // Optional list of module imports of other extensions. | |
624 std::vector<ImportInfo> imports_; | |
625 | |
607 // Any warnings that occurred when trying to create/parse the extension. | 626 // Any warnings that occurred when trying to create/parse the extension. |
608 std::vector<InstallWarning> install_warnings_; | 627 std::vector<InstallWarning> install_warnings_; |
609 | 628 |
610 // The base extension url for the extension. | 629 // The base extension url for the extension. |
611 GURL extension_url_; | 630 GURL extension_url_; |
612 | 631 |
613 // The extension's version. | 632 // The extension's version. |
614 scoped_ptr<base::Version> version_; | 633 scoped_ptr<base::Version> version_; |
615 | 634 |
616 // An optional longer description of the extension. | 635 // An optional longer description of the extension. |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
730 | 749 |
731 UpdatedExtensionPermissionsInfo( | 750 UpdatedExtensionPermissionsInfo( |
732 const Extension* extension, | 751 const Extension* extension, |
733 const PermissionSet* permissions, | 752 const PermissionSet* permissions, |
734 Reason reason); | 753 Reason reason); |
735 }; | 754 }; |
736 | 755 |
737 } // namespace extensions | 756 } // namespace extensions |
738 | 757 |
739 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 758 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |