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

Side by Side Diff: chrome/common/extensions/manifest_handlers/icons_handler.h

Issue 229813002: Move extensions manifest IconsHandler to //extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments (icons-handler) Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_ICONS_HANDLER_H_
6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_ICONS_HANDLER_H_
7
8 #include <string>
9
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"
14
15 namespace extensions {
16
17 struct IconsInfo : public Extension::ManifestData {
18 // Max size (both dimensions) for browser and page actions.
19 static const int kPageActionIconMaxSize;
20 static const int kBrowserActionIconMaxSize;
21
22 // The icons for the extension.
23 ExtensionIconSet icons;
24
25 // Return the icon set for the given |extension|.
26 static const ExtensionIconSet& GetIcons(const Extension* extension);
27
28 // Returns the default extension/app icon (for extensions or apps that don't
29 // have one).
30 static const gfx::ImageSkia& GetDefaultExtensionIcon();
31 static const gfx::ImageSkia& GetDefaultAppIcon();
32
33 // Get an extension icon as a resource or URL.
34 static ExtensionResource GetIconResource(
35 const Extension* extension,
36 int size,
37 ExtensionIconSet::MatchType match_type);
38 static GURL GetIconURL(const Extension* extension,
39 int size,
40 ExtensionIconSet::MatchType match_type);
41 };
42
43 // Parses the "icons" manifest key.
44 class IconsHandler : public ManifestHandler {
45 public:
46 IconsHandler();
47 virtual ~IconsHandler();
48
49 virtual bool Parse(Extension* extension, base::string16* error) OVERRIDE;
50 virtual bool Validate(const Extension* extension,
51 std::string* error,
52 std::vector<InstallWarning>* warnings) const OVERRIDE;
53
54 private:
55 virtual const std::vector<std::string> Keys() const OVERRIDE;
56 };
57
58 } // namespace extensions
59
60 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_ICONS_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_file_util.cc ('k') | chrome/common/extensions/manifest_handlers/icons_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698