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_handler.h" | 5 #include "chrome/browser/favicon/favicon_handler.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 } | 229 } |
230 | 230 |
231 void FaviconHandler::UpdateFavicon(NavigationEntry* entry, | 231 void FaviconHandler::UpdateFavicon(NavigationEntry* entry, |
232 const gfx::Image* image) { | 232 const gfx::Image* image) { |
233 // No matter what happens, we need to mark the favicon as being set. | 233 // No matter what happens, we need to mark the favicon as being set. |
234 entry->GetFavicon().valid = true; | 234 entry->GetFavicon().valid = true; |
235 | 235 |
236 if (!image) | 236 if (!image) |
237 return; | 237 return; |
238 | 238 |
239 entry->GetFavicon().bitmap = *image->ToSkBitmap(); | 239 entry->GetFavicon().image = *image; |
240 delegate_->NotifyFaviconUpdated(); | 240 delegate_->NotifyFaviconUpdated(); |
241 } | 241 } |
242 | 242 |
243 void FaviconHandler::OnUpdateFaviconURL( | 243 void FaviconHandler::OnUpdateFaviconURL( |
244 int32 page_id, | 244 int32 page_id, |
245 const std::vector<FaviconURL>& candidates) { | 245 const std::vector<FaviconURL>& candidates) { |
246 | 246 |
247 image_urls_.clear(); | 247 image_urls_.clear(); |
248 favicon_candidate_ = FaviconCandidate(); | 248 favicon_candidate_ = FaviconCandidate(); |
249 for (std::vector<FaviconURL>::const_iterator i = candidates.begin(); | 249 for (std::vector<FaviconURL>::const_iterator i = candidates.begin(); |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 int height = bitmap.height(); | 534 int height = bitmap.height(); |
535 if (width > 0 && height > 0) { | 535 if (width > 0 && height > 0) { |
536 gfx::CalculateFaviconTargetSize(&width, &height); | 536 gfx::CalculateFaviconTargetSize(&width, &height); |
537 return gfx::Image(skia::ImageOperations::Resize( | 537 return gfx::Image(skia::ImageOperations::Resize( |
538 bitmap, skia::ImageOperations::RESIZE_LANCZOS3, | 538 bitmap, skia::ImageOperations::RESIZE_LANCZOS3, |
539 width, height)); | 539 width, height)); |
540 } | 540 } |
541 | 541 |
542 return image; | 542 return image; |
543 } | 543 } |
OLD | NEW |