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

Unified Diff: chrome/common/extensions/manifest_url_handler.h

Issue 11624036: Move the parsing of homepage_url" and "devtools_page" out of Extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
new file mode 100644
index 0000000000000000000000000000000000000000..07484a701164e8e6daff292691d0ed4d269b9e67
--- /dev/null
+++ b/chrome/common/extensions/manifest_url_handler.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_COMMON_EXTENSIONS_MANIFEST_URL_HANDLER_H_
+#define CHROME_COMMON_EXTENSIONS_MANIFEST_URL_HANDLER_H_
+
+#include <string>
+
+#include "chrome/common/extensions/extension.h"
+#include "chrome/common/extensions/manifest_handler.h"
+
+namespace extensions {
+
+// A structure to hold various URLs(devtools_page, homepage_url, etc)
Yoyo Zhou 2013/01/04 00:39:04 You can just delete this parenthetical. (But in th
+// that may be specified in the manifest of an extension.
+struct ManifestURL : public Extension::ManifestData {
+ GURL url_;
+
+ // Returns the DevTools Page for this extension.
+ static const GURL& GetDevToolsPage(const Extension* extension);
+
+ // Returns the Homepage URL for this extension.
+ // If homepage_url was not specified in the manifest,
+ // this returns the Google Gallery URL. For third-party extensions,
+ // this returns a blank GURL.
+ static const GURL GetHomepageURL(const Extension* extension);
+};
+
+// Parses the "devtools_page" manifest key.
+class DevToolsPageHandler : public ManifestHandler {
+ public:
+ DevToolsPageHandler();
+ virtual ~DevToolsPageHandler();
+
+ virtual bool Parse(const base::Value* value,
+ Extension* extension,
+ string16* error) OVERRIDE;
+};
+
+// Parses the "homepage_url" manifest key.
+class HomepageURLHandler : public ManifestHandler {
+ public:
+ HomepageURLHandler();
+ virtual ~HomepageURLHandler();
+
+ 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