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

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 #if !defined(IOS)
106 DCHECK_EQ(page_url, GetActiveURL());
107 // On iOS the active URL can change in between calls to FetchFavicon(). For
108 // instance, FetchFavicon() is not synchronously called when the active URL
109 // changes as a result of CRWSessionController::goToEntry().
110 // TODO(stuartmorgan): Enable the DCHECK on iOS once favicon fetches occur
111 // synchronously after active URL changes on iOS.
112 #endif
113 if (page_url != GetActiveURL())
sky 2015/09/16 15:14:24 Shouldn't this be an a #else?
pkotwicz 2015/09/16 15:17:56 I still check this on non-IOS in the case that Fav
stuartmorgan 2015/09/16 18:35:58 It's explicitly against Chromium's style guide.
pkotwicz 2015/09/16 18:47:57 Fixed now. You are right it is specifically mentio
114 return;
115
104 if (is_active_favicon) { 116 if (is_active_favicon) {
105 bool icon_url_changed = GetActiveFaviconURL() != icon_url; 117 bool icon_url_changed = GetActiveFaviconURL() != icon_url;
106 // No matter what happens, we need to mark the favicon as being set. 118 // No matter what happens, we need to mark the favicon as being set.
107 SetActiveFaviconValidity(true); 119 SetActiveFaviconValidity(true);
108 SetActiveFaviconURL(icon_url); 120 SetActiveFaviconURL(icon_url);
109 121
110 if (image.IsEmpty()) 122 if (image.IsEmpty())
111 return; 123 return;
112 124
113 SetActiveFaviconImage(image); 125 SetActiveFaviconImage(image);
(...skipping 20 matching lines...) Expand all
134 void FaviconDriverImpl::SetFaviconOutOfDateForPage(const GURL& url, 146 void FaviconDriverImpl::SetFaviconOutOfDateForPage(const GURL& url,
135 bool force_reload) { 147 bool force_reload) {
136 if (favicon_service_) { 148 if (favicon_service_) {
137 favicon_service_->SetFaviconOutOfDateForPage(url); 149 favicon_service_->SetFaviconOutOfDateForPage(url);
138 if (force_reload) 150 if (force_reload)
139 favicon_service_->ClearUnableToDownloadFavicons(); 151 favicon_service_->ClearUnableToDownloadFavicons();
140 } 152 }
141 } 153 }
142 154
143 void FaviconDriverImpl::OnUpdateFaviconURL( 155 void FaviconDriverImpl::OnUpdateFaviconURL(
156 const GURL& page_url,
144 const std::vector<FaviconURL>& candidates) { 157 const std::vector<FaviconURL>& candidates) {
145 DCHECK(!candidates.empty()); 158 DCHECK(!candidates.empty());
146 favicon_handler_->OnUpdateFaviconURL(candidates); 159 favicon_handler_->OnUpdateFaviconURL(page_url, candidates);
147 if (touch_icon_handler_.get()) 160 if (touch_icon_handler_.get())
148 touch_icon_handler_->OnUpdateFaviconURL(candidates); 161 touch_icon_handler_->OnUpdateFaviconURL(page_url, candidates);
149 if (large_icon_handler_.get()) 162 if (large_icon_handler_.get())
150 large_icon_handler_->OnUpdateFaviconURL(candidates); 163 large_icon_handler_->OnUpdateFaviconURL(page_url, candidates);
151 } 164 }
152 165
153 } // namespace favicon 166 } // 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