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

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

Issue 10886059: Clear the favicon of a tab when navigating to a url on a different host. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_tab_helper.h" 5 #include "chrome/browser/favicon/favicon_tab_helper.h"
6 6
7 #include "chrome/browser/favicon/favicon_handler.h" 7 #include "chrome/browser/favicon/favicon_handler.h"
8 #include "chrome/browser/favicon/favicon_service_factory.h" 8 #include "chrome/browser/favicon/favicon_service_factory.h"
9 #include "chrome/browser/favicon/favicon_util.h" 9 #include "chrome/browser/favicon/favicon_util.h"
10 #include "chrome/browser/favicon/select_favicon_frames.h" 10 #include "chrome/browser/favicon/select_favicon_frames.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( 169 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
170 profile_, Profile::IMPLICIT_ACCESS); 170 profile_, Profile::IMPLICIT_ACCESS);
171 if (favicon_service) 171 if (favicon_service)
172 favicon_service->SetFaviconOutOfDateForPage(url); 172 favicon_service->SetFaviconOutOfDateForPage(url);
173 } 173 }
174 } 174 }
175 175
176 void FaviconTabHelper::DidNavigateMainFrame( 176 void FaviconTabHelper::DidNavigateMainFrame(
177 const content::LoadCommittedDetails& details, 177 const content::LoadCommittedDetails& details,
178 const content::FrameNavigateParams& params) { 178 const content::FrameNavigateParams& params) {
179
180 // Reset the favicon
sky 2012/10/01 14:33:53 remove newline on 179. This comment echos what the
181 details.entry->GetFavicon() = FaviconStatus();
182
179 // Get the favicon, either from history or request it from the net. 183 // Get the favicon, either from history or request it from the net.
180 FetchFavicon(details.entry->GetURL()); 184 FetchFavicon(details.entry->GetURL());
181 } 185 }
182 186
183 bool FaviconTabHelper::OnMessageReceived(const IPC::Message& message) { 187 bool FaviconTabHelper::OnMessageReceived(const IPC::Message& message) {
184 bool message_handled = false; // Allow other handlers to receive these. 188 bool message_handled = false; // Allow other handlers to receive these.
185 IPC_BEGIN_MESSAGE_MAP(FaviconTabHelper, message) 189 IPC_BEGIN_MESSAGE_MAP(FaviconTabHelper, message)
186 IPC_MESSAGE_HANDLER(IconHostMsg_DidDownloadFavicon, OnDidDownloadFavicon) 190 IPC_MESSAGE_HANDLER(IconHostMsg_DidDownloadFavicon, OnDidDownloadFavicon)
187 IPC_MESSAGE_HANDLER(IconHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) 191 IPC_MESSAGE_HANDLER(IconHostMsg_UpdateFaviconURL, OnUpdateFaviconURL)
188 IPC_MESSAGE_UNHANDLED(message_handled = false) 192 IPC_MESSAGE_UNHANDLED(message_handled = false)
(...skipping 14 matching lines...) Expand all
203 scale_factors = ui::GetSupportedScaleFactors(); 207 scale_factors = ui::GetSupportedScaleFactors();
204 gfx::Image favicon(SelectFaviconFrames( 208 gfx::Image favicon(SelectFaviconFrames(
205 bitmaps, scale_factors, requested_size, &score)); 209 bitmaps, scale_factors, requested_size, &score));
206 favicon_handler_->OnDidDownloadFavicon( 210 favicon_handler_->OnDidDownloadFavicon(
207 id, image_url, errored, favicon, score); 211 id, image_url, errored, favicon, score);
208 if (touch_icon_handler_.get()) { 212 if (touch_icon_handler_.get()) {
209 touch_icon_handler_->OnDidDownloadFavicon( 213 touch_icon_handler_->OnDidDownloadFavicon(
210 id, image_url, errored, favicon, score); 214 id, image_url, errored, favicon, score);
211 } 215 }
212 } 216 }
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698