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

Side by Side Diff: chrome/common/extensions/api/extension_urls/extension_urls_handler.h

Issue 11742005: Move [Homepage,Options,Update,DevTools]URL out of Extension (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_unref_browser_action
Patch Set: 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
(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_API_EXTENSION_URLS_EXTENSION_URLS_HANDLER_H_
6 #define CHROME_COMMON_EXTENSIONS_API_EXTENSION_URLS_EXTENSION_URLS_HANDLER_H_
7
8 #include <string>
9
10 #include "chrome/common/extensions/extension.h"
11 #include "chrome/common/extensions/manifest_handler.h"
12 #include "googleurl/src/gurl.h"
13
14 namespace extensions {
15
16 struct ExtensionURL : public Extension::ManifestData {
17 explicit ExtensionURL(const GURL& url);
18 virtual ~ExtensionURL();
19
20 // The URL to one of the following:
21 // - The extension's devtools page (optional).
22 // - The extension's homepage, which is useful if it is not hosted by Google
23 // and therefore doesn't have a Gallery URL.
24 // - The extension's update url, for fetching an update manifest.
25 // - The extension's options page, for setting options/preferences (optional).
26 GURL url;
27
28 // Return the appropriate url for a given |extension|.
29 static const GURL& GetDevToolsURL(const Extension* extension);
30 static GURL GetHomepageURL(const Extension* extension);
31 static const GURL& GetOptionsURL(const Extension* extension);
32 static const GURL& GetUpdateURL(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 // Parses the "options_page" manifest key.
58 class OptionsPageHandler : public ManifestHandler {
59 public:
60 OptionsPageHandler();
61 virtual ~OptionsPageHandler();
62
63 virtual bool Parse(const base::Value* value,
64 Extension* extension,
65 string16* error) OVERRIDE;
66 };
67
68 // Parses the "update_url" manifest key.
69 class UpdateURLHandler : public ManifestHandler {
70 public:
71 UpdateURLHandler();
72 virtual ~UpdateURLHandler();
73
74 virtual bool Parse(const base::Value* value,
75 Extension* extension,
76 string16* error) OVERRIDE;
77 };
78
79 } // namespace extensions
80
81 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_URLS_EXTENSION_URLS_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698