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

Unified Diff: chrome/browser/favicon/favicon_tab_helper.cc

Issue 11198007: Clear the favicon of a tab when navigating to a url on a different host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Prevent theoretical negative interaction with BackForwardMenuModel 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | chrome/browser/favicon/favicon_tab_helper_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/favicon/favicon_tab_helper.cc
diff --git a/chrome/browser/favicon/favicon_tab_helper.cc b/chrome/browser/favicon/favicon_tab_helper.cc
index 6525b0664ab790bab6e94c762c9dfe502ccdd61c..4ff19390e2d793c665278cb5c6aba2c5224f2f84 100644
--- a/chrome/browser/favicon/favicon_tab_helper.cc
+++ b/chrome/browser/favicon/favicon_tab_helper.cc
@@ -23,6 +23,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_ui.h"
+#include "content/public/common/frame_navigate_params.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
@@ -173,6 +174,15 @@ void FaviconTabHelper::NavigateToPendingEntry(
void FaviconTabHelper::DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) {
+
+ // The NavigationEntry may be reused from the previously navigated page in
sky 2012/10/17 16:07:34 Is the real bug that we're reusing favicons on cli
+ // the case of a client redirect. Clear the favicon as it should never be
+ // carried over from the previous page. Do not clear the favicon in the case
+ // of back and forward transitions to avoid negative interaction with the
+ // BackForwardMenuModel.
+ if ((params.transition & content::PAGE_TRANSITION_FORWARD_BACK) == 0)
+ details.entry->GetFavicon() = FaviconStatus();
+
// Get the favicon, either from history or request it from the net.
FetchFavicon(details.entry->GetURL());
}
« no previous file with comments | « AUTHORS ('k') | chrome/browser/favicon/favicon_tab_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698