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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 url, scale_factors[i])); | 541 url, scale_factors[i])); |
542 if (bitmap.get() && bitmap->size()) { | 542 if (bitmap.get() && bitmap->size()) { |
543 chrome::FaviconBitmapResult bitmap_result; | 543 chrome::FaviconBitmapResult bitmap_result; |
544 bitmap_result.bitmap_data = bitmap; | 544 bitmap_result.bitmap_data = bitmap; |
545 // Leave |bitmap_result|'s icon URL as the default of GURL(). | 545 // Leave |bitmap_result|'s icon URL as the default of GURL(). |
546 bitmap_result.icon_type = chrome::FAVICON; | 546 bitmap_result.icon_type = chrome::FAVICON; |
547 favicon_bitmap_results->push_back(bitmap_result); | 547 favicon_bitmap_results->push_back(bitmap_result); |
548 | 548 |
549 // Assume that |bitmap| is |gfx::kFaviconSize| x |gfx::kFaviconSize| | 549 // Assume that |bitmap| is |gfx::kFaviconSize| x |gfx::kFaviconSize| |
550 // DIP. | 550 // DIP. |
551 float scale = ui::GetScaleFactorScale(scale_factors[i]); | 551 float scale = ui::GetImageScale(scale_factors[i]); |
552 int edge_pixel_size = | 552 int edge_pixel_size = |
553 static_cast<int>(gfx::kFaviconSize * scale + 0.5f); | 553 static_cast<int>(gfx::kFaviconSize * scale + 0.5f); |
554 bitmap_result.pixel_size = gfx::Size(edge_pixel_size, edge_pixel_size); | 554 bitmap_result.pixel_size = gfx::Size(edge_pixel_size, edge_pixel_size); |
555 } | 555 } |
556 } | 556 } |
557 | 557 |
558 RunFaviconCallbackAsync(callback, favicon_bitmap_results); | 558 RunFaviconCallbackAsync(callback, favicon_bitmap_results); |
559 } | 559 } |
560 | 560 |
561 // static | 561 // static |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 if (page_url.host() == chrome::kChromeUIPluginsHost) | 629 if (page_url.host() == chrome::kChromeUIPluginsHost) |
630 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 630 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
631 | 631 |
632 // Android doesn't use the components pages. | 632 // Android doesn't use the components pages. |
633 if (page_url.host() == chrome::kChromeUIComponentsHost) | 633 if (page_url.host() == chrome::kChromeUIComponentsHost) |
634 return ComponentsUI::GetFaviconResourceBytes(scale_factor); | 634 return ComponentsUI::GetFaviconResourceBytes(scale_factor); |
635 #endif | 635 #endif |
636 | 636 |
637 return NULL; | 637 return NULL; |
638 } | 638 } |
OLD | NEW |