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