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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 url, scale_factors[i])); | 534 url, scale_factors[i])); |
535 if (bitmap.get() && bitmap->size()) { | 535 if (bitmap.get() && bitmap->size()) { |
536 chrome::FaviconBitmapResult bitmap_result; | 536 chrome::FaviconBitmapResult bitmap_result; |
537 bitmap_result.bitmap_data = bitmap; | 537 bitmap_result.bitmap_data = bitmap; |
538 // Leave |bitmap_result|'s icon URL as the default of GURL(). | 538 // Leave |bitmap_result|'s icon URL as the default of GURL(). |
539 bitmap_result.icon_type = chrome::FAVICON; | 539 bitmap_result.icon_type = chrome::FAVICON; |
540 favicon_bitmap_results->push_back(bitmap_result); | 540 favicon_bitmap_results->push_back(bitmap_result); |
541 | 541 |
542 // Assume that |bitmap| is |gfx::kFaviconSize| x |gfx::kFaviconSize| | 542 // Assume that |bitmap| is |gfx::kFaviconSize| x |gfx::kFaviconSize| |
543 // DIP. | 543 // DIP. |
544 float scale = ui::GetScaleFactorScale(scale_factors[i]); | 544 float scale = ui::GetImageScale(scale_factors[i]); |
545 int edge_pixel_size = | 545 int edge_pixel_size = |
546 static_cast<int>(gfx::kFaviconSize * scale + 0.5f); | 546 static_cast<int>(gfx::kFaviconSize * scale + 0.5f); |
547 bitmap_result.pixel_size = gfx::Size(edge_pixel_size, edge_pixel_size); | 547 bitmap_result.pixel_size = gfx::Size(edge_pixel_size, edge_pixel_size); |
548 } | 548 } |
549 } | 549 } |
550 | 550 |
551 RunFaviconCallbackAsync(callback, favicon_bitmap_results); | 551 RunFaviconCallbackAsync(callback, favicon_bitmap_results); |
552 } | 552 } |
553 | 553 |
554 // static | 554 // static |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 if (page_url.host() == chrome::kChromeUIPluginsHost) | 622 if (page_url.host() == chrome::kChromeUIPluginsHost) |
623 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 623 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
624 | 624 |
625 // Android doesn't use the components pages. | 625 // Android doesn't use the components pages. |
626 if (page_url.host() == chrome::kChromeUIComponentsHost) | 626 if (page_url.host() == chrome::kChromeUIComponentsHost) |
627 return ComponentsUI::GetFaviconResourceBytes(scale_factor); | 627 return ComponentsUI::GetFaviconResourceBytes(scale_factor); |
628 #endif | 628 #endif |
629 | 629 |
630 return NULL; | 630 return NULL; |
631 } | 631 } |
OLD | NEW |