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

Side by Side Diff: content/public/browser/manifest_icon_selector.h

Issue 2933743002: Move chrome/browser/manifest to content/browser. (Closed)
Patch Set: Move chrome/browser/manifest to content/browser. 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_MANIFEST_MANIFEST_ICON_SELECTOR_H_ 5 #ifndef CHROME_BROWSER_MANIFEST_MANIFEST_ICON_SELECTOR_H_
please use gerrit instead 2017/06/12 23:57:22 Update the header guards.
zino 2017/06/13 16:07:45 Done.
6 #define CHROME_BROWSER_MANIFEST_MANIFEST_ICON_SELECTOR_H_ 6 #define CHROME_BROWSER_MANIFEST_MANIFEST_ICON_SELECTOR_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "content/public/common/manifest.h" 9 #include "content/public/common/manifest.h"
10 #include "url/gurl.h" 10 #include "url/gurl.h"
11 11
12 namespace content {
please use gerrit instead 2017/06/12 23:57:22 Newline below.
zino 2017/06/13 16:07:45 Done.
12 // Selects the square icon with the supported image MIME types and the specified 13 // Selects the square icon with the supported image MIME types and the specified
13 // icon purpose that most closely matches the size constraints. 14 // icon purpose that most closely matches the size constraints.
14 // This follows very basic heuristics -- improvements are welcome. 15 // This follows very basic heuristics -- improvements are welcome.
15 class ManifestIconSelector { 16 class CONTENT_EXPORT ManifestIconSelector {
16 public: 17 public:
17 // Runs the algorithm to find the best matching icon in the icons listed in 18 // Runs the algorithm to find the best matching icon in the icons listed in
18 // the Manifest. Size is defined in pixels. 19 // the Manifest. Size is defined in pixels.
19 // 20 //
20 // Any icon returned will be close as possible to |ideal_icon_size_in_px| 21 // 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 // 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 // be square, have supported image MIME types, and have icon purpose
23 // |purpose|. 24 // |purpose|.
24 // 25 //
25 // Returns the icon url if a suitable icon is found. An empty URL otherwise. 26 // Returns the icon url if a suitable icon is found. An empty URL otherwise.
26 static GURL FindBestMatchingIcon( 27 static GURL FindBestMatchingIcon(
27 const std::vector<content::Manifest::Icon>& icons, 28 const std::vector<content::Manifest::Icon>& icons,
28 int ideal_icon_size_in_px, 29 int ideal_icon_size_in_px,
29 int minimum_icon_size_in_px, 30 int minimum_icon_size_in_px,
30 content::Manifest::Icon::IconPurpose purpose); 31 content::Manifest::Icon::IconPurpose purpose);
31 32
32 private: 33 private:
33 DISALLOW_IMPLICIT_CONSTRUCTORS(ManifestIconSelector); 34 DISALLOW_IMPLICIT_CONSTRUCTORS(ManifestIconSelector);
34 }; 35 };
36 }
please use gerrit instead 2017/06/12 23:57:22 Newline above. // namespace content
zino 2017/06/13 16:07:45 Done.
35 37
36 #endif // CHROME_BROWSER_MANIFEST_MANIFEST_ICON_SELECTOR_H_ 38 #endif // CHROME_BROWSER_MANIFEST_MANIFEST_ICON_SELECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698