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

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

Issue 266053003: Remove page IDs from three WebContentsObserver APIs that don't need it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with Avi's change Created 6 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 <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 return; 363 return;
364 364
365 gfx::Image image_with_adjusted_colorspace = image; 365 gfx::Image image_with_adjusted_colorspace = image;
366 FaviconUtil::SetFaviconColorSpace(&image_with_adjusted_colorspace); 366 FaviconUtil::SetFaviconColorSpace(&image_with_adjusted_colorspace);
367 367
368 entry->GetFavicon().image = image_with_adjusted_colorspace; 368 entry->GetFavicon().image = image_with_adjusted_colorspace;
369 NotifyFaviconUpdated(icon_url_changed); 369 NotifyFaviconUpdated(icon_url_changed);
370 } 370 }
371 371
372 void FaviconHandler::OnUpdateFaviconURL( 372 void FaviconHandler::OnUpdateFaviconURL(
373 int32 page_id,
374 const std::vector<FaviconURL>& candidates) { 373 const std::vector<FaviconURL>& candidates) {
375 image_urls_.clear(); 374 image_urls_.clear();
376 best_favicon_candidate_ = FaviconCandidate(); 375 best_favicon_candidate_ = FaviconCandidate();
377 for (std::vector<FaviconURL>::const_iterator i = candidates.begin(); 376 for (std::vector<FaviconURL>::const_iterator i = candidates.begin();
378 i != candidates.end(); ++i) { 377 i != candidates.end(); ++i) {
379 if (!i->icon_url.is_empty() && (i->icon_type & icon_types_)) 378 if (!i->icon_url.is_empty() && (i->icon_type & icon_types_))
380 image_urls_.push_back(*i); 379 image_urls_.push_back(*i);
381 } 380 }
382 381
383 // TODO(davemoore) Should clear on empty url. Currently we ignore it. 382 // TODO(davemoore) Should clear on empty url. Currently we ignore it.
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 } else { 716 } else {
718 gfx::Size largest = i->icon_sizes[index]; 717 gfx::Size largest = i->icon_sizes[index];
719 i->icon_sizes.clear(); 718 i->icon_sizes.clear();
720 i->icon_sizes.push_back(largest); 719 i->icon_sizes.push_back(largest);
721 ++i; 720 ++i;
722 } 721 }
723 } 722 }
724 std::stable_sort(image_urls_.begin(), image_urls_.end(), 723 std::stable_sort(image_urls_.begin(), image_urls_.end(),
725 CompareIconSize); 724 CompareIconSize);
726 } 725 }
OLDNEW
« no previous file with comments | « chrome/browser/favicon/favicon_handler.h ('k') | chrome/browser/favicon/favicon_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698