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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 UPGRADE, | 97 UPGRADE, |
98 NEW_INSTALL | 98 NEW_INSTALL |
99 }; | 99 }; |
100 | 100 |
101 enum SyncType { | 101 enum SyncType { |
102 SYNC_TYPE_NONE = 0, | 102 SYNC_TYPE_NONE = 0, |
103 SYNC_TYPE_EXTENSION, | 103 SYNC_TYPE_EXTENSION, |
104 SYNC_TYPE_APP | 104 SYNC_TYPE_APP |
105 }; | 105 }; |
106 | 106 |
107 // Declared requirements for the extension. | |
108 struct Requirements { | |
109 Requirements(); | |
110 ~Requirements(); | |
111 | |
112 bool webgl; | |
113 bool css3d; | |
114 bool npapi; | |
115 }; | |
116 | |
117 // An NaCl module included in the extension. | 107 // An NaCl module included in the extension. |
118 struct NaClModuleInfo { | 108 struct NaClModuleInfo { |
119 GURL url; | 109 GURL url; |
120 std::string mime_type; | 110 std::string mime_type; |
121 }; | 111 }; |
122 | 112 |
123 // A base class for parsed manifest data that APIs want to store on | 113 // A base class for parsed manifest data that APIs want to store on |
124 // the extension. Related to base::SupportsUserData, but with an immutable | 114 // the extension. Related to base::SupportsUserData, but with an immutable |
125 // thread-safe interface to match Extension. | 115 // thread-safe interface to match Extension. |
126 struct ManifestData { | 116 struct ManifestData { |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 // Can only be called after InitValue is finished. | 392 // Can only be called after InitValue is finished. |
403 ManifestData* GetManifestData(const std::string& key) const; | 393 ManifestData* GetManifestData(const std::string& key) const; |
404 | 394 |
405 // Sets |data| to be associated with the key. Takes ownership of |data|. | 395 // Sets |data| to be associated with the key. Takes ownership of |data|. |
406 // Can only be called before InitValue is finished. Not thread-safe; | 396 // Can only be called before InitValue is finished. Not thread-safe; |
407 // all SetManifestData calls should be on only one thread. | 397 // all SetManifestData calls should be on only one thread. |
408 void SetManifestData(const std::string& key, ManifestData* data); | 398 void SetManifestData(const std::string& key, ManifestData* data); |
409 | 399 |
410 // Accessors: | 400 // Accessors: |
411 | 401 |
412 const Requirements& requirements() const { return requirements_; } | |
413 const base::FilePath& path() const { return path_; } | 402 const base::FilePath& path() const { return path_; } |
414 const GURL& url() const { return extension_url_; } | 403 const GURL& url() const { return extension_url_; } |
415 Manifest::Location location() const; | 404 Manifest::Location location() const; |
416 const std::string& id() const; | 405 const std::string& id() const; |
417 const Version* version() const { return version_.get(); } | 406 const Version* version() const { return version_.get(); } |
418 const std::string VersionString() const; | 407 const std::string VersionString() const; |
419 const std::string& name() const { return name_; } | 408 const std::string& name() const { return name_; } |
420 const std::string& non_localized_name() const { return non_localized_name_; } | 409 const std::string& non_localized_name() const { return non_localized_name_; } |
421 // Base64-encoded version of the key used to sign this extension. | 410 // Base64-encoded version of the key used to sign this extension. |
422 // In pseudocode, returns | 411 // In pseudocode, returns |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 const char* value_error, | 551 const char* value_error, |
563 string16* error); | 552 string16* error); |
564 bool LoadLaunchContainer(string16* error); | 553 bool LoadLaunchContainer(string16* error); |
565 bool LoadLaunchURL(string16* error); | 554 bool LoadLaunchURL(string16* error); |
566 | 555 |
567 bool LoadSharedFeatures(string16* error); | 556 bool LoadSharedFeatures(string16* error); |
568 bool LoadDescription(string16* error); | 557 bool LoadDescription(string16* error); |
569 bool LoadManifestVersion(string16* error); | 558 bool LoadManifestVersion(string16* error); |
570 bool LoadNaClModules(string16* error); | 559 bool LoadNaClModules(string16* error); |
571 bool LoadSandboxedPages(string16* error); | 560 bool LoadSandboxedPages(string16* error); |
572 // Must be called after the "plugins" key has been parsed. | |
573 bool LoadRequirements(string16* error); | |
574 bool LoadKioskEnabled(string16* error); | 561 bool LoadKioskEnabled(string16* error); |
575 bool LoadOfflineEnabled(string16* error); | 562 bool LoadOfflineEnabled(string16* error); |
576 bool LoadTextToSpeechVoices(string16* error); | 563 bool LoadTextToSpeechVoices(string16* error); |
577 bool LoadManagedModeFeatures(string16* error); | 564 bool LoadManagedModeFeatures(string16* error); |
578 bool LoadManagedModeSites( | 565 bool LoadManagedModeSites( |
579 const base::DictionaryValue* content_pack_value, | 566 const base::DictionaryValue* content_pack_value, |
580 string16* error); | 567 string16* error); |
581 bool LoadManagedModeConfigurations( | 568 bool LoadManagedModeConfigurations( |
582 const base::DictionaryValue* content_pack_value, | 569 const base::DictionaryValue* content_pack_value, |
583 string16* error); | 570 string16* error); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 std::string non_localized_name_; | 605 std::string non_localized_name_; |
619 | 606 |
620 // The version of this extension's manifest. We increase the manifest | 607 // The version of this extension's manifest. We increase the manifest |
621 // version when making breaking changes to the extension system. | 608 // version when making breaking changes to the extension system. |
622 // Version 1 was the first manifest version (implied by a lack of a | 609 // Version 1 was the first manifest version (implied by a lack of a |
623 // manifest_version attribute in the extension's manifest). We initialize | 610 // manifest_version attribute in the extension's manifest). We initialize |
624 // this member variable to 0 to distinguish the "uninitialized" case from | 611 // this member variable to 0 to distinguish the "uninitialized" case from |
625 // the case when we know the manifest version actually is 1. | 612 // the case when we know the manifest version actually is 1. |
626 int manifest_version_; | 613 int manifest_version_; |
627 | 614 |
628 // The requirements declared in the manifest. | |
629 Requirements requirements_; | |
630 | |
631 // The absolute path to the directory the extension is stored in. | 615 // The absolute path to the directory the extension is stored in. |
632 base::FilePath path_; | 616 base::FilePath path_; |
633 | 617 |
634 // Whether the extension or app should be enabled in app kiosk mode. | 618 // Whether the extension or app should be enabled in app kiosk mode. |
635 bool kiosk_enabled_; | 619 bool kiosk_enabled_; |
636 | 620 |
637 // Whether the extension or app should be enabled when offline. | 621 // Whether the extension or app should be enabled when offline. |
638 bool offline_enabled_; | 622 bool offline_enabled_; |
639 | 623 |
640 // Defines the set of URLs in the extension's web content. | 624 // Defines the set of URLs in the extension's web content. |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 | 779 |
796 UpdatedExtensionPermissionsInfo( | 780 UpdatedExtensionPermissionsInfo( |
797 const Extension* extension, | 781 const Extension* extension, |
798 const PermissionSet* permissions, | 782 const PermissionSet* permissions, |
799 Reason reason); | 783 Reason reason); |
800 }; | 784 }; |
801 | 785 |
802 } // namespace extensions | 786 } // namespace extensions |
803 | 787 |
804 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 788 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |