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

Side by Side Diff: content/browser/web_contents/web_contents_view_aura.h

Issue 698253004: Reland: Implement Aura side of unified touch text selection for contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments Created 5 years, 5 months 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
OLDNEW
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 TouchSelectionControllerClientAura;
35 class WebContentsViewDelegate; 36 class WebContentsViewDelegate;
36 class WebContentsImpl; 37 class WebContentsImpl;
37 class WebDragDestDelegate; 38 class WebDragDestDelegate;
38 39
39 class WebContentsViewAura 40 class WebContentsViewAura
40 : public WebContentsView, 41 : public WebContentsView,
41 public RenderViewHostDelegateView, 42 public RenderViewHostDelegateView,
42 public OverscrollControllerDelegate, 43 public OverscrollControllerDelegate,
43 public aura::WindowDelegate, 44 public aura::WindowDelegate,
44 public aura::client::DragDropDelegate, 45 public aura::client::DragDropDelegate,
45 public aura::WindowObserver { 46 public aura::WindowObserver {
46 public: 47 public:
47 WebContentsViewAura(WebContentsImpl* web_contents, 48 WebContentsViewAura(WebContentsImpl* web_contents,
48 WebContentsViewDelegate* delegate); 49 WebContentsViewDelegate* delegate);
49 50
50 CONTENT_EXPORT void SetTouchEditableForTest(
51 TouchEditableImplAura* touch_editable);
52
53 private: 51 private:
54 class WindowObserver; 52 class WindowObserver;
55 53
56 ~WebContentsViewAura() override; 54 ~WebContentsViewAura() override;
57 55
58 void SizeChangedCommon(const gfx::Size& size); 56 void SizeChangedCommon(const gfx::Size& size);
59 57
60 void EndDrag(blink::WebDragOperationsMask ops); 58 void EndDrag(blink::WebDragOperationsMask ops);
61 59
62 void InstallOverscrollControllerDelegate(RenderWidgetHostViewAura* view); 60 void InstallOverscrollControllerDelegate(RenderWidgetHostViewAura* view);
63 61
64 // Sets up the content window in preparation for starting an overscroll 62 // Sets up the content window in preparation for starting an overscroll
65 // gesture. 63 // gesture.
66 void PrepareContentWindowForOverscroll(); 64 void PrepareContentWindowForOverscroll();
67 65
68 // Completes the navigation in response to a completed overscroll gesture. 66 // Completes the navigation in response to a completed overscroll gesture.
69 // The navigation happens after an animation (either the overlay window 67 // The navigation happens after an animation (either the overlay window
70 // animates in, or the content window animates out). 68 // animates in, or the content window animates out).
71 void CompleteOverscrollNavigation(OverscrollMode mode); 69 void CompleteOverscrollNavigation(OverscrollMode mode);
72 70
73 void AttachTouchEditableToRenderView(); 71 void OverscrollUpdateForWebContentsDelegate(float delta_y);
74 72
75 void OverscrollUpdateForWebContentsDelegate(float delta_y); 73 ui::TouchSelectionController* GetSelectionController() const;
74 TouchSelectionControllerClientAura* GetSelectionControllerClient() const;
76 75
77 // Overridden from WebContentsView: 76 // Overridden from WebContentsView:
78 gfx::NativeView GetNativeView() const override; 77 gfx::NativeView GetNativeView() const override;
79 gfx::NativeView GetContentNativeView() const override; 78 gfx::NativeView GetContentNativeView() const override;
80 gfx::NativeWindow GetTopLevelNativeWindow() const override; 79 gfx::NativeWindow GetTopLevelNativeWindow() const override;
81 void GetContainerBounds(gfx::Rect* out) const override; 80 void GetContainerBounds(gfx::Rect* out) const override;
82 void SizeContents(const gfx::Size& size) override; 81 void SizeContents(const gfx::Size& size) override;
83 void Focus() override; 82 void Focus() override;
84 void SetInitialFocus() override; 83 void SetInitialFocus() override;
85 void StoreFocus() override; 84 void StoreFocus() override;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 OverscrollMode current_overscroll_gesture_; 184 OverscrollMode current_overscroll_gesture_;
186 185
187 // This is the completed overscroll gesture. This is used for the animation 186 // This is the completed overscroll gesture. This is used for the animation
188 // callback that happens in response to a completed overscroll gesture. 187 // callback that happens in response to a completed overscroll gesture.
189 OverscrollMode completed_overscroll_gesture_; 188 OverscrollMode completed_overscroll_gesture_;
190 189
191 // This manages the overlay window that shows the screenshot during a history 190 // This manages the overlay window that shows the screenshot during a history
192 // navigation triggered by the overscroll gesture. 191 // navigation triggered by the overscroll gesture.
193 scoped_ptr<OverscrollNavigationOverlay> navigation_overlay_; 192 scoped_ptr<OverscrollNavigationOverlay> navigation_overlay_;
194 193
195 scoped_ptr<TouchEditableImplAura> touch_editable_;
196 scoped_ptr<GestureNavSimple> gesture_nav_simple_; 194 scoped_ptr<GestureNavSimple> gesture_nav_simple_;
197 195
198 // On Windows we can run into problems if resources get released within the 196 // 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. 197 // initialization phase while the content (and its dimensions) are not known.
200 bool is_or_was_visible_; 198 bool is_or_was_visible_;
201 199
202 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); 200 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura);
203 }; 201 };
204 202
205 } // namespace content 203 } // namespace content
206 204
207 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ 205 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698