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

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

Issue 10272004: Move RefCountedMemory class to base namespace. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 7 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 if (UrlMatches(url, url_) && icon_type == history::FAVICON) { 214 if (UrlMatches(url, url_) && icon_type == history::FAVICON) {
215 NavigationEntry* entry = GetEntry(); 215 NavigationEntry* entry = GetEntry();
216 if (entry) { 216 if (entry) {
217 entry->GetFavicon().url = image_url; 217 entry->GetFavicon().url = image_url;
218 UpdateFavicon(entry, &sized_image); 218 UpdateFavicon(entry, &sized_image);
219 } 219 }
220 } 220 }
221 } 221 }
222 222
223 void FaviconHandler::UpdateFavicon(NavigationEntry* entry, 223 void FaviconHandler::UpdateFavicon(NavigationEntry* entry,
224 scoped_refptr<RefCountedMemory> data) { 224 scoped_refptr<base::RefCountedMemory> data) {
225 scoped_ptr<gfx::Image> image(gfx::ImageFromPNGEncodedData(data->front(), 225 scoped_ptr<gfx::Image> image(gfx::ImageFromPNGEncodedData(data->front(),
226 data->size())); 226 data->size()));
227 UpdateFavicon(entry, image.get()); 227 UpdateFavicon(entry, image.get());
228 } 228 }
229 229
230 void FaviconHandler::UpdateFavicon(NavigationEntry* entry, 230 void FaviconHandler::UpdateFavicon(NavigationEntry* entry,
231 const gfx::Image* image) { 231 const gfx::Image* image) {
232 // No matter what happens, we need to mark the favicon as being set. 232 // No matter what happens, we need to mark the favicon as being set.
233 entry->GetFavicon().valid = true; 233 entry->GetFavicon().valid = true;
234 234
(...skipping 299 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
« no previous file with comments | « chrome/browser/favicon/favicon_handler.h ('k') | chrome/browser/history/expire_history_backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698