| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 UPGRADE, | 99 UPGRADE, |
| 100 NEW_INSTALL | 100 NEW_INSTALL |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 enum SyncType { | 103 enum SyncType { |
| 104 SYNC_TYPE_NONE = 0, | 104 SYNC_TYPE_NONE = 0, |
| 105 SYNC_TYPE_EXTENSION, | 105 SYNC_TYPE_EXTENSION, |
| 106 SYNC_TYPE_APP | 106 SYNC_TYPE_APP |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 // Declared requirements for the extension. | |
| 110 struct Requirements { | |
| 111 Requirements(); | |
| 112 ~Requirements(); | |
| 113 | |
| 114 bool webgl; | |
| 115 bool css3d; | |
| 116 bool npapi; | |
| 117 }; | |
| 118 | |
| 119 // An NaCl module included in the extension. | 109 // An NaCl module included in the extension. |
| 120 struct NaClModuleInfo { | 110 struct NaClModuleInfo { |
| 121 GURL url; | 111 GURL url; |
| 122 std::string mime_type; | 112 std::string mime_type; |
| 123 }; | 113 }; |
| 124 | 114 |
| 125 // A base class for parsed manifest data that APIs want to store on | 115 // A base class for parsed manifest data that APIs want to store on |
| 126 // the extension. Related to base::SupportsUserData, but with an immutable | 116 // the extension. Related to base::SupportsUserData, but with an immutable |
| 127 // thread-safe interface to match Extension. | 117 // thread-safe interface to match Extension. |
| 128 struct ManifestData { | 118 struct ManifestData { |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 // Can only be called after InitValue is finished. | 418 // Can only be called after InitValue is finished. |
| 429 ManifestData* GetManifestData(const std::string& key) const; | 419 ManifestData* GetManifestData(const std::string& key) const; |
| 430 | 420 |
| 431 // Sets |data| to be associated with the key. Takes ownership of |data|. | 421 // Sets |data| to be associated with the key. Takes ownership of |data|. |
| 432 // Can only be called before InitValue is finished. Not thread-safe; | 422 // Can only be called before InitValue is finished. Not thread-safe; |
| 433 // all SetManifestData calls should be on only one thread. | 423 // all SetManifestData calls should be on only one thread. |
| 434 void SetManifestData(const std::string& key, ManifestData* data); | 424 void SetManifestData(const std::string& key, ManifestData* data); |
| 435 | 425 |
| 436 // Accessors: | 426 // Accessors: |
| 437 | 427 |
| 438 const Requirements& requirements() const { return requirements_; } | |
| 439 const base::FilePath& path() const { return path_; } | 428 const base::FilePath& path() const { return path_; } |
| 440 const GURL& url() const { return extension_url_; } | 429 const GURL& url() const { return extension_url_; } |
| 441 Manifest::Location location() const; | 430 Manifest::Location location() const; |
| 442 const std::string& id() const; | 431 const std::string& id() const; |
| 443 const Version* version() const { return version_.get(); } | 432 const Version* version() const { return version_.get(); } |
| 444 const std::string VersionString() const; | 433 const std::string VersionString() const; |
| 445 const std::string& name() const { return name_; } | 434 const std::string& name() const { return name_; } |
| 446 const std::string& non_localized_name() const { return non_localized_name_; } | 435 const std::string& non_localized_name() const { return non_localized_name_; } |
| 447 // Base64-encoded version of the key used to sign this extension. | 436 // Base64-encoded version of the key used to sign this extension. |
| 448 // In pseudocode, returns | 437 // In pseudocode, returns |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 const char* value_error, | 579 const char* value_error, |
| 591 string16* error); | 580 string16* error); |
| 592 bool LoadLaunchContainer(string16* error); | 581 bool LoadLaunchContainer(string16* error); |
| 593 bool LoadLaunchURL(string16* error); | 582 bool LoadLaunchURL(string16* error); |
| 594 | 583 |
| 595 bool LoadSharedFeatures(string16* error); | 584 bool LoadSharedFeatures(string16* error); |
| 596 bool LoadDescription(string16* error); | 585 bool LoadDescription(string16* error); |
| 597 bool LoadManifestVersion(string16* error); | 586 bool LoadManifestVersion(string16* error); |
| 598 bool LoadNaClModules(string16* error); | 587 bool LoadNaClModules(string16* error); |
| 599 bool LoadSandboxedPages(string16* error); | 588 bool LoadSandboxedPages(string16* error); |
| 600 // Must be called after the "plugins" key has been parsed. | |
| 601 bool LoadRequirements(string16* error); | |
| 602 bool LoadOfflineEnabled(string16* error); | 589 bool LoadOfflineEnabled(string16* error); |
| 603 bool LoadExtensionFeatures(string16* error); | 590 bool LoadExtensionFeatures(string16* error); |
| 604 bool LoadContentScripts(string16* error); | 591 bool LoadContentScripts(string16* error); |
| 605 bool LoadBrowserAction(string16* error); | 592 bool LoadBrowserAction(string16* error); |
| 606 bool LoadSystemIndicator(string16* error); | 593 bool LoadSystemIndicator(string16* error); |
| 607 bool LoadTextToSpeechVoices(string16* error); | 594 bool LoadTextToSpeechVoices(string16* error); |
| 608 bool LoadIncognitoMode(string16* error); | 595 bool LoadIncognitoMode(string16* error); |
| 609 bool LoadManagedModeFeatures(string16* error); | 596 bool LoadManagedModeFeatures(string16* error); |
| 610 bool LoadManagedModeSites( | 597 bool LoadManagedModeSites( |
| 611 const base::DictionaryValue* content_pack_value, | 598 const base::DictionaryValue* content_pack_value, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 std::string non_localized_name_; | 653 std::string non_localized_name_; |
| 667 | 654 |
| 668 // The version of this extension's manifest. We increase the manifest | 655 // The version of this extension's manifest. We increase the manifest |
| 669 // version when making breaking changes to the extension system. | 656 // version when making breaking changes to the extension system. |
| 670 // Version 1 was the first manifest version (implied by a lack of a | 657 // Version 1 was the first manifest version (implied by a lack of a |
| 671 // manifest_version attribute in the extension's manifest). We initialize | 658 // manifest_version attribute in the extension's manifest). We initialize |
| 672 // this member variable to 0 to distinguish the "uninitialized" case from | 659 // this member variable to 0 to distinguish the "uninitialized" case from |
| 673 // the case when we know the manifest version actually is 1. | 660 // the case when we know the manifest version actually is 1. |
| 674 int manifest_version_; | 661 int manifest_version_; |
| 675 | 662 |
| 676 // The requirements declared in the manifest. | |
| 677 Requirements requirements_; | |
| 678 | |
| 679 // The absolute path to the directory the extension is stored in. | 663 // The absolute path to the directory the extension is stored in. |
| 680 base::FilePath path_; | 664 base::FilePath path_; |
| 681 | 665 |
| 682 // If true, a separate process will be used for the extension in incognito | 666 // If true, a separate process will be used for the extension in incognito |
| 683 // mode. | 667 // mode. |
| 684 bool incognito_split_mode_; | 668 bool incognito_split_mode_; |
| 685 | 669 |
| 686 // Whether the extension or app should be enabled when offline. | 670 // Whether the extension or app should be enabled when offline. |
| 687 bool offline_enabled_; | 671 bool offline_enabled_; |
| 688 | 672 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 | 834 |
| 851 UpdatedExtensionPermissionsInfo( | 835 UpdatedExtensionPermissionsInfo( |
| 852 const Extension* extension, | 836 const Extension* extension, |
| 853 const PermissionSet* permissions, | 837 const PermissionSet* permissions, |
| 854 Reason reason); | 838 Reason reason); |
| 855 }; | 839 }; |
| 856 | 840 |
| 857 } // namespace extensions | 841 } // namespace extensions |
| 858 | 842 |
| 859 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 843 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |