1 // Copyright 2014 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 EXTENSIONS_COMMON_MANIFEST_HANDLERS_ICONS_HANDLER_H_
6 #define EXTENSIONS_COMMON_MANIFEST_HANDLERS_ICONS_HANDLER_H_
10 #include "extensions/common/extension.h"
11 #include "extensions/common/extension_icon_set.h"
12 #include "extensions/common/extension_resource.h"
13 #include "extensions/common/manifest_handler.h"
17 namespace extensions {
19 struct IconsInfo : public Extension::ManifestData {
20 // The icons for the extension.
21 ExtensionIconSet icons;
23 // Return the icon set for the given |extension|.
24 static const ExtensionIconSet& GetIcons(const Extension* extension);
26 // Get an extension icon as a resource or URL.
27 static ExtensionResource GetIconResource(
28 const Extension* extension,
30 ExtensionIconSet::MatchType match_type);
31 static GURL GetIconURL(const Extension* extension,
33 ExtensionIconSet::MatchType match_type);
36 // Parses the "icons" manifest key.
37 class IconsHandler : public ManifestHandler {
40 virtual ~IconsHandler();
42 virtual bool Parse(Extension* extension, base::string16* error) OVERRIDE;
43 virtual bool Validate(const Extension* extension,
45 std::vector<InstallWarning>* warnings) const OVERRIDE;
48 virtual const std::vector<std::string> Keys() const OVERRIDE;
51 } // namespace extensions
53 #endif // EXTENSIONS_COMMON_MANIFEST_HANDLERS_ICONS_HANDLER_H_