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

Side by Side Diff: chrome/browser/manifest/manifest_icon_selector.h

Issue 2933743002: Move chrome/browser/manifest to content/browser. (Closed)
Patch Set: rebased Created 3 years, 6 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 2015 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_BROWSER_MANIFEST_MANIFEST_ICON_SELECTOR_H_
6 #define CHROME_BROWSER_MANIFEST_MANIFEST_ICON_SELECTOR_H_
7
8 #include "base/macros.h"
9 #include "content/public/common/manifest.h"
10 #include "url/gurl.h"
11
12 // Selects the square icon with the supported image MIME types and the specified
13 // icon purpose that most closely matches the size constraints.
14 // This follows very basic heuristics -- improvements are welcome.
15 class ManifestIconSelector {
16 public:
17 // Runs the algorithm to find the best matching icon in the icons listed in
18 // the Manifest. Size is defined in pixels.
19 //
20 // Any icon returned will be close as possible to |ideal_icon_size_in_px|
21 // with a size not less than |minimum_icon_size_in_px|. Additionally, it must
22 // be square, have supported image MIME types, and have icon purpose
23 // |purpose|.
24 //
25 // Returns the icon url if a suitable icon is found. An empty URL otherwise.
26 static GURL FindBestMatchingIcon(
27 const std::vector<content::Manifest::Icon>& icons,
28 int ideal_icon_size_in_px,
29 int minimum_icon_size_in_px,
30 content::Manifest::Icon::IconPurpose purpose);
31
32 private:
33 DISALLOW_IMPLICIT_CONSTRUCTORS(ManifestIconSelector);
34 };
35
36 #endif // CHROME_BROWSER_MANIFEST_MANIFEST_ICON_SELECTOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/manifest/manifest_icon_downloader_unittest.cc ('k') | chrome/browser/manifest/manifest_icon_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698