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

Side by Side 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 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_AURA_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_AURA_H_
6 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_AURA_H_ 6 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_AURA_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view.h" 9 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view.h"
10 #include "ui/base/events.h"
10 #include "ui/views/widget/native_widget_aura.h" 11 #include "ui/views/widget/native_widget_aura.h"
11 12
13 namespace aura {
14 class DropTargetEvent;
15 }
16
17 namespace ui {
18 class OSExchangeDataProviderAura;
19 }
20
12 class TabContents; 21 class TabContents;
13 22
14 class NativeTabContentsViewAura : public views::NativeWidgetAura, 23 class NativeTabContentsViewAura : public views::NativeWidgetAura,
15 public NativeTabContentsView { 24 public NativeTabContentsView {
16 public: 25 public:
17 explicit NativeTabContentsViewAura( 26 explicit NativeTabContentsViewAura(
18 internal::NativeTabContentsViewDelegate* delegate); 27 internal::NativeTabContentsViewDelegate* delegate);
19 virtual ~NativeTabContentsViewAura(); 28 virtual ~NativeTabContentsViewAura();
20 29
21 TabContents* GetTabContents() const; 30 TabContents* GetTabContents() const;
22 31
23 void EndDragging();
24
25 private: 32 private:
26 // Overridden from NativeTabContentsView: 33 // Overridden from NativeTabContentsView:
27 virtual void InitNativeTabContentsView() OVERRIDE; 34 virtual void InitNativeTabContentsView() OVERRIDE;
28 virtual void Unparent() OVERRIDE; 35 virtual void Unparent() OVERRIDE;
29 virtual RenderWidgetHostView* CreateRenderWidgetHostView( 36 virtual RenderWidgetHostView* CreateRenderWidgetHostView(
30 RenderWidgetHost* render_widget_host) OVERRIDE; 37 RenderWidgetHost* render_widget_host) OVERRIDE;
31 virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; 38 virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE;
32 virtual void SetPageTitle(const string16& title) OVERRIDE; 39 virtual void SetPageTitle(const string16& title) OVERRIDE;
33 virtual void StartDragging(const WebDropData& drop_data, 40 virtual void StartDragging(const WebDropData& drop_data,
34 WebKit::WebDragOperationsMask ops, 41 WebKit::WebDragOperationsMask ops,
35 const SkBitmap& image, 42 const SkBitmap& image,
36 const gfx::Point& image_offset) OVERRIDE; 43 const gfx::Point& image_offset) OVERRIDE;
37 virtual void CancelDrag() OVERRIDE; 44 virtual void CancelDrag() OVERRIDE;
38 virtual bool IsDoingDrag() const OVERRIDE; 45 virtual bool IsDoingDrag() const OVERRIDE;
39 virtual void SetDragCursor(WebKit::WebDragOperation operation) OVERRIDE; 46 virtual void SetDragCursor(WebKit::WebDragOperation operation) OVERRIDE;
40 virtual views::NativeWidget* AsNativeWidget() OVERRIDE; 47 virtual views::NativeWidget* AsNativeWidget() OVERRIDE;
41 48
42 // Overridden from views::NativeWidgetAura: 49 // Overridden from views::NativeWidgetAura:
43 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, 50 virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
44 const gfx::Rect& new_bounds) OVERRIDE; 51 const gfx::Rect& new_bounds) OVERRIDE;
45 virtual bool OnMouseEvent(aura::MouseEvent* event) OVERRIDE; 52 virtual bool OnMouseEvent(aura::MouseEvent* event) OVERRIDE;
53 virtual void OnDragEntered(const aura::DropTargetEvent& event) OVERRIDE;
54 virtual int OnDragUpdated(const aura::DropTargetEvent& event) OVERRIDE;
55 virtual void OnDragExited() OVERRIDE;
56 virtual int OnPerformDrop(const aura::DropTargetEvent& event) OVERRIDE;
57
58 // Utility to fill a ui::OSExchangeDataProviderAura object from WebDropData.
59 void PrepareDragData(const WebDropData& drop_data,
60 ui::OSExchangeDataProviderAura* provider);
61
62 // Utility to fill a WebDropData object from ui::OSExchangeData.
63 void PrepareWebDropData(WebDropData* drop_data,
64 const ui::OSExchangeData& data);
65
66 // Utilities to convert between WebKit::WebDragOperationsMask and
67 // ui::DragDropTypes.
68 int ConvertFromWeb(WebKit::WebDragOperationsMask ops);
69 WebKit::WebDragOperationsMask ConvertToWeb(int drag_op);
70
71 // Informs the renderer that the drag operation it initiated has ended and
72 // |ops| drag operations were applied.
73 void EndDrag(WebKit::WebDragOperationsMask ops);
46 74
47 internal::NativeTabContentsViewDelegate* delegate_; 75 internal::NativeTabContentsViewDelegate* delegate_;
48 76
77 WebKit::WebDragOperationsMask current_drag_op_;
78
49 DISALLOW_COPY_AND_ASSIGN(NativeTabContentsViewAura); 79 DISALLOW_COPY_AND_ASSIGN(NativeTabContentsViewAura);
50 }; 80 };
51 81
52 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_AURA_H_ 82 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698