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

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

Issue 11660016: Move the parsing of "chrome_url_overrides" out of Extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments addressed Created 7 years, 11 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 class PermissionSet; 59 class PermissionSet;
60 60
61 typedef std::set<std::string> OAuth2Scopes; 61 typedef std::set<std::string> OAuth2Scopes;
62 62
63 // Represents a Chrome extension. 63 // Represents a Chrome extension.
64 class Extension : public base::RefCountedThreadSafe<Extension> { 64 class Extension : public base::RefCountedThreadSafe<Extension> {
65 public: 65 public:
66 struct InstallWarning; 66 struct InstallWarning;
67 struct ManifestData; 67 struct ManifestData;
68 68
69 typedef std::map<const std::string, GURL> URLOverrideMap;
70 typedef std::vector<std::string> ScriptingWhitelist; 69 typedef std::vector<std::string> ScriptingWhitelist;
71 typedef std::vector<InstallWarning> InstallWarningVector; 70 typedef std::vector<InstallWarning> InstallWarningVector;
72 typedef std::map<const std::string, linked_ptr<ManifestData> > 71 typedef std::map<const std::string, linked_ptr<ManifestData> >
73 ManifestDataMap; 72 ManifestDataMap;
74 73
75 // What an extension was loaded from. 74 // What an extension was loaded from.
76 // NOTE: These values are stored as integers in the preferences and used 75 // NOTE: These values are stored as integers in the preferences and used
77 // in histograms so don't remove or reorder existing items. Just append 76 // in histograms so don't remove or reorder existing items. Just append
78 // to the end. 77 // to the end.
79 enum Location { 78 enum Location {
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 void AddInstallWarnings(const InstallWarningVector& new_warnings); 749 void AddInstallWarnings(const InstallWarningVector& new_warnings);
751 const InstallWarningVector& install_warnings() const { 750 const InstallWarningVector& install_warnings() const {
752 return install_warnings_; 751 return install_warnings_;
753 } 752 }
754 const GURL& update_url() const { return update_url_; } 753 const GURL& update_url() const { return update_url_; }
755 const ExtensionIconSet& icons() const { return icons_; } 754 const ExtensionIconSet& icons() const { return icons_; }
756 const extensions::Manifest* manifest() const { 755 const extensions::Manifest* manifest() const {
757 return manifest_.get(); 756 return manifest_.get();
758 } 757 }
759 const std::string default_locale() const { return default_locale_; } 758 const std::string default_locale() const { return default_locale_; }
760 const URLOverrideMap& GetChromeURLOverrides() const {
761 return chrome_url_overrides_;
762 }
763 bool incognito_split_mode() const { return incognito_split_mode_; } 759 bool incognito_split_mode() const { return incognito_split_mode_; }
764 bool offline_enabled() const { return offline_enabled_; } 760 bool offline_enabled() const { return offline_enabled_; }
765 const std::vector<TtsVoice>& tts_voices() const { return tts_voices_; } 761 const std::vector<TtsVoice>& tts_voices() const { return tts_voices_; }
766 const OAuth2Info& oauth2_info() const { return oauth2_info_; } 762 const OAuth2Info& oauth2_info() const { return oauth2_info_; }
767 const std::vector<webkit_glue::WebIntentServiceData>& 763 const std::vector<webkit_glue::WebIntentServiceData>&
768 intents_services() const { 764 intents_services() const {
769 return intents_services_; 765 return intents_services_;
770 } 766 }
771 767
772 bool wants_file_access() const { return wants_file_access_; } 768 bool wants_file_access() const { return wants_file_access_; }
773 int creation_flags() const { return creation_flags_; } 769 int creation_flags() const { return creation_flags_; }
774 bool from_webstore() const { return (creation_flags_ & FROM_WEBSTORE) != 0; } 770 bool from_webstore() const { return (creation_flags_ & FROM_WEBSTORE) != 0; }
775 bool from_bookmark() const { return (creation_flags_ & FROM_BOOKMARK) != 0; } 771 bool from_bookmark() const { return (creation_flags_ & FROM_BOOKMARK) != 0; }
776 bool was_installed_by_default() const { 772 bool was_installed_by_default() const {
777 return (creation_flags_ & WAS_INSTALLED_BY_DEFAULT) != 0; 773 return (creation_flags_ & WAS_INSTALLED_BY_DEFAULT) != 0;
778 } 774 }
779 775
780 // App-related. 776 // App-related.
781 bool is_app() const { 777 bool is_app() const {
782 return is_legacy_packaged_app() || is_hosted_app() || is_platform_app(); 778 return is_legacy_packaged_app() || is_hosted_app() || is_platform_app();
783 } 779 }
784 bool is_platform_app() const; 780 bool is_platform_app() const;
785 bool is_hosted_app() const; 781 bool is_hosted_app() const;
786 bool is_legacy_packaged_app() const; 782 bool is_legacy_packaged_app() const;
787 bool is_extension() const; 783 bool is_extension() const;
788 bool is_storage_isolated() const { return is_storage_isolated_; } 784 bool is_storage_isolated() const { return is_storage_isolated_; }
789 bool can_be_incognito_enabled() const; 785 bool can_be_incognito_enabled() const;
786 void AddWebExtentPattern(const URLPattern& pattern);
790 const URLPatternSet& web_extent() const { return extent_; } 787 const URLPatternSet& web_extent() const { return extent_; }
791 const std::string& launch_local_path() const { return launch_local_path_; } 788 const std::string& launch_local_path() const { return launch_local_path_; }
792 const std::string& launch_web_url() const { return launch_web_url_; } 789 const std::string& launch_web_url() const { return launch_web_url_; }
793 extension_misc::LaunchContainer launch_container() const { 790 extension_misc::LaunchContainer launch_container() const {
794 return launch_container_; 791 return launch_container_;
795 } 792 }
796 int launch_width() const { return launch_width_; } 793 int launch_width() const { return launch_width_; }
797 int launch_height() const { return launch_height_; } 794 int launch_height() const { return launch_height_; }
798 795
799 const std::vector<FileHandlerInfo>& file_handlers() const { 796 const std::vector<FileHandlerInfo>& file_handlers() const {
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 1169
1173 // The manifest from which this extension was created. 1170 // The manifest from which this extension was created.
1174 scoped_ptr<Manifest> manifest_; 1171 scoped_ptr<Manifest> manifest_;
1175 1172
1176 // Stored parsed manifest data. 1173 // Stored parsed manifest data.
1177 ManifestDataMap manifest_data_; 1174 ManifestDataMap manifest_data_;
1178 1175
1179 // Set to true at the end of InitValue when initialization is finished. 1176 // Set to true at the end of InitValue when initialization is finished.
1180 bool finished_parsing_manifest_; 1177 bool finished_parsing_manifest_;
1181 1178
1182 // A map of chrome:// hostnames (newtab, downloads, etc.) to Extension URLs
1183 // which override the handling of those URLs. (see ExtensionOverrideUI).
1184 URLOverrideMap chrome_url_overrides_;
1185
1186 // Whether this extension requests isolated storage. 1179 // Whether this extension requests isolated storage.
1187 bool is_storage_isolated_; 1180 bool is_storage_isolated_;
1188 1181
1189 // The local path inside the extension to use with the launcher. 1182 // The local path inside the extension to use with the launcher.
1190 std::string launch_local_path_; 1183 std::string launch_local_path_;
1191 1184
1192 // A web url to use with the launcher. Note that this might be relative or 1185 // A web url to use with the launcher. Note that this might be relative or
1193 // absolute. If relative, it is relative to web_origin. 1186 // absolute. If relative, it is relative to web_origin.
1194 std::string launch_web_url_; 1187 std::string launch_web_url_;
1195 1188
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 1292
1300 UpdatedExtensionPermissionsInfo( 1293 UpdatedExtensionPermissionsInfo(
1301 const Extension* extension, 1294 const Extension* extension,
1302 const PermissionSet* permissions, 1295 const PermissionSet* permissions,
1303 Reason reason); 1296 Reason reason);
1304 }; 1297 };
1305 1298
1306 } // namespace extensions 1299 } // namespace extensions
1307 1300
1308 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 1301 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698