From 72c94f309664498277eee70eeccc05b44f0f255a Mon Sep 17 00:00:00 2001 From: "jnd@google.com" Date: Mon, 18 Aug 2008 21:24:29 +0000 Subject: The CL is consist of CLs(1624,1580) for bug:1281734 which are reviewed and LG by brett. I just merge them to single one for passing compilation. The CL is to fix bug http://b/issue?id=1281734. FireFox uses encoding used by the original webpage to decode the source of the webpage, Chrome does not. We need to add a new parameter which carries the override encoding when opening a view-source URL for viewing its source. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@997 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/render_view.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'chrome/renderer/render_view.cc') diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 22dd829..7153ed2 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -1439,6 +1439,13 @@ WindowOpenDisposition RenderView::DispositionForNavigationAction( // Webkit is asking whether to navigate to a new URL. // This is fine normally, except if we're showing UI from one security // context and they're trying to navigate to a different context. + // + // Reload allowing stale data is used for encoding changes which will never + // appear in a new tab. So we should return disposition as CURRENT_TAB when + // encountering this situation. + if (frame->IsReloadAllowingStaleData()) + return CURRENT_TAB; + const GURL& url = request->GetURL(); // We only care about navigations that are within the current tab (as opposed // to, for example, opening a new window). @@ -1808,7 +1815,8 @@ void RenderView::ShowContextMenu(WebView* webview, const GURL& frame_url, const std::wstring& selection_text, const std::wstring& misspelled_word, - int edit_flags) { + int edit_flags, + const std::wstring& frame_encoding) { ViewHostMsg_ContextMenu_Params params; params.type = type; params.x = x; @@ -1820,6 +1828,7 @@ void RenderView::ShowContextMenu(WebView* webview, params.selection_text = selection_text; params.misspelled_word = misspelled_word; params.edit_flags = edit_flags; + params.frame_encoding = frame_encoding; Send(new ViewHostMsg_ContextMenu(routing_id_, params)); } -- cgit v1.1