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

Unified Diff: chrome/common/extensions/manifest_url_handler.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, 12 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/manifest_url_handler.h
diff --git a/chrome/common/extensions/manifest_url_handler.h b/chrome/common/extensions/manifest_url_handler.h
index aa65e77a90fb31fcf5dd76b3e1afcc2a8ebe8afa..ef7e9a57279031a8cfa81a8050f9b95d15ec56d0 100644
--- a/chrome/common/extensions/manifest_url_handler.h
+++ b/chrome/common/extensions/manifest_url_handler.h
@@ -27,6 +27,24 @@ struct ManifestURL : public Extension::ManifestData {
static const GURL GetHomepageURL(const Extension* extension);
};
+// A structure to hold the chrome URL overrides that may be specified
+// in the manifest of an extension.
+struct URLOverrides : public Extension::ManifestData {
+
Yoyo Zhou 2013/01/05 00:46:11 extraneous newline
Joe Thomas 2013/01/05 02:33:45 Removed
+ typedef std::map<const std::string, GURL> URLOverrideMap;
+
+ // Define out of line constructor/destructor to please Clang.
+ URLOverrides();
+ virtual ~URLOverrides();
+
+ static const URLOverrideMap*
+ GetChromeURLOverrides(const Extension* extension);
+
+ // A map of chrome:// hostnames (newtab, downloads, etc.) to Extension URLs
+ // which override the handling of those URLs. (see ExtensionOverrideUI).
+ URLOverrideMap chrome_url_overrides_;
+};
+
// Parses the "devtools_page" manifest key.
class DevToolsPageHandler : public ManifestHandler {
public:
@@ -49,6 +67,17 @@ class HomepageURLHandler : public ManifestHandler {
string16* error) OVERRIDE;
};
+// Parses the "chrome_url_overrides" manifest key.
+class URLOverridesHandler : public ManifestHandler {
+ public:
+ URLOverridesHandler();
+ virtual ~URLOverridesHandler();
+
+ virtual bool Parse(const base::Value* value,
+ Extension* extension,
+ string16* error) OVERRIDE;
+};
+
} // namespace extensions
#endif // CHROME_COMMON_EXTENSIONS_MANIFEST_URL_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698