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.
5 #ifndef CHROME_COMMON_EXTENSIONS_CHROME_MANIFEST_URL_HANDLERS_H_
6 #define CHROME_COMMON_EXTENSIONS_CHROME_MANIFEST_URL_HANDLERS_H_
10 #include "extensions/common/extension.h"
11 #include "extensions/common/manifest_handler.h"
13 // Chrome-specific extension manifest URL handlers.
16 class DictionaryValue
;
19 namespace extensions
{
21 namespace chrome_manifest_urls
{
22 const GURL
& GetDevToolsPage(const Extension
* extension
);
25 // Stores Chrome URL overrides specified in extensions manifests.
26 struct URLOverrides
: public Extension::ManifestData
{
27 typedef std::map
<const std::string
, GURL
> URLOverrideMap
;
30 ~URLOverrides() override
;
32 static const URLOverrideMap
& GetChromeURLOverrides(
33 const Extension
* extension
);
35 // A map of chrome:// hostnames (newtab, downloads, etc.) to Extension URLs
36 // which override the handling of those URLs. (see ExtensionOverrideUI).
37 URLOverrideMap chrome_url_overrides_
;
40 // Parses the "devtools_page" manifest key.
41 class DevToolsPageHandler
: public ManifestHandler
{
43 DevToolsPageHandler();
44 ~DevToolsPageHandler() override
;
46 bool Parse(Extension
* extension
, base::string16
* error
) override
;
49 const std::vector
<std::string
> Keys() const override
;
51 DISALLOW_COPY_AND_ASSIGN(DevToolsPageHandler
);
54 // Parses the "chrome_url_overrides" manifest key.
55 class URLOverridesHandler
: public ManifestHandler
{
57 URLOverridesHandler();
58 ~URLOverridesHandler() override
;
60 bool Parse(Extension
* extension
, base::string16
* error
) override
;
63 const std::vector
<std::string
> Keys() const override
;
65 DISALLOW_COPY_AND_ASSIGN(URLOverridesHandler
);
68 } // namespace extensions
70 #endif // CHROME_COMMON_EXTENSIONS_CHROME_MANIFEST_URL_HANDLERS_H_