Chromium Code Reviews| 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..fffa00458e0d355bc9a2ea46af46204c1ee1df63 |
| --- /dev/null |
| +++ b/chrome/common/extensions/manifest_url_handler.h |
| @@ -0,0 +1,59 @@ |
| +// 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 { |
| + |
| +struct ManifestURL : public Extension::ManifestData { |
|
Yoyo Zhou
2013/01/03 22:55:33
Class needs a descriptive comment.
Joe Thomas
2013/01/04 00:34:59
Done.
|
| + |
| + // The URL to one of the following: |
|
Yoyo Zhou
2013/01/03 22:55:33
This comment isn't necessary - it'll be redundant
Joe Thomas
2013/01/04 00:34:59
Done.
|
| + // - The extension's devtools page (optional). |
| + // - The extension's homepage, which is useful if it is not hosted by Google |
| + // and therefore doesn't have a Gallery URL. |
| + // - The extension's update url, for fetching an update manifest (optional). |
| + // - The extension's options page, for setting options/preferences (optional). |
| + 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_ |