Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: chrome/browser/favicon/favicon_handler.cc

Issue 10832128: Convert FaviconStatus::bitmap from SkBitmap to gfx::Image. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests? Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698