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

Unified Diff: chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.h

Issue 8682029: Make drag and drop work on webpage. Also slightly modify drag drop workflow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged with upstream Created 9 years, 1 month 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: chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.h
diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.h b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.h
index 7b118c0c2eabc2a5422885352c42222c17ea494b..577451ea9b061b4422c0e30c2a38f19dc1dd08e5 100644
--- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.h
+++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.h
@@ -7,8 +7,17 @@
#pragma once
#include "chrome/browser/ui/views/tab_contents/native_tab_contents_view.h"
+#include "ui/base/events.h"
#include "ui/views/widget/native_widget_aura.h"
+namespace aura {
+class DropTargetEvent;
+}
+
+namespace ui {
+class OSExchangeDataProviderAura;
+}
+
class TabContents;
class NativeTabContentsViewAura : public views::NativeWidgetAura,
@@ -20,8 +29,6 @@ class NativeTabContentsViewAura : public views::NativeWidgetAura,
TabContents* GetTabContents() const;
- void EndDragging();
-
private:
// Overridden from NativeTabContentsView:
virtual void InitNativeTabContentsView() OVERRIDE;
@@ -43,9 +50,32 @@ class NativeTabContentsViewAura : public views::NativeWidgetAura,
virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) OVERRIDE;
virtual bool OnMouseEvent(aura::MouseEvent* event) OVERRIDE;
+ virtual void OnDragEntered(const aura::DropTargetEvent& event) OVERRIDE;
+ virtual int OnDragUpdated(const aura::DropTargetEvent& event) OVERRIDE;
+ virtual void OnDragExited() OVERRIDE;
+ virtual int OnPerformDrop(const aura::DropTargetEvent& event) OVERRIDE;
+
+ // Utility to fill a ui::OSExchangeDataProviderAura object from WebDropData.
+ void PrepareDragData(const WebDropData& drop_data,
+ ui::OSExchangeDataProviderAura* provider);
+
+ // Utility to fill a WebDropData object from ui::OSExchangeData.
+ void PrepareWebDropData(WebDropData* drop_data,
+ const ui::OSExchangeData& data);
+
+ // Utilities to convert between WebKit::WebDragOperationsMask and
+ // ui::DragDropTypes.
+ int ConvertFromWeb(WebKit::WebDragOperationsMask ops);
+ WebKit::WebDragOperationsMask ConvertToWeb(int drag_op);
+
+ // Informs the renderer that the drag operation it initiated has ended and
+ // |ops| drag operations were applied.
+ void EndDrag(WebKit::WebDragOperationsMask ops);
internal::NativeTabContentsViewDelegate* delegate_;
+ WebKit::WebDragOperationsMask current_drag_op_;
+
DISALLOW_COPY_AND_ASSIGN(NativeTabContentsViewAura);
};

Powered by Google App Engine
This is Rietveld 408576698