OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/favicon/favicon_util.h" | 5 #include "chrome/browser/favicon/favicon_util.h" |
6 | 6 |
7 #include "chrome/browser/history/history_types.h" | 7 #include "chrome/browser/history/history_types.h" |
8 #include "chrome/browser/history/select_favicon_frames.h" | 8 #include "chrome/browser/history/select_favicon_frames.h" |
9 #include "chrome/common/icon_messages.h" | |
10 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
11 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
12 #include "ui/gfx/codec/png_codec.h" | 11 #include "ui/gfx/codec/png_codec.h" |
13 #include "ui/gfx/image/image_skia.h" | 12 #include "ui/gfx/image/image_skia.h" |
14 | 13 |
15 // static | 14 // static |
16 std::vector<ui::ScaleFactor> FaviconUtil::GetFaviconScaleFactors() { | 15 std::vector<ui::ScaleFactor> FaviconUtil::GetFaviconScaleFactors() { |
17 const float kScale1x = ui::GetScaleFactorScale(ui::SCALE_FACTOR_100P); | 16 const float kScale1x = ui::GetScaleFactorScale(ui::SCALE_FACTOR_100P); |
18 std::vector<ui::ScaleFactor> favicon_scale_factors = | 17 std::vector<ui::ScaleFactor> favicon_scale_factors = |
19 ui::GetSupportedScaleFactors(); | 18 ui::GetSupportedScaleFactors(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 int desired_size) { | 68 int desired_size) { |
70 std::vector<gfx::Size> sizes; | 69 std::vector<gfx::Size> sizes; |
71 for (size_t i = 0; i < bitmaps.size(); ++i) | 70 for (size_t i = 0; i < bitmaps.size(); ++i) |
72 sizes.push_back(gfx::Size(bitmaps[i].width(), bitmaps[i].height())); | 71 sizes.push_back(gfx::Size(bitmaps[i].width(), bitmaps[i].height())); |
73 std::vector<size_t> selected_bitmap_indices; | 72 std::vector<size_t> selected_bitmap_indices; |
74 SelectFaviconFrameIndices(sizes, scale_factors, desired_size, | 73 SelectFaviconFrameIndices(sizes, scale_factors, desired_size, |
75 &selected_bitmap_indices, NULL); | 74 &selected_bitmap_indices, NULL); |
76 DCHECK_EQ(1u, selected_bitmap_indices.size()); | 75 DCHECK_EQ(1u, selected_bitmap_indices.size()); |
77 return selected_bitmap_indices[0]; | 76 return selected_bitmap_indices[0]; |
78 } | 77 } |
OLD | NEW |