diff options
author | jnd@google.com <jnd@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-18 21:24:29 +0000 |
---|---|---|
committer | jnd@google.com <jnd@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-18 21:24:29 +0000 |
commit | 72c94f309664498277eee70eeccc05b44f0f255a (patch) | |
tree | 65d2fedf4b6907c4971dae0e8526d3c20efe9264 /webkit | |
parent | ea8c4104164fcb225003bf074d3d4693929e00da (diff) | |
download | chromium_src-72c94f309664498277eee70eeccc05b44f0f255a.zip chromium_src-72c94f309664498277eee70eeccc05b44f0f255a.tar.gz chromium_src-72c94f309664498277eee70eeccc05b44f0f255a.tar.bz2 |
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
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/context_menu_client_impl.cc | 6 | ||||
-rw-r--r-- | webkit/glue/webframe.h | 5 | ||||
-rw-r--r-- | webkit/glue/webframe_impl.cc | 9 | ||||
-rw-r--r-- | webkit/glue/webframe_impl.h | 3 | ||||
-rw-r--r-- | webkit/glue/webview_delegate.h | 5 | ||||
-rw-r--r-- | webkit/pending/FrameLoader.h | 1 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.cc | 3 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.h | 3 |
8 files changed, 30 insertions, 5 deletions
diff --git a/webkit/glue/context_menu_client_impl.cc b/webkit/glue/context_menu_client_impl.cc index c5227676..ea6d800 100644 --- a/webkit/glue/context_menu_client_impl.cc +++ b/webkit/glue/context_menu_client_impl.cc @@ -184,6 +184,7 @@ WebCore::PlatformMenuDescription GURL frame_url; GURL page_url; + std::wstring frame_encoding; // Send the frame and page URLs in any case. ContextNode::Type frame_type = ContextNode::NONE; ContextNode::Type page_type = @@ -194,6 +195,8 @@ WebCore::PlatformMenuDescription frame_type = GetTypeAndURLFromFrame(selected_frame, &frame_url, ContextNode::FRAME); + frame_encoding = webkit_glue::StringToStdWString( + selected_frame->loader()->encoding()); } if (type == ContextNode::NONE) { @@ -244,7 +247,8 @@ WebCore::PlatformMenuDescription frame_url, selection_text_string, misspelled_word_string, - edit_flags); + edit_flags, + frame_encoding); } return NULL; } diff --git a/webkit/glue/webframe.h b/webkit/glue/webframe.h index d417563b..dde853d 100644 --- a/webkit/glue/webframe.h +++ b/webkit/glue/webframe.h @@ -370,6 +370,11 @@ class WebFrame : public base::RefCounted<WebFrame> { // Does this frame have an onunload or unbeforeunload event listener? virtual bool HasUnloadListener() = 0; + // Is this frame reloading with allowing stale data? This will be true when + // the encoding of the page is changed and it needs to be re-interpreted, + // but no additional loads should occur. + virtual bool IsReloadAllowingStaleData() const = 0; + private: DISALLOW_EVIL_CONSTRUCTORS(WebFrame); }; diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index c8627d1..8d08a5d 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -1736,3 +1736,12 @@ bool WebFrameImpl::HasUnloadListener() { } return false; } + +bool WebFrameImpl::IsReloadAllowingStaleData() const { + FrameLoader* loader = frame() ? frame()->loader() : NULL; + if (loader) { + return WebCore::FrameLoadTypeReloadAllowingStaleData == + loader->policyLoadType(); + } + return false; +} diff --git a/webkit/glue/webframe_impl.h b/webkit/glue/webframe_impl.h index c466b16..31de146 100644 --- a/webkit/glue/webframe_impl.h +++ b/webkit/glue/webframe_impl.h @@ -198,7 +198,7 @@ class WebFrameImpl : public WebFrame { plugin_delegate_ = plugin_delegate; } - WebCore::Frame* frame() { + WebCore::Frame* frame() const { return frame_.get(); } @@ -259,6 +259,7 @@ class WebFrameImpl : public WebFrame { bool printing() const { return printing_; } virtual bool HasUnloadListener(); + virtual bool IsReloadAllowingStaleData() const; protected: friend class WebFrameLoaderClient; diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h index 5e4cc6c..7160c0f 100644 --- a/webkit/glue/webview_delegate.h +++ b/webkit/glue/webview_delegate.h @@ -554,6 +554,8 @@ class WebViewDelegate : virtual public WebWidgetDelegate { // @param misspelled_word The editable (possibily) misspelled word // in the Editor on which dictionary lookup for suggestions will be done. // @param edit_flags Which edit operations the renderer believes are available + // @param frame_encoding Which indicates the encoding of current focused + // sub frame. virtual void ShowContextMenu(WebView* webview, ContextNode::Type type, int x, @@ -564,7 +566,8 @@ class WebViewDelegate : virtual public WebWidgetDelegate { 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) { } // Starts a drag session with the supplied contextual information. diff --git a/webkit/pending/FrameLoader.h b/webkit/pending/FrameLoader.h index 61002f2..bdcf233 100644 --- a/webkit/pending/FrameLoader.h +++ b/webkit/pending/FrameLoader.h @@ -247,6 +247,7 @@ namespace WebCore { void didChangeTitle(DocumentLoader*); FrameLoadType loadType() const; + FrameLoadType policyLoadType() const { return m_policyLoadType; } void didFirstLayout(); bool firstLayoutDone() const; diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index 231415f..3e23252 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -507,7 +507,8 @@ void TestWebViewDelegate::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) { CapturedContextMenuEvent context(type, x, y); captured_context_menu_events_.push_back(context); } diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index 9a6f5e7..e21ee53 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -115,7 +115,8 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, public 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); virtual void DidStartProvisionalLoadForFrame( WebView* webview, WebFrame* frame, |