summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjungshik@google.com <jungshik@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-27 16:52:47 +0000
committerjungshik@google.com <jungshik@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-27 16:52:47 +0000
commitb8282e475c6be16cdb83338f3caf1dfa8841f03a (patch)
tree6d59a22f5fd3c3420d0a3497a7da363398965c34
parent93723b5339a6f238745c7445665276aa1e1f8bda (diff)
downloadchromium_src-b8282e475c6be16cdb83338f3caf1dfa8841f03a.zip
chromium_src-b8282e475c6be16cdb83338f3caf1dfa8841f03a.tar.gz
chromium_src-b8282e475c6be16cdb83338f3caf1dfa8841f03a.tar.bz2
Update contents_mime_type_ of WebContents only for the main frame. RenderView does not set the value for sub frames.
As a result, we ended up resetting to NULL by updating it for any frame. This CL should go in for both trunk and 0.3.154.x branch. BUG=2929 TEST=Open http://fund.eastmoney.com in a tab, switch to another tab and then switch back. Encoding menu should be enabled which tab you're in. Review URL: http://codereview.chromium.org/8206 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4001 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/web_contents.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/web_contents.cc b/chrome/browser/web_contents.cc
index 40c9f78..082852c 100644
--- a/chrome/browser/web_contents.cc
+++ b/chrome/browser/web_contents.cc
@@ -688,9 +688,13 @@ void WebContents::DidNavigate(RenderViewHost* rvh,
// Need to update MIME type here because it's referred to in
// UpdateNavigationCommands() called by RendererDidNavigate() to
// determine whether or not to enable the encoding menu.
+ // It's updated only for the main frame. For a subframe,
+ // RenderView::UpdateURL does not set params.contents_mime_type.
+ // (see http://code.google.com/p/chromium/issues/detail?id=2929 )
// TODO(jungshik): Add a test for the encoding menu to avoid
// regressing it again.
- contents_mime_type_ = params.contents_mime_type;
+ if (PageTransition::IsMainFrame(params.transition))
+ contents_mime_type_ = params.contents_mime_type;
NavigationController::LoadCommittedDetails details;
if (!controller()->RendererDidNavigate(