summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/renderer/print_web_view_helper.h1
-rw-r--r--chrome/renderer/render_view.cc8
-rw-r--r--chrome/renderer/render_view.h2
-rw-r--r--webkit/api/public/WebViewClient.h4
-rw-r--r--webkit/glue/dragclient_impl.cc2
-rw-r--r--webkit/glue/webview_delegate.h6
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.h1
7 files changed, 12 insertions, 12 deletions
diff --git a/chrome/renderer/print_web_view_helper.h b/chrome/renderer/print_web_view_helper.h
index 69fd333..001d632 100644
--- a/chrome/renderer/print_web_view_helper.h
+++ b/chrome/renderer/print_web_view_helper.h
@@ -188,6 +188,7 @@ class PrintWebViewHelper : public WebViewDelegate {
virtual void startDragging(
const WebKit::WebPoint& from, const WebKit::WebDragData& data,
WebKit::WebDragOperationsMask mask) {}
+ virtual bool acceptsLoadDrops() { return false; }
virtual void focusNext() {}
virtual void focusPrevious() {}
virtual void navigateBackForwardSoon(int offset) {}
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 09f405e..a811503 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -1110,10 +1110,6 @@ void RenderView::OpenURL(
// WebViewDelegate ------------------------------------------------------------
-bool RenderView::CanAcceptLoadDrops() const {
- return renderer_preferences_.can_accept_load_drops;
-}
-
void RenderView::DidPaint() {
WebFrame* main_frame = webview()->GetMainFrame();
@@ -1642,6 +1638,10 @@ void RenderView::startDragging(const WebPoint& from, const WebDragData& data,
allowed_ops));
}
+bool RenderView::acceptsLoadDrops() {
+ return renderer_preferences_.can_accept_load_drops;
+}
+
void RenderView::focusNext() {
Send(new ViewHostMsg_TakeFocus(routing_id_, false));
}
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 69bfbc5..b5158a4 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -163,7 +163,6 @@ class RenderView : public RenderWidget,
virtual void OnMessageReceived(const IPC::Message& msg);
// WebViewDelegate
- virtual bool CanAcceptLoadDrops() const;
virtual void QueryFormFieldAutofill(const std::wstring& field_name,
const std::wstring& text,
int64 node_id);
@@ -274,6 +273,7 @@ class RenderView : public RenderWidget,
virtual void startDragging(
const WebKit::WebPoint& from, const WebKit::WebDragData& data,
WebKit::WebDragOperationsMask mask);
+ virtual bool acceptsLoadDrops();
virtual void focusNext();
virtual void focusPrevious();
virtual void navigateBackForwardSoon(int offset);
diff --git a/webkit/api/public/WebViewClient.h b/webkit/api/public/WebViewClient.h
index 480243d..fa1c987 100644
--- a/webkit/api/public/WebViewClient.h
+++ b/webkit/api/public/WebViewClient.h
@@ -202,6 +202,10 @@ namespace WebKit {
virtual void startDragging(
const WebPoint& from, const WebDragData&, WebDragOperationsMask) = 0;
+ // Called to determine if drag-n-drop operations may initiate a page
+ // navigation.
+ virtual bool acceptsLoadDrops() = 0;
+
// Take focus away from the WebView by focusing an adjacent UI element
// in the containing window.
virtual void focusNext() = 0;
diff --git a/webkit/glue/dragclient_impl.cc b/webkit/glue/dragclient_impl.cc
index dff2ccd..cb29825 100644
--- a/webkit/glue/dragclient_impl.cc
+++ b/webkit/glue/dragclient_impl.cc
@@ -33,7 +33,7 @@ void DragClientImpl::willPerformDragSourceAction(
WebCore::DragDestinationAction DragClientImpl::actionMaskForDrag(
WebCore::DragData*) {
- if (webview_->delegate()->CanAcceptLoadDrops()) {
+ if (webview_->client() && webview_->client()->acceptsLoadDrops()) {
return WebCore::DragDestinationActionAny;
} else {
return static_cast<WebCore::DragDestinationAction>
diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h
index 3d1964c..0773109 100644
--- a/webkit/glue/webview_delegate.h
+++ b/webkit/glue/webview_delegate.h
@@ -102,12 +102,6 @@ class WebViewDelegate : public WebKit::WebViewClient {
// FrameLoaderClient -------------------------------------------------------
- virtual bool CanAcceptLoadDrops() const {
- // Always return true here so layout tests (which use the default WebView
- // delegate) continue to pass.
- return true;
- }
-
// Notifies that a new script context has been created for this frame.
// This is similar to WindowObjectCleared but only called once per frame
// context.
diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h
index 57afc3c..c92ca81 100644
--- a/webkit/tools/test_shell/test_webview_delegate.h
+++ b/webkit/tools/test_shell/test_webview_delegate.h
@@ -140,6 +140,7 @@ class TestWebViewDelegate : public WebViewDelegate,
virtual void startDragging(
const WebKit::WebPoint& from, const WebKit::WebDragData& data,
WebKit::WebDragOperationsMask mask);
+ virtual bool acceptsLoadDrops() { return true; }
virtual void focusNext() {}
virtual void focusPrevious() {}
virtual void navigateBackForwardSoon(int offset);