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

Side by Side Diff: content/browser/manifest/manifest_icon_selector.cc

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 #include "chrome/browser/manifest/manifest_icon_selector.h"
6
7 #include <limits> 5 #include <limits>
8 6
9 #include "base/stl_util.h" 7 #include "base/stl_util.h"
10 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
11 #include "components/mime_util/mime_util.h" 9 #include "components/mime_util/mime_util.h"
10 #include "content/public/browser/manifest_icon_selector.h"
please use gerrit instead 2017/06/12 23:57:22 Should be on top.
zino 2017/06/13 16:07:45 Done.
12 11
12 namespace content {
please use gerrit instead 2017/06/12 23:57:22 Newline below.
zino 2017/06/13 16:07:44 Done.
13 // static 13 // static
14 GURL ManifestIconSelector::FindBestMatchingIcon( 14 GURL ManifestIconSelector::FindBestMatchingIcon(
15 const std::vector<content::Manifest::Icon>& icons, 15 const std::vector<content::Manifest::Icon>& icons,
16 int ideal_icon_size_in_px, 16 int ideal_icon_size_in_px,
17 int minimum_icon_size_in_px, 17 int minimum_icon_size_in_px,
18 content::Manifest::Icon::IconPurpose purpose) { 18 content::Manifest::Icon::IconPurpose purpose) {
19 DCHECK(minimum_icon_size_in_px <= ideal_icon_size_in_px); 19 DCHECK(minimum_icon_size_in_px <= ideal_icon_size_in_px);
20 20
21 // Icon with exact matching size has priority over icon with size "any", which 21 // Icon with exact matching size has priority over icon with size "any", which
22 // has priority over icon with closest matching size. 22 // has priority over icon with closest matching size.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 } 74 }
75 75
76 if (latest_size_any_index != -1) 76 if (latest_size_any_index != -1)
77 return icons[latest_size_any_index].src; 77 return icons[latest_size_any_index].src;
78 else if (closest_size_match_index != -1) 78 else if (closest_size_match_index != -1)
79 return icons[closest_size_match_index].src; 79 return icons[closest_size_match_index].src;
80 else 80 else
81 return GURL(); 81 return GURL();
82 } 82 }
83 }
please use gerrit instead 2017/06/12 23:57:22 Newline above. // namespace content
zino 2017/06/13 16:07:44 Done.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698