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/ui/webui/chrome_web_ui_controller_factory.h" | 5 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 url, scale_factors[i])); | 599 url, scale_factors[i])); |
600 if (bitmap.get() && bitmap->size()) { | 600 if (bitmap.get() && bitmap->size()) { |
601 favicon_base::FaviconBitmapResult bitmap_result; | 601 favicon_base::FaviconBitmapResult bitmap_result; |
602 bitmap_result.bitmap_data = bitmap; | 602 bitmap_result.bitmap_data = bitmap; |
603 // Leave |bitmap_result|'s icon URL as the default of GURL(). | 603 // Leave |bitmap_result|'s icon URL as the default of GURL(). |
604 bitmap_result.icon_type = favicon_base::FAVICON; | 604 bitmap_result.icon_type = favicon_base::FAVICON; |
605 favicon_bitmap_results->push_back(bitmap_result); | 605 favicon_bitmap_results->push_back(bitmap_result); |
606 | 606 |
607 // Assume that |bitmap| is |gfx::kFaviconSize| x |gfx::kFaviconSize| | 607 // Assume that |bitmap| is |gfx::kFaviconSize| x |gfx::kFaviconSize| |
608 // DIP. | 608 // DIP. |
609 float scale = ui::GetImageScale(scale_factors[i]); | 609 float scale = ui::GetScaleForScaleFactor(scale_factors[i]); |
610 int edge_pixel_size = | 610 int edge_pixel_size = |
611 static_cast<int>(gfx::kFaviconSize * scale + 0.5f); | 611 static_cast<int>(gfx::kFaviconSize * scale + 0.5f); |
612 bitmap_result.pixel_size = gfx::Size(edge_pixel_size, edge_pixel_size); | 612 bitmap_result.pixel_size = gfx::Size(edge_pixel_size, edge_pixel_size); |
613 } | 613 } |
614 } | 614 } |
615 | 615 |
616 RunFaviconCallbackAsync(callback, favicon_bitmap_results); | 616 RunFaviconCallbackAsync(callback, favicon_bitmap_results); |
617 } | 617 } |
618 | 618 |
619 // static | 619 // static |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 #endif | 687 #endif |
688 | 688 |
689 // Android doesn't use the plugins pages. | 689 // Android doesn't use the plugins pages. |
690 if (page_url.host() == chrome::kChromeUIPluginsHost) | 690 if (page_url.host() == chrome::kChromeUIPluginsHost) |
691 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 691 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
692 | 692 |
693 #endif | 693 #endif |
694 | 694 |
695 return NULL; | 695 return NULL; |
696 } | 696 } |
OLD | NEW |