Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_COMMON_EXTENSIONS_MANIFEST_URL_HANDLER_H_ | |
| 6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_URL_HANDLER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "chrome/common/extensions/extension.h" | |
| 11 #include "chrome/common/extensions/manifest_handler.h" | |
| 12 | |
| 13 namespace extensions { | |
| 14 | |
| 15 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.
| |
| 16 | |
| 17 // 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.
| |
| 18 // - The extension's devtools page (optional). | |
| 19 // - The extension's homepage, which is useful if it is not hosted by Google | |
| 20 // and therefore doesn't have a Gallery URL. | |
| 21 // - The extension's update url, for fetching an update manifest (optional). | |
| 22 // - The extension's options page, for setting options/preferences (optional). | |
| 23 GURL url_; | |
| 24 | |
| 25 // Returns the DevTools Page for this extension. | |
| 26 static const GURL& GetDevToolsPage(const Extension* extension); | |
| 27 | |
| 28 // Returns the Homepage URL for this extension. | |
| 29 // If homepage_url was not specified in the manifest, | |
| 30 // this returns the Google Gallery URL. For third-party extensions, | |
| 31 // this returns a blank GURL. | |
| 32 static const GURL GetHomepageURL(const Extension* extension); | |
| 33 }; | |
| 34 | |
| 35 // Parses the "devtools_page" manifest key. | |
| 36 class DevToolsPageHandler : public ManifestHandler { | |
| 37 public: | |
| 38 DevToolsPageHandler(); | |
| 39 virtual ~DevToolsPageHandler(); | |
| 40 | |
| 41 virtual bool Parse(const base::Value* value, | |
| 42 Extension* extension, | |
| 43 string16* error) OVERRIDE; | |
| 44 }; | |
| 45 | |
| 46 // Parses the "homepage_url" manifest key. | |
| 47 class HomepageURLHandler : public ManifestHandler { | |
| 48 public: | |
| 49 HomepageURLHandler(); | |
| 50 virtual ~HomepageURLHandler(); | |
| 51 | |
| 52 virtual bool Parse(const base::Value* value, | |
| 53 Extension* extension, | |
| 54 string16* error) OVERRIDE; | |
| 55 }; | |
| 56 | |
| 57 } // namespace extensions | |
| 58 | |
| 59 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_URL_HANDLER_H_ | |
| OLD | NEW |