OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "content/port/browser/render_view_host_delegate_view.h" | 13 #include "content/port/browser/render_view_host_delegate_view.h" |
14 #include "content/public/browser/web_contents_view.h" | 14 #include "content/public/browser/web_contents_view.h" |
15 #include "ui/aura/client/drag_drop_delegate.h" | 15 #include "ui/aura/client/drag_drop_delegate.h" |
16 #include "ui/aura/window_delegate.h" | 16 #include "ui/aura/window_delegate.h" |
17 | 17 |
18 class WebContentsImpl; | 18 class WebContentsImpl; |
19 | 19 |
20 namespace aura { | 20 namespace aura { |
21 class Window; | 21 class Window; |
22 } | 22 } |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 class WebContentsViewDelegate; | 25 class WebContentsViewDelegate; |
26 class WebDragDestDelegate; | 26 class WebDragDestDelegate; |
27 } | 27 } |
28 | 28 |
| 29 namespace ui { |
| 30 class DropTargetEvent; |
| 31 } |
| 32 |
29 class CONTENT_EXPORT WebContentsViewAura | 33 class CONTENT_EXPORT WebContentsViewAura |
30 : public content::WebContentsView, | 34 : public content::WebContentsView, |
31 public content::RenderViewHostDelegateView, | 35 public content::RenderViewHostDelegateView, |
32 public aura::WindowDelegate, | 36 public aura::WindowDelegate, |
33 public aura::client::DragDropDelegate { | 37 public aura::client::DragDropDelegate { |
34 public: | 38 public: |
35 WebContentsViewAura(WebContentsImpl* web_contents, | 39 WebContentsViewAura(WebContentsImpl* web_contents, |
36 content::WebContentsViewDelegate* delegate); | 40 content::WebContentsViewDelegate* delegate); |
37 | 41 |
38 private: | 42 private: |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 virtual void UpdateDragCursor(WebKit::WebDragOperation operation) OVERRIDE; | 87 virtual void UpdateDragCursor(WebKit::WebDragOperation operation) OVERRIDE; |
84 virtual void GotFocus() OVERRIDE; | 88 virtual void GotFocus() OVERRIDE; |
85 virtual void TakeFocus(bool reverse) OVERRIDE; | 89 virtual void TakeFocus(bool reverse) OVERRIDE; |
86 | 90 |
87 // Overridden from aura::WindowDelegate: | 91 // Overridden from aura::WindowDelegate: |
88 virtual gfx::Size GetMinimumSize() const OVERRIDE; | 92 virtual gfx::Size GetMinimumSize() const OVERRIDE; |
89 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, | 93 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, |
90 const gfx::Rect& new_bounds) OVERRIDE; | 94 const gfx::Rect& new_bounds) OVERRIDE; |
91 virtual void OnFocus(aura::Window* old_focused_window) OVERRIDE; | 95 virtual void OnFocus(aura::Window* old_focused_window) OVERRIDE; |
92 virtual void OnBlur() OVERRIDE; | 96 virtual void OnBlur() OVERRIDE; |
93 virtual bool OnKeyEvent(aura::KeyEvent* event) OVERRIDE; | 97 virtual bool OnKeyEvent(ui::KeyEvent* event) OVERRIDE; |
94 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE; | 98 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE; |
95 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE; | 99 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE; |
96 virtual bool ShouldDescendIntoChildForEventHandling( | 100 virtual bool ShouldDescendIntoChildForEventHandling( |
97 aura::Window* child, | 101 aura::Window* child, |
98 const gfx::Point& location) OVERRIDE; | 102 const gfx::Point& location) OVERRIDE; |
99 virtual bool OnMouseEvent(aura::MouseEvent* event) OVERRIDE; | 103 virtual bool OnMouseEvent(ui::MouseEvent* event) OVERRIDE; |
100 virtual ui::TouchStatus OnTouchEvent(aura::TouchEvent* event) OVERRIDE; | 104 virtual ui::TouchStatus OnTouchEvent(ui::TouchEventImpl* event) OVERRIDE; |
101 virtual ui::GestureStatus OnGestureEvent(aura::GestureEvent* event) OVERRIDE; | 105 virtual ui::GestureStatus OnGestureEvent( |
| 106 ui::GestureEventImpl* event) OVERRIDE; |
102 virtual bool CanFocus() OVERRIDE; | 107 virtual bool CanFocus() OVERRIDE; |
103 virtual void OnCaptureLost() OVERRIDE; | 108 virtual void OnCaptureLost() OVERRIDE; |
104 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 109 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
105 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; | 110 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; |
106 virtual void OnWindowDestroying() OVERRIDE; | 111 virtual void OnWindowDestroying() OVERRIDE; |
107 virtual void OnWindowDestroyed() OVERRIDE; | 112 virtual void OnWindowDestroyed() OVERRIDE; |
108 virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE; | 113 virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE; |
109 virtual bool HasHitTestMask() const OVERRIDE; | 114 virtual bool HasHitTestMask() const OVERRIDE; |
110 virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE; | 115 virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE; |
111 | 116 |
112 // Overridden from aura::client::DragDropDelegate: | 117 // Overridden from aura::client::DragDropDelegate: |
113 virtual void OnDragEntered(const aura::DropTargetEvent& event) OVERRIDE; | 118 virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE; |
114 virtual int OnDragUpdated(const aura::DropTargetEvent& event) OVERRIDE; | 119 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; |
115 virtual void OnDragExited() OVERRIDE; | 120 virtual void OnDragExited() OVERRIDE; |
116 virtual int OnPerformDrop(const aura::DropTargetEvent& event) OVERRIDE; | 121 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; |
117 | 122 |
118 gfx::Size initial_size_; | 123 gfx::Size initial_size_; |
119 | 124 |
120 scoped_ptr<aura::Window> window_; | 125 scoped_ptr<aura::Window> window_; |
121 | 126 |
122 // The WebContentsImpl whose contents we display. | 127 // The WebContentsImpl whose contents we display. |
123 WebContentsImpl* web_contents_; | 128 WebContentsImpl* web_contents_; |
124 | 129 |
125 content::RenderWidgetHostView* view_; | 130 content::RenderWidgetHostView* view_; |
126 | 131 |
(...skipping 10 matching lines...) Expand all Loading... |
137 // We keep track of the render view host we're dragging over. If it changes | 142 // We keep track of the render view host we're dragging over. If it changes |
138 // during a drag, we need to re-send the DragEnter message. WARNING: | 143 // during a drag, we need to re-send the DragEnter message. WARNING: |
139 // this pointer should never be dereferenced. We only use it for comparing | 144 // this pointer should never be dereferenced. We only use it for comparing |
140 // pointers. | 145 // pointers. |
141 void* current_rvh_for_drag_; | 146 void* current_rvh_for_drag_; |
142 | 147 |
143 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); | 148 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); |
144 }; | 149 }; |
145 | 150 |
146 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ | 151 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ |
OLD | NEW |