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/browser/renderer_host/overscroll_controller_delegate.h" | 12 #include "content/browser/renderer_host/overscroll_controller_delegate.h" |
13 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 13 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
14 #include "content/browser/web_contents/web_contents_view.h" | 14 #include "content/browser/web_contents/web_contents_view.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "ui/aura/window_delegate.h" | 16 #include "ui/aura/window_delegate.h" |
17 #include "ui/aura/window_observer.h" | 17 #include "ui/aura/window_observer.h" |
18 #include "ui/compositor/layer_animation_observer.h" | 18 #include "ui/compositor/layer_animation_observer.h" |
19 #include "ui/wm/public/drag_drop_delegate.h" | 19 #include "ui/wm/public/drag_drop_delegate.h" |
20 | 20 |
| 21 #if defined(OS_WIN) |
| 22 #include "content/browser/renderer_host/legacy_render_widget_host_win.h" |
| 23 #include "content/browser/renderer_host/legacy_render_widget_host_win_delegate.h
" |
| 24 #endif |
| 25 |
21 namespace aura { | 26 namespace aura { |
22 class Window; | 27 class Window; |
23 } | 28 } |
24 | 29 |
25 namespace ui { | 30 namespace ui { |
26 class DropTargetEvent; | 31 class DropTargetEvent; |
27 } | 32 } |
28 | 33 |
29 namespace content { | 34 namespace content { |
30 class GestureNavSimple; | 35 class GestureNavSimple; |
31 class OverscrollNavigationOverlay; | 36 class OverscrollNavigationOverlay; |
32 class RenderWidgetHostImpl; | 37 class RenderWidgetHostImpl; |
33 class RenderWidgetHostViewAura; | 38 class RenderWidgetHostViewAura; |
34 class ShadowLayerDelegate; | 39 class ShadowLayerDelegate; |
35 class TouchEditableImplAura; | 40 class TouchEditableImplAura; |
36 class WebContentsViewDelegate; | 41 class WebContentsViewDelegate; |
37 class WebContentsImpl; | 42 class WebContentsImpl; |
38 class WebDragDestDelegate; | 43 class WebDragDestDelegate; |
39 | 44 |
| 45 #if defined(OS_WIN) |
| 46 class LegacyRenderWidgetHostHWND; |
| 47 #endif |
| 48 |
40 class WebContentsViewAura | 49 class WebContentsViewAura |
41 : public WebContentsView, | 50 : public WebContentsView, |
| 51 #if defined(OS_WIN) |
| 52 public LegacyRenderWidgetHostHWNDDelegate, |
| 53 #endif |
42 public RenderViewHostDelegateView, | 54 public RenderViewHostDelegateView, |
43 public OverscrollControllerDelegate, | 55 public OverscrollControllerDelegate, |
44 public ui::ImplicitAnimationObserver, | 56 public ui::ImplicitAnimationObserver, |
45 public aura::WindowDelegate, | 57 public aura::WindowDelegate, |
46 public aura::client::DragDropDelegate, | 58 public aura::client::DragDropDelegate, |
47 public aura::WindowObserver { | 59 public aura::WindowObserver { |
48 public: | 60 public: |
49 WebContentsViewAura(WebContentsImpl* web_contents, | 61 WebContentsViewAura(WebContentsImpl* web_contents, |
50 WebContentsViewDelegate* delegate); | 62 WebContentsViewDelegate* delegate); |
51 | 63 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 virtual void OnDragExited() override; | 195 virtual void OnDragExited() override; |
184 virtual int OnPerformDrop(const ui::DropTargetEvent& event) override; | 196 virtual int OnPerformDrop(const ui::DropTargetEvent& event) override; |
185 | 197 |
186 // Overridden from aura::WindowObserver: | 198 // Overridden from aura::WindowObserver: |
187 virtual void OnWindowVisibilityChanged(aura::Window* window, | 199 virtual void OnWindowVisibilityChanged(aura::Window* window, |
188 bool visible) override; | 200 bool visible) override; |
189 | 201 |
190 // Update the web contents visiblity. | 202 // Update the web contents visiblity. |
191 void UpdateWebContentsVisibility(bool visible); | 203 void UpdateWebContentsVisibility(bool visible); |
192 | 204 |
| 205 #if defined(OS_WIN) |
| 206 // Overridden from LegacyRenderWidgetHostHWNDDelegate: |
| 207 virtual gfx::NativeViewAccessible GetNativeViewAccessible() override; |
| 208 #endif |
| 209 |
193 scoped_ptr<aura::Window> window_; | 210 scoped_ptr<aura::Window> window_; |
194 | 211 |
195 // The window that shows the screenshot of the history page during an | 212 // The window that shows the screenshot of the history page during an |
196 // overscroll navigation gesture. | 213 // overscroll navigation gesture. |
197 scoped_ptr<aura::Window> overscroll_window_; | 214 scoped_ptr<aura::Window> overscroll_window_; |
198 | 215 |
199 scoped_ptr<WindowObserver> window_observer_; | 216 scoped_ptr<WindowObserver> window_observer_; |
200 | 217 |
201 // The WebContentsImpl whose contents we display. | 218 // The WebContentsImpl whose contents we display. |
202 WebContentsImpl* web_contents_; | 219 WebContentsImpl* web_contents_; |
(...skipping 23 matching lines...) Expand all Loading... |
226 | 243 |
227 // This manages the overlay window that shows the screenshot during a history | 244 // This manages the overlay window that shows the screenshot during a history |
228 // navigation triggered by the overscroll gesture. | 245 // navigation triggered by the overscroll gesture. |
229 scoped_ptr<OverscrollNavigationOverlay> navigation_overlay_; | 246 scoped_ptr<OverscrollNavigationOverlay> navigation_overlay_; |
230 | 247 |
231 scoped_ptr<ShadowLayerDelegate> overscroll_shadow_; | 248 scoped_ptr<ShadowLayerDelegate> overscroll_shadow_; |
232 | 249 |
233 scoped_ptr<TouchEditableImplAura> touch_editable_; | 250 scoped_ptr<TouchEditableImplAura> touch_editable_; |
234 scoped_ptr<GestureNavSimple> gesture_nav_simple_; | 251 scoped_ptr<GestureNavSimple> gesture_nav_simple_; |
235 | 252 |
| 253 #if defined(OS_WIN) |
| 254 // The LegacyRenderWidgetHostHWND class provides a dummy HWND which is used |
| 255 // for accessibility, as the container for windowless plugins like |
| 256 // Flash/Silverlight, etc and for legacy drivers for trackpoints/trackpads, |
| 257 // etc. |
| 258 scoped_ptr<LegacyRenderWidgetHostHWND> legacy_hwnd_; |
| 259 #endif |
| 260 |
236 // On Windows we can run into problems if resources get released within the | 261 // On Windows we can run into problems if resources get released within the |
237 // initialization phase while the content (and its dimensions) are not known. | 262 // initialization phase while the content (and its dimensions) are not known. |
238 bool is_or_was_visible_; | 263 bool is_or_was_visible_; |
239 | 264 |
240 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); | 265 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); |
241 }; | 266 }; |
242 | 267 |
243 } // namespace content | 268 } // namespace content |
244 | 269 |
245 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ | 270 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ |
OLD | NEW |