OLD | NEW |
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_downloader.h" | 5 #include "chrome/browser/manifest/manifest_icon_downloader.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include <limits> | 9 #include <limits> |
8 | 10 |
9 #include "chrome/browser/manifest/manifest_icon_selector.h" | 11 #include "chrome/browser/manifest/manifest_icon_selector.h" |
10 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
11 #include "content/public/browser/render_frame_host.h" | 13 #include "content/public/browser/render_frame_host.h" |
12 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
13 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
14 #include "content/public/common/console_message_level.h" | 16 #include "content/public/common/console_message_level.h" |
15 #include "skia/ext/image_operations.h" | 17 #include "skia/ext/image_operations.h" |
16 #include "ui/gfx/screen.h" | 18 #include "ui/gfx/screen.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 float ratio = height / width; | 196 float ratio = height / width; |
195 float ratio_difference = fabs(ratio - 1); | 197 float ratio_difference = fabs(ratio - 1); |
196 if (ratio_difference < best_ratio_difference) { | 198 if (ratio_difference < best_ratio_difference) { |
197 best_index = i; | 199 best_index = i; |
198 best_ratio_difference = ratio_difference; | 200 best_ratio_difference = ratio_difference; |
199 } | 201 } |
200 } | 202 } |
201 | 203 |
202 return best_index; | 204 return best_index; |
203 } | 205 } |
OLD | NEW |