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

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

Issue 1272413002: Remove useless FaviconHandler::PageChangedSinceFaviconWasRequested() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_driver_impl.h" 5 #include "components/favicon/core/favicon_driver_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 if (large_icon_handler_.get()) { 91 if (large_icon_handler_.get()) {
92 large_icon_handler_->OnDidDownloadFavicon(id, image_url, bitmaps, 92 large_icon_handler_->OnDidDownloadFavicon(id, image_url, bitmaps,
93 original_bitmap_sizes); 93 original_bitmap_sizes);
94 } 94 }
95 } 95 }
96 96
97 bool FaviconDriverImpl::IsBookmarked(const GURL& url) { 97 bool FaviconDriverImpl::IsBookmarked(const GURL& url) {
98 return bookmark_model_ && bookmark_model_->IsBookmarked(url); 98 return bookmark_model_ && bookmark_model_->IsBookmarked(url);
99 } 99 }
100 100
101 void FaviconDriverImpl::OnFaviconAvailable(const gfx::Image& image, 101 void FaviconDriverImpl::OnFaviconAvailable(const GURL& page_url,
102 const GURL& icon_url, 102 const GURL& icon_url,
103 const gfx::Image& image,
103 bool is_active_favicon) { 104 bool is_active_favicon) {
105 // Check whether the active URL has changed since FetchFavicon() was called.
106 // On iOS only, the active URL can change between calls to FetchFavicon().
107 // For instance, FetchFavicon() is not synchronously called when the active
108 // URL changes as a result of CRWSessionController::goToEntry().
109 if (page_url != GetActiveURL())
110 return;
111
104 if (is_active_favicon) { 112 if (is_active_favicon) {
105 bool icon_url_changed = GetActiveFaviconURL() != icon_url; 113 bool icon_url_changed = GetActiveFaviconURL() != icon_url;
106 // No matter what happens, we need to mark the favicon as being set. 114 // No matter what happens, we need to mark the favicon as being set.
107 SetActiveFaviconValidity(true); 115 SetActiveFaviconValidity(true);
108 SetActiveFaviconURL(icon_url); 116 SetActiveFaviconURL(icon_url);
109 117
110 if (image.IsEmpty()) 118 if (image.IsEmpty())
111 return; 119 return;
112 120
113 SetActiveFaviconImage(image); 121 SetActiveFaviconImage(image);
(...skipping 20 matching lines...) Expand all
134 void FaviconDriverImpl::SetFaviconOutOfDateForPage(const GURL& url, 142 void FaviconDriverImpl::SetFaviconOutOfDateForPage(const GURL& url,
135 bool force_reload) { 143 bool force_reload) {
136 if (favicon_service_) { 144 if (favicon_service_) {
137 favicon_service_->SetFaviconOutOfDateForPage(url); 145 favicon_service_->SetFaviconOutOfDateForPage(url);
138 if (force_reload) 146 if (force_reload)
139 favicon_service_->ClearUnableToDownloadFavicons(); 147 favicon_service_->ClearUnableToDownloadFavicons();
140 } 148 }
141 } 149 }
142 150
143 void FaviconDriverImpl::OnUpdateFaviconURL( 151 void FaviconDriverImpl::OnUpdateFaviconURL(
152 const GURL& page_url,
144 const std::vector<FaviconURL>& candidates) { 153 const std::vector<FaviconURL>& candidates) {
145 DCHECK(!candidates.empty()); 154 DCHECK(!candidates.empty());
146 favicon_handler_->OnUpdateFaviconURL(candidates); 155 favicon_handler_->OnUpdateFaviconURL(page_url, candidates);
147 if (touch_icon_handler_.get()) 156 if (touch_icon_handler_.get())
148 touch_icon_handler_->OnUpdateFaviconURL(candidates); 157 touch_icon_handler_->OnUpdateFaviconURL(page_url, candidates);
149 if (large_icon_handler_.get()) 158 if (large_icon_handler_.get())
150 large_icon_handler_->OnUpdateFaviconURL(candidates); 159 large_icon_handler_->OnUpdateFaviconURL(page_url, candidates);
151 } 160 }
152 161
153 } // namespace favicon 162 } // namespace favicon
OLDNEW
« no previous file with comments | « components/favicon/core/favicon_driver_impl.h ('k') | components/favicon/core/favicon_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698