Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(905)

Side by Side Diff: chrome/common/extensions/extension.h

Issue 12042096: Move page action manifest parsing out of Extension; the first multi-key manifest handler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 // Base64-encoded version of the key used to sign this extension. 494 // Base64-encoded version of the key used to sign this extension.
495 // In pseudocode, returns 495 // In pseudocode, returns
496 // base::Base64Encode(RSAPrivateKey(pem_file).ExportPublicKey()). 496 // base::Base64Encode(RSAPrivateKey(pem_file).ExportPublicKey()).
497 const std::string& public_key() const { return public_key_; } 497 const std::string& public_key() const { return public_key_; }
498 const std::string& description() const { return description_; } 498 const std::string& description() const { return description_; }
499 int manifest_version() const { return manifest_version_; } 499 int manifest_version() const { return manifest_version_; }
500 bool converted_from_user_script() const { 500 bool converted_from_user_script() const {
501 return converted_from_user_script_; 501 return converted_from_user_script_;
502 } 502 }
503 const UserScriptList& content_scripts() const { return content_scripts_; } 503 const UserScriptList& content_scripts() const { return content_scripts_; }
504 const ActionInfo* page_action_info() const { return page_action_info_.get(); }
505 const ActionInfo* system_indicator_info() const { 504 const ActionInfo* system_indicator_info() const {
506 return system_indicator_info_.get(); 505 return system_indicator_info_.get();
507 } 506 }
508 const std::vector<PluginInfo>& plugins() const { return plugins_; } 507 const std::vector<PluginInfo>& plugins() const { return plugins_; }
509 const std::vector<NaClModuleInfo>& nacl_modules() const { 508 const std::vector<NaClModuleInfo>& nacl_modules() const {
510 return nacl_modules_; 509 return nacl_modules_;
511 } 510 }
512 bool has_background_page() const { 511 bool has_background_page() const {
513 return background_url_.is_valid() || !background_scripts_.empty(); 512 return background_url_.is_valid() || !background_scripts_.empty();
514 } 513 }
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 string16* error); 678 string16* error);
680 bool LoadBackgroundPersistent( 679 bool LoadBackgroundPersistent(
681 const APIPermissionSet& api_permissions, 680 const APIPermissionSet& api_permissions,
682 string16* error); 681 string16* error);
683 bool LoadBackgroundAllowJSAccess( 682 bool LoadBackgroundAllowJSAccess(
684 const APIPermissionSet& api_permissions, 683 const APIPermissionSet& api_permissions,
685 string16* error); 684 string16* error);
686 bool LoadExtensionFeatures(APIPermissionSet* api_permissions, 685 bool LoadExtensionFeatures(APIPermissionSet* api_permissions,
687 string16* error); 686 string16* error);
688 bool LoadContentScripts(string16* error); 687 bool LoadContentScripts(string16* error);
689 bool LoadPageAction(string16* error);
690 bool LoadBrowserAction(string16* error); 688 bool LoadBrowserAction(string16* error);
691 bool LoadSystemIndicator(APIPermissionSet* api_permissions, string16* error); 689 bool LoadSystemIndicator(APIPermissionSet* api_permissions, string16* error);
692 bool LoadTextToSpeechVoices(string16* error); 690 bool LoadTextToSpeechVoices(string16* error);
693 bool LoadIncognitoMode(string16* error); 691 bool LoadIncognitoMode(string16* error);
694 bool LoadContentSecurityPolicy(string16* error); 692 bool LoadContentSecurityPolicy(string16* error);
695 bool LoadManagedModeFeatures(string16* error); 693 bool LoadManagedModeFeatures(string16* error);
696 bool LoadManagedModeSites( 694 bool LoadManagedModeSites(
697 const base::DictionaryValue* content_pack_value, 695 const base::DictionaryValue* content_pack_value,
698 string16* error); 696 string16* error);
699 bool LoadManagedModeConfigurations( 697 bool LoadManagedModeConfigurations(
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 // An optional longer description of the extension. 798 // An optional longer description of the extension.
801 std::string description_; 799 std::string description_;
802 800
803 // True if the extension was generated from a user script. (We show slightly 801 // True if the extension was generated from a user script. (We show slightly
804 // different UI if so). 802 // different UI if so).
805 bool converted_from_user_script_; 803 bool converted_from_user_script_;
806 804
807 // Paths to the content scripts the extension contains. 805 // Paths to the content scripts the extension contains.
808 UserScriptList content_scripts_; 806 UserScriptList content_scripts_;
809 807
810 // The extension's page action, if any.
811 scoped_ptr<ActionInfo> page_action_info_;
812
813 // The extension's system indicator, if any. 808 // The extension's system indicator, if any.
814 scoped_ptr<ActionInfo> system_indicator_info_; 809 scoped_ptr<ActionInfo> system_indicator_info_;
815 810
816 // Optional list of NPAPI plugins and associated properties. 811 // Optional list of NPAPI plugins and associated properties.
817 std::vector<PluginInfo> plugins_; 812 std::vector<PluginInfo> plugins_;
818 813
819 // Optional list of NaCl modules and associated properties. 814 // Optional list of NaCl modules and associated properties.
820 std::vector<NaClModuleInfo> nacl_modules_; 815 std::vector<NaClModuleInfo> nacl_modules_;
821 816
822 // Optional list of extension pages that are sandboxed (served from a unique 817 // Optional list of extension pages that are sandboxed (served from a unique
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 bool wants_file_access_; 895 bool wants_file_access_;
901 896
902 // The flags that were passed to InitFromValue. 897 // The flags that were passed to InitFromValue.
903 int creation_flags_; 898 int creation_flags_;
904 899
905 // The Content-Security-Policy for this extension. Extensions can use 900 // The Content-Security-Policy for this extension. Extensions can use
906 // Content-Security-Policies to mitigate cross-site scripting and other 901 // Content-Security-Policies to mitigate cross-site scripting and other
907 // vulnerabilities. 902 // vulnerabilities.
908 std::string content_security_policy_; 903 std::string content_security_policy_;
909 904
910 FRIEND_TEST_ALL_PREFIXES(ExtensionTest, LoadPageActionHelper);
911 FRIEND_TEST_ALL_PREFIXES(::TabStripModelTest, Apps); 905 FRIEND_TEST_ALL_PREFIXES(::TabStripModelTest, Apps);
912 906
913 DISALLOW_COPY_AND_ASSIGN(Extension); 907 DISALLOW_COPY_AND_ASSIGN(Extension);
914 }; 908 };
915 909
916 typedef std::vector<scoped_refptr<const Extension> > ExtensionList; 910 typedef std::vector<scoped_refptr<const Extension> > ExtensionList;
917 typedef std::set<std::string> ExtensionIdSet; 911 typedef std::set<std::string> ExtensionIdSet;
918 typedef std::vector<std::string> ExtensionIdList; 912 typedef std::vector<std::string> ExtensionIdList;
919 913
920 // Handy struct to pass core extension info around. 914 // Handy struct to pass core extension info around.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 961
968 UpdatedExtensionPermissionsInfo( 962 UpdatedExtensionPermissionsInfo(
969 const Extension* extension, 963 const Extension* extension,
970 const PermissionSet* permissions, 964 const PermissionSet* permissions,
971 Reason reason); 965 Reason reason);
972 }; 966 };
973 967
974 } // namespace extensions 968 } // namespace extensions
975 969
976 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 970 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/omnibox/omnibox_handler.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698