| 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/wm/public/drag_drop_delegate.h" | 18 #include "ui/wm/public/drag_drop_delegate.h" |
| 19 | 19 |
| 20 namespace aura { | 20 namespace aura { |
| 21 class Window; | 21 class Window; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace ui { | 24 namespace ui { |
| 25 class DropTargetEvent; | 25 class DropTargetEvent; |
| 26 class TouchSelectionController; |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace content { | 29 namespace content { |
| 29 class GestureNavSimple; | 30 class GestureNavSimple; |
| 30 class OverscrollNavigationOverlay; | 31 class OverscrollNavigationOverlay; |
| 31 class RenderWidgetHostImpl; | 32 class RenderWidgetHostImpl; |
| 32 class RenderWidgetHostViewAura; | 33 class RenderWidgetHostViewAura; |
| 33 class ShadowLayerDelegate; | 34 class ShadowLayerDelegate; |
| 34 class TouchEditableImplAura; | |
| 35 class WebContentsViewDelegate; | 35 class WebContentsViewDelegate; |
| 36 class WebContentsImpl; | 36 class WebContentsImpl; |
| 37 class WebDragDestDelegate; | 37 class WebDragDestDelegate; |
| 38 | 38 |
| 39 class WebContentsViewAura | 39 class WebContentsViewAura |
| 40 : public WebContentsView, | 40 : public WebContentsView, |
| 41 public RenderViewHostDelegateView, | 41 public RenderViewHostDelegateView, |
| 42 public OverscrollControllerDelegate, | 42 public OverscrollControllerDelegate, |
| 43 public aura::WindowDelegate, | 43 public aura::WindowDelegate, |
| 44 public aura::client::DragDropDelegate, | 44 public aura::client::DragDropDelegate, |
| 45 public aura::WindowObserver { | 45 public aura::WindowObserver { |
| 46 public: | 46 public: |
| 47 WebContentsViewAura(WebContentsImpl* web_contents, | 47 WebContentsViewAura(WebContentsImpl* web_contents, |
| 48 WebContentsViewDelegate* delegate); | 48 WebContentsViewDelegate* delegate); |
| 49 | 49 |
| 50 CONTENT_EXPORT void SetTouchEditableForTest( | |
| 51 TouchEditableImplAura* touch_editable); | |
| 52 | |
| 53 private: | 50 private: |
| 54 class WindowObserver; | 51 class WindowObserver; |
| 55 | 52 |
| 56 ~WebContentsViewAura() override; | 53 ~WebContentsViewAura() override; |
| 57 | 54 |
| 58 void SizeChangedCommon(const gfx::Size& size); | 55 void SizeChangedCommon(const gfx::Size& size); |
| 59 | 56 |
| 60 void EndDrag(blink::WebDragOperationsMask ops); | 57 void EndDrag(blink::WebDragOperationsMask ops); |
| 61 | 58 |
| 62 void InstallOverscrollControllerDelegate(RenderWidgetHostViewAura* view); | 59 void InstallOverscrollControllerDelegate(RenderWidgetHostViewAura* view); |
| 63 | 60 |
| 64 // Sets up the content window in preparation for starting an overscroll | 61 // Sets up the content window in preparation for starting an overscroll |
| 65 // gesture. | 62 // gesture. |
| 66 void PrepareContentWindowForOverscroll(); | 63 void PrepareContentWindowForOverscroll(); |
| 67 | 64 |
| 68 // Completes the navigation in response to a completed overscroll gesture. | 65 // Completes the navigation in response to a completed overscroll gesture. |
| 69 // The navigation happens after an animation (either the overlay window | 66 // The navigation happens after an animation (either the overlay window |
| 70 // animates in, or the content window animates out). | 67 // animates in, or the content window animates out). |
| 71 void CompleteOverscrollNavigation(OverscrollMode mode); | 68 void CompleteOverscrollNavigation(OverscrollMode mode); |
| 72 | 69 |
| 73 void AttachTouchEditableToRenderView(); | 70 void OverscrollUpdateForWebContentsDelegate(float delta_y); |
| 74 | 71 |
| 75 void OverscrollUpdateForWebContentsDelegate(float delta_y); | 72 ui::TouchSelectionController* GetSelectionController(); |
| 76 | 73 |
| 77 // Overridden from WebContentsView: | 74 // Overridden from WebContentsView: |
| 78 gfx::NativeView GetNativeView() const override; | 75 gfx::NativeView GetNativeView() const override; |
| 79 gfx::NativeView GetContentNativeView() const override; | 76 gfx::NativeView GetContentNativeView() const override; |
| 80 gfx::NativeWindow GetTopLevelNativeWindow() const override; | 77 gfx::NativeWindow GetTopLevelNativeWindow() const override; |
| 81 void GetContainerBounds(gfx::Rect* out) const override; | 78 void GetContainerBounds(gfx::Rect* out) const override; |
| 82 void SizeContents(const gfx::Size& size) override; | 79 void SizeContents(const gfx::Size& size) override; |
| 83 void Focus() override; | 80 void Focus() override; |
| 84 void SetInitialFocus() override; | 81 void SetInitialFocus() override; |
| 85 void StoreFocus() override; | 82 void StoreFocus() override; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 OverscrollMode current_overscroll_gesture_; | 182 OverscrollMode current_overscroll_gesture_; |
| 186 | 183 |
| 187 // This is the completed overscroll gesture. This is used for the animation | 184 // This is the completed overscroll gesture. This is used for the animation |
| 188 // callback that happens in response to a completed overscroll gesture. | 185 // callback that happens in response to a completed overscroll gesture. |
| 189 OverscrollMode completed_overscroll_gesture_; | 186 OverscrollMode completed_overscroll_gesture_; |
| 190 | 187 |
| 191 // This manages the overlay window that shows the screenshot during a history | 188 // This manages the overlay window that shows the screenshot during a history |
| 192 // navigation triggered by the overscroll gesture. | 189 // navigation triggered by the overscroll gesture. |
| 193 scoped_ptr<OverscrollNavigationOverlay> navigation_overlay_; | 190 scoped_ptr<OverscrollNavigationOverlay> navigation_overlay_; |
| 194 | 191 |
| 195 scoped_ptr<TouchEditableImplAura> touch_editable_; | |
| 196 scoped_ptr<GestureNavSimple> gesture_nav_simple_; | 192 scoped_ptr<GestureNavSimple> gesture_nav_simple_; |
| 197 | 193 |
| 198 // On Windows we can run into problems if resources get released within the | 194 // On Windows we can run into problems if resources get released within the |
| 199 // initialization phase while the content (and its dimensions) are not known. | 195 // initialization phase while the content (and its dimensions) are not known. |
| 200 bool is_or_was_visible_; | 196 bool is_or_was_visible_; |
| 201 | 197 |
| 202 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); | 198 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); |
| 203 }; | 199 }; |
| 204 | 200 |
| 205 } // namespace content | 201 } // namespace content |
| 206 | 202 |
| 207 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ | 203 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ |
| OLD | NEW |