Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.h

Issue 11088043: browser-plugin: Allow accepting drag-n-drop events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/browser_plugin/browser_plugin_guest.h
diff --git a/content/browser/browser_plugin/browser_plugin_guest.h b/content/browser/browser_plugin/browser_plugin_guest.h
index 3c8254fa1d3e396818ff939dda40ed133e27d069..d20ab1070161ae54d4a6b93676b608210c0c4158 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.h
+++ b/content/browser/browser_plugin/browser_plugin_guest.h
@@ -38,11 +38,14 @@
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_observer.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebDragStatus.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h"
#include "ui/gfx/rect.h"
#include "webkit/glue/webcursor.h"
class TransportDIB;
struct ViewHostMsg_UpdateRect_Params;
+struct WebDropData;
namespace WebKit {
class WebInputEvent;
@@ -83,6 +86,9 @@ class CONTENT_EXPORT BrowserPluginGuest : public NotificationObserver,
RenderProcessHost* render_process_host) {
embedder_render_process_host_ = render_process_host;
}
+ void set_embedder_render_view_host(RenderViewHost* render_view_host) {
+ embedder_render_view_host_ = render_view_host;
+ }
bool visible() const { return visible_; }
@@ -160,6 +166,22 @@ class CONTENT_EXPORT BrowserPluginGuest : public NotificationObserver,
// RenderThreadImpl::IdleHandlerInForegroundTab (executed when visible).
void SetVisibility(bool embedder_visible, bool visible);
+ // Handles drag events from the embedder.
+ // When dragging, the drag events go to the embedder first, and if the drag
+ // happens on the browser plugin, then the plugin sends a corresponding
+ // drag-message to the guest. This routes the drag-message to the guest
+ // renderer.
+ void DragStatusUpdate(WebKit::WebDragStatus drag_status,
+ const WebDropData& drop_data,
+ WebKit::WebDragOperationsMask drag_mask,
+ const gfx::Point& location);
+
+ // Updates the cursor during dragging.
+ // During dragging, if the guest notifies to update the cursor for a drag,
+ // then it is necessary to route the cursor update to the embedder correctly
+ // so that the cursor updates properly.
+ void UpdateDragCursor(WebKit::WebDragOperation operation);
+
// Exposes the protected web_contents() from WebContentsObserver.
WebContents* GetWebContents();
@@ -218,6 +240,7 @@ class CONTENT_EXPORT BrowserPluginGuest : public NotificationObserver,
NotificationRegistrar notification_registrar_;
RenderProcessHost* embedder_render_process_host_;
+ RenderViewHost* embedder_render_view_host_;
// An identifier that uniquely identifies a browser plugin guest within an
// embedder.
int instance_id_;

Powered by Google App Engine
This is Rietveld 408576698