diff options
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/print_web_view_helper.h | 14 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 41 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 17 |
3 files changed, 18 insertions, 54 deletions
diff --git a/chrome/renderer/print_web_view_helper.h b/chrome/renderer/print_web_view_helper.h index 5c14475..893552d 100644 --- a/chrome/renderer/print_web_view_helper.h +++ b/chrome/renderer/print_web_view_helper.h @@ -169,6 +169,12 @@ class PrintWebViewHelper : public WebViewDelegate { virtual bool isShowingSpellingUI() { return false; } virtual void updateSpellingUIWithMisspelledWord( const WebKit::WebString& word) {} + virtual bool runFileChooser( + bool multi_select, const WebKit::WebString& title, + const WebKit::WebString& initial_value, + WebKit::WebFileChooserCompletion* chooser_completion) { + return false; + } virtual void runModalAlertDialog( WebKit::WebFrame* frame, const WebKit::WebString& message) {} virtual bool runModalConfirmDialog( @@ -183,12 +189,8 @@ class PrintWebViewHelper : public WebViewDelegate { WebKit::WebFrame* frame, const WebKit::WebString& message) { return true; } - virtual bool runFileChooser( - bool multi_select, const WebKit::WebString& title, - const WebKit::WebString& initial_value, - WebKit::WebFileChooserCompletion* chooser_completion) { - return false; - } + virtual void showContextMenu( + WebKit::WebFrame* frame, const WebKit::WebContextMenuData& data) {} virtual void setStatusText(const WebKit::WebString& text) {} virtual void setMouseOverURL(const WebKit::WebURL& url) {} virtual void setToolTipText( diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 4a5d2d4..86dab30 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -79,6 +79,7 @@ #include "webkit/appcache/appcache_interfaces.h" #include "webkit/default_plugin/default_plugin_shared.h" #include "webkit/glue/glue_serialize.h" +#include "webkit/glue/glue_util.h" #include "webkit/glue/dom_operations.h" #include "webkit/glue/dom_serializer.h" #include "webkit/glue/image_decoder.h" @@ -113,6 +114,7 @@ using webkit_glue::SearchableFormData; using WebKit::WebColor; using WebKit::WebColorName; using WebKit::WebConsoleMessage; +using WebKit::WebContextMenuData; using WebKit::WebData; using WebKit::WebDataSource; using WebKit::WebDragData; @@ -1623,6 +1625,11 @@ bool RenderView::runModalBeforeUnloadDialog( return success; } +void RenderView::showContextMenu( + WebFrame* frame, const WebContextMenuData& data) { + Send(new ViewHostMsg_ContextMenu(routing_id_, ContextMenuParams(data))); +} + void RenderView::setStatusText(const WebString& text) { } @@ -2497,40 +2504,6 @@ void RenderView::SyncNavigationState() { routing_id_, page_id_, webkit_glue::HistoryItemToString(item))); } -void RenderView::ShowContextMenu(WebView* webview, - ContextNodeType node_type, - int x, - int y, - const GURL& link_url, - const GURL& src_url, - const GURL& page_url, - const GURL& frame_url, - const ContextMenuMediaParams& media_params, - const std::wstring& selection_text, - const std::wstring& misspelled_word, - int edit_flags, - const std::string& security_info, - const std::string& frame_charset) { - ContextMenuParams params; - params.node_type = node_type; - params.x = x; - params.y = y; - params.src_url = src_url; - params.link_url = link_url; - params.unfiltered_link_url = link_url; - params.page_url = page_url; - params.frame_url = frame_url; - params.media_params = media_params; - params.selection_text = selection_text; - params.misspelled_word = misspelled_word; - params.spellcheck_enabled = - webview->focusedFrame()->isContinuousSpellCheckingEnabled(); - params.edit_flags = edit_flags; - params.security_info = security_info; - params.frame_charset = frame_charset; - Send(new ViewHostMsg_ContextMenu(routing_id_, params)); -} - bool RenderView::DownloadImage(int id, const GURL& image_url, int image_size) { // Make sure webview was not shut down. if (!webview()) diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index 10822a5..72e8f6b 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -36,6 +36,7 @@ #include "third_party/skia/include/core/SkBitmap.h" #include "testing/gtest/include/gtest/gtest_prod.h" #include "webkit/api/public/WebConsoleMessage.h" +#include "webkit/api/public/WebContextMenuData.h" #include "webkit/api/public/WebFrameClient.h" #include "webkit/api/public/WebTextDirection.h" #include "webkit/glue/dom_serializer_delegate.h" @@ -177,20 +178,6 @@ class RenderView : public RenderWidget, virtual void OnMissingPluginStatus( WebPluginDelegateProxy* delegate, int status); - virtual void ShowContextMenu(WebView* webview, - ContextNodeType node_type, - int x, - int y, - const GURL& link_url, - const GURL& src_url, - const GURL& page_url, - const GURL& frame_url, - const ContextMenuMediaParams& media_params, - const std::wstring& selection_text, - const std::wstring& misspelled_word, - int edit_flags, - const std::string& security_info, - const std::string& frame_charset); virtual WebDevToolsAgentDelegate* GetWebDevToolsAgentDelegate(); virtual bool WasOpenedByUserGesture() const; virtual void FocusAccessibilityObject(WebCore::AccessibilityObject* acc_obj); @@ -256,6 +243,8 @@ class RenderView : public RenderWidget, const WebKit::WebString& default_value, WebKit::WebString* actual_value); virtual bool runModalBeforeUnloadDialog( WebKit::WebFrame* frame, const WebKit::WebString& message); + virtual void showContextMenu( + WebKit::WebFrame* frame, const WebKit::WebContextMenuData& data); virtual void setStatusText(const WebKit::WebString& text); virtual void setMouseOverURL(const WebKit::WebURL& url); virtual void setToolTipText( |