1 // Copyright (c) 2013 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_MANIFEST_HANDLERS_THEME_HANDLER_H_
6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_THEME_HANDLER_H_
8 #include "extensions/common/extension.h"
9 #include "extensions/common/manifest_handler.h"
12 class DictionaryValue
;
15 namespace extensions
{
17 // A structure to hold the parsed theme data.
18 struct ThemeInfo
: public Extension::ManifestData
{
19 // Define out of line constructor/destructor to please Clang.
21 ~ThemeInfo() override
;
23 static const base::DictionaryValue
* GetImages(const Extension
* extension
);
24 static const base::DictionaryValue
* GetColors(const Extension
* extension
);
25 static const base::DictionaryValue
* GetTints(const Extension
* extension
);
26 static const base::DictionaryValue
* GetDisplayProperties(
27 const Extension
* extension
);
29 // A map of resource id's to relative file paths.
30 scoped_ptr
<base::DictionaryValue
> theme_images_
;
32 // A map of color names to colors.
33 scoped_ptr
<base::DictionaryValue
> theme_colors_
;
35 // A map of color names to colors.
36 scoped_ptr
<base::DictionaryValue
> theme_tints_
;
38 // A map of display properties.
39 scoped_ptr
<base::DictionaryValue
> theme_display_properties_
;
42 // Parses the "theme" manifest key.
43 class ThemeHandler
: public ManifestHandler
{
46 ~ThemeHandler() override
;
48 bool Parse(Extension
* extension
, base::string16
* error
) override
;
49 bool Validate(const Extension
* extension
,
51 std::vector
<InstallWarning
>* warnings
) const override
;
54 const std::vector
<std::string
> Keys() const override
;
56 DISALLOW_COPY_AND_ASSIGN(ThemeHandler
);
59 } // namespace extensions
61 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_THEME_HANDLER_H_