diff options
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/context_menu.h | 3 | ||||
-rw-r--r-- | webkit/glue/context_menu_client_impl.cc | 8 | ||||
-rw-r--r-- | webkit/glue/resource_handle_impl.cc | 4 | ||||
-rw-r--r-- | webkit/glue/webview_delegate.h | 10 | ||||
-rwxr-xr-x | webkit/tools/test_shell/test_webview_delegate.cc | 3 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.h | 3 |
6 files changed, 20 insertions, 11 deletions
diff --git a/webkit/glue/context_menu.h b/webkit/glue/context_menu.h index 32a6925..69ea22f 100644 --- a/webkit/glue/context_menu.h +++ b/webkit/glue/context_menu.h @@ -111,6 +111,9 @@ struct ContextMenuParams { // The security info for the resource we are showing the menu on. std::string security_info; + + // The character encoding of the frame on which the menu is invoked. + std::string frame_charset; }; #endif // WEBKIT_GLUE_CONTEXT_NODE_TYPES_H__ diff --git a/webkit/glue/context_menu_client_impl.cc b/webkit/glue/context_menu_client_impl.cc index 2947968..8fca4a6 100644 --- a/webkit/glue/context_menu_client_impl.cc +++ b/webkit/glue/context_menu_client_impl.cc @@ -177,7 +177,8 @@ WebCore::PlatformMenuDescription GURL page_url; std::string security_info; - std::wstring frame_encoding; + std::string frame_charset = WideToASCII( + webkit_glue::StringToStdWString(selected_frame->loader()->encoding())); // Send the frame and page URLs in any case. ContextNode frame_node = ContextNode(ContextNode::NONE); ContextNode page_node = @@ -188,8 +189,6 @@ WebCore::PlatformMenuDescription frame_node = GetTypeAndURLFromFrame(selected_frame, &frame_url, ContextNode(ContextNode::FRAME)); - frame_encoding = webkit_glue::StringToStdWString( - selected_frame->loader()->encoding()); } if (r.isSelected()) { @@ -253,7 +252,8 @@ WebCore::PlatformMenuDescription selection_text_string, misspelled_word_string, edit_flags, - security_info); + security_info, + frame_charset); } return NULL; } diff --git a/webkit/glue/resource_handle_impl.cc b/webkit/glue/resource_handle_impl.cc index fa3fb89..024836e 100644 --- a/webkit/glue/resource_handle_impl.cc +++ b/webkit/glue/resource_handle_impl.cc @@ -151,12 +151,14 @@ static ResourceResponse MakeResourceResponse( // TODO(darin): We should leverage HttpResponseHeaders for this, and this // should be using the same code as ResourceDispatcherHost. + // TODO(jungshik): Figure out the actual value of the referrer charset and + // pass it to GetSuggestedFilename. std::wstring suggested_filename; if (info.headers) { std::string disp_val; if (info.headers->EnumerateHeader(NULL, "content-disposition", &disp_val)) { suggested_filename = net::GetSuggestedFilename( - webkit_glue::KURLToGURL(kurl), disp_val, std::wstring()); + webkit_glue::KURLToGURL(kurl), disp_val, "", std::wstring()); } } diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h index 02a8a0c..27036db 100644 --- a/webkit/glue/webview_delegate.h +++ b/webkit/glue/webview_delegate.h @@ -560,9 +560,10 @@ class WebViewDelegate : virtual public WebWidgetDelegate { // clicked on // @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. + // @param edit_flags which edit operations the renderer believes are available + // @param security_info + // @param frame_charset which indicates the character encoding of + // the currently focused frame. virtual void ShowContextMenu(WebView* webview, ContextNode node, int x, @@ -574,7 +575,8 @@ class WebViewDelegate : virtual public WebWidgetDelegate { const std::wstring& selection_text, const std::wstring& misspelled_word, int edit_flags, - const std::string& security_info) { + const std::string& security_info, + const std::string& frame_charset) { } // Starts a drag session with the supplied contextual information. diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index aeae028..4bf5601 100755 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -525,7 +525,8 @@ void TestWebViewDelegate::ShowContextMenu(WebView* webview, const std::wstring& selection_text, const std::wstring& misspelled_word, int edit_flags, - const std::string& security_info) { + const std::string& security_info, + const std::string& frame_charset) { CapturedContextMenuEvent context(node, 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 413fe8d..79fd25d 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -119,7 +119,8 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, const std::wstring& selection_text, const std::wstring& misspelled_word, int edit_flags, - const std::string& security_info); + const std::string& security_info, + const std::string& frame_charset); virtual void DidStartProvisionalLoadForFrame( WebView* webview, WebFrame* frame, |