diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-12 23:08:30 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-12 23:08:30 +0000 |
commit | e38f40150dac6e0af08e3cdcfb1e502a2223c87c (patch) | |
tree | 3b31c4c506ac390d712921ae35acad89f7afd5d7 /chrome/renderer | |
parent | 5baa03fdfe3a13d4102a819fb3e653f1559b5259 (diff) | |
download | chromium_src-e38f40150dac6e0af08e3cdcfb1e502a2223c87c.zip chromium_src-e38f40150dac6e0af08e3cdcfb1e502a2223c87c.tar.gz chromium_src-e38f40150dac6e0af08e3cdcfb1e502a2223c87c.tar.bz2 |
Revert the change that fixed the encoding when viewing source in subframes.
This makes view source for some pages (for example Google Reader) not work
properly. I speculate that telling WebKit to change the encoding (which causes
a reload) right after starting the real load makes it confused.
Review URL: http://codereview.chromium.org/3022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2143 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/render_view.cc | 20 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 9 |
2 files changed, 9 insertions, 20 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 9755fa8..f978178 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -1060,15 +1060,14 @@ void RenderView::UpdateTitle(WebFrame* frame, const std::wstring& title) { } void RenderView::UpdateEncoding(WebFrame* frame, - const std::string& encoding_name) { + const std::wstring& encoding_name) { // Only update main frame's encoding_name. if (webview()->GetMainFrame() == frame && last_encoding_name_ != encoding_name) { - // save the encoding name for later comparing. + // Save the encoding name for later comparing. last_encoding_name_ = encoding_name; - Send(new ViewHostMsg_UpdateEncoding(routing_id_, - last_encoding_name_)); + Send(new ViewHostMsg_UpdateEncoding(routing_id_, last_encoding_name_)); } } @@ -1422,13 +1421,6 @@ 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). @@ -1798,8 +1790,7 @@ void RenderView::ShowContextMenu(WebView* webview, const GURL& frame_url, const std::wstring& selection_text, const std::wstring& misspelled_word, - int edit_flags, - const std::string& frame_encoding) { + int edit_flags) { ViewHostMsg_ContextMenu_Params params; params.type = type; params.x = x; @@ -1811,7 +1802,6 @@ 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)); } @@ -2169,7 +2159,7 @@ void RenderView::OnAlterTextSize(int size) { } } -void RenderView::OnSetPageEncoding(const std::string& encoding_name) { +void RenderView::OnSetPageEncoding(const std::wstring& encoding_name) { webview()->SetPageEncoding(encoding_name); } diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index bc3a052..85c74fc 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -205,8 +205,7 @@ class RenderView : public RenderWidget, public WebViewDelegate, const GURL& frame_url, const std::wstring& selection_text, const std::wstring& misspelled_word, - int edit_flags, - const std::string& frame_encoding); + int edit_flags); virtual void StartDragging(WebView* webview, const WebDropData& drag_data); @@ -310,7 +309,7 @@ class RenderView : public RenderWidget, public WebViewDelegate, // c) function:DidFinishDocumentLoadForFrame. When this function is // called, that means we have got whole html page. In here we should // finally get right encoding of page. - void UpdateEncoding(WebFrame* frame, const std::string& encoding_name); + void UpdateEncoding(WebFrame* frame, const std::wstring& encoding_name); // Captures the thumbnail and text contents for indexing for the given load // ID. If the view's load ID is different than the parameter, this call is @@ -372,7 +371,7 @@ class RenderView : public RenderWidget, public WebViewDelegate, void OnCancelDownload(int32 download_id); void OnFind(const FindInPageRequest& request); void OnAlterTextSize(int size); - void OnSetPageEncoding(const std::string& encoding_name); + void OnSetPageEncoding(const std::wstring& encoding_name); void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url); void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( const std::vector<std::wstring>& links, @@ -506,7 +505,7 @@ class RenderView : public RenderWidget, public WebViewDelegate, ExternalHostBindings external_host_bindings_; // The last gotten main frame's encoding. - std::string last_encoding_name_; + std::wstring last_encoding_name_; // The URL we think the user's mouse is hovering over. We use this to // determine if we want to send a new one (we do not need to send |