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

Side by Side Diff: components/favicon/core/favicon_handler.cc

Issue 1399913002: Stop FaviconHandler from querying GetActiveFaviconValidity() part 2/2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@favicon_remove_validity_check
Patch Set: Created 5 years, 2 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
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 "components/favicon/core/favicon_handler.h" 5 #include "components/favicon/core/favicon_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 void FaviconHandler::OnFaviconDataForInitialURLFromFaviconService( 561 void FaviconHandler::OnFaviconDataForInitialURLFromFaviconService(
562 const std::vector<favicon_base::FaviconRawBitmapResult>& 562 const std::vector<favicon_base::FaviconRawBitmapResult>&
563 favicon_bitmap_results) { 563 favicon_bitmap_results) {
564 got_favicon_from_history_ = true; 564 got_favicon_from_history_ = true;
565 history_results_ = favicon_bitmap_results; 565 history_results_ = favicon_bitmap_results;
566 bool has_results = !favicon_bitmap_results.empty(); 566 bool has_results = !favicon_bitmap_results.empty();
567 favicon_expired_or_incomplete_ = HasExpiredOrIncompleteResult( 567 favicon_expired_or_incomplete_ = HasExpiredOrIncompleteResult(
568 preferred_icon_size(), favicon_bitmap_results); 568 preferred_icon_size(), favicon_bitmap_results);
569 bool has_valid_result = HasValidResult(favicon_bitmap_results); 569 bool has_valid_result = HasValidResult(favicon_bitmap_results);
570 570
571 if (has_results && handler_type_ == FAVICON && 571 if (has_results && handler_type_ == FAVICON && !download_largest_icon_ &&
572 !download_largest_icon_ && !driver_->GetActiveFaviconValidity() &&
573 (!current_candidate() || 572 (!current_candidate() ||
574 DoUrlsAndIconsMatch(*current_candidate(), favicon_bitmap_results))) { 573 DoUrlsAndIconsMatch(*current_candidate(), favicon_bitmap_results))) {
575 if (has_valid_result) { 574 if (has_valid_result) {
576 // The db knows the favicon (although it may be out of date) and the entry 575 // The db knows the favicon (although it may be out of date) and the entry
577 // doesn't have an icon. Set the favicon now, and if the favicon turns out 576 // doesn't have an icon. Set the favicon now, and if the favicon turns out
578 // to be expired (or the wrong url) we'll fetch later on. This way the 577 // to be expired (or the wrong url) we'll fetch later on. This way the
579 // user doesn't see a flash of the default favicon. 578 // user doesn't see a flash of the default favicon.
580 NotifyFaviconAvailable(favicon_bitmap_results); 579 NotifyFaviconAvailable(favicon_bitmap_results);
581 } else { 580 } else {
582 // If |favicon_bitmap_results| does not have any valid results, treat the 581 // If |favicon_bitmap_results| does not have any valid results, treat the
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 // If DownloadFavicon() did not start a download, it returns a download id 681 // If DownloadFavicon() did not start a download, it returns a download id
683 // of 0. We still need to call OnDidDownloadFavicon() because the method is 682 // of 0. We still need to call OnDidDownloadFavicon() because the method is
684 // responsible for initiating the data request for the next candidate. 683 // responsible for initiating the data request for the next candidate.
685 OnDidDownloadFavicon(download_id, image_url, std::vector<SkBitmap>(), 684 OnDidDownloadFavicon(download_id, image_url, std::vector<SkBitmap>(),
686 std::vector<gfx::Size>()); 685 std::vector<gfx::Size>());
687 686
688 } 687 }
689 } 688 }
690 689
691 } // namespace favicon 690 } // namespace favicon
OLDNEW
« no previous file with comments | « components/favicon/core/favicon_driver.h ('k') | components/favicon/core/favicon_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698