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

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: Created 6 years, 1 month 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"
(...skipping 19 matching lines...) Expand all
30 namespace ui { 30 namespace ui {
31 class DropTargetEvent; 31 class DropTargetEvent;
32 } 32 }
33 33
34 namespace content { 34 namespace content {
35 class GestureNavSimple; 35 class GestureNavSimple;
36 class OverscrollNavigationOverlay; 36 class OverscrollNavigationOverlay;
37 class RenderWidgetHostImpl; 37 class RenderWidgetHostImpl;
38 class RenderWidgetHostViewAura; 38 class RenderWidgetHostViewAura;
39 class ShadowLayerDelegate; 39 class ShadowLayerDelegate;
40 class TouchEditableImplAura;
41 class WebContentsViewDelegate; 40 class WebContentsViewDelegate;
42 class WebContentsImpl; 41 class WebContentsImpl;
43 class WebDragDestDelegate; 42 class WebDragDestDelegate;
44 43
45 #if defined(OS_WIN) 44 #if defined(OS_WIN)
46 class LegacyRenderWidgetHostHWND; 45 class LegacyRenderWidgetHostHWND;
47 #endif 46 #endif
48 47
49 class WebContentsViewAura 48 class WebContentsViewAura
50 : public WebContentsView, 49 : public WebContentsView,
51 #if defined(OS_WIN) 50 #if defined(OS_WIN)
52 public LegacyRenderWidgetHostHWNDDelegate, 51 public LegacyRenderWidgetHostHWNDDelegate,
53 #endif 52 #endif
54 public RenderViewHostDelegateView, 53 public RenderViewHostDelegateView,
55 public OverscrollControllerDelegate, 54 public OverscrollControllerDelegate,
56 public ui::ImplicitAnimationObserver, 55 public ui::ImplicitAnimationObserver,
57 public aura::WindowDelegate, 56 public aura::WindowDelegate,
58 public aura::client::DragDropDelegate, 57 public aura::client::DragDropDelegate,
59 public aura::WindowObserver { 58 public aura::WindowObserver {
60 public: 59 public:
61 WebContentsViewAura(WebContentsImpl* web_contents, 60 WebContentsViewAura(WebContentsImpl* web_contents,
62 WebContentsViewDelegate* delegate); 61 WebContentsViewDelegate* delegate);
63 62
64 CONTENT_EXPORT void SetTouchEditableForTest(
65 TouchEditableImplAura* touch_editable);
66
67 private: 63 private:
68 class WindowObserver; 64 class WindowObserver;
69 65
70 ~WebContentsViewAura() override; 66 ~WebContentsViewAura() override;
71 67
72 void SizeChangedCommon(const gfx::Size& size); 68 void SizeChangedCommon(const gfx::Size& size);
73 69
74 void EndDrag(blink::WebDragOperationsMask ops); 70 void EndDrag(blink::WebDragOperationsMask ops);
75 71
76 void InstallOverscrollControllerDelegate(RenderWidgetHostViewAura* view); 72 void InstallOverscrollControllerDelegate(RenderWidgetHostViewAura* view);
(...skipping 26 matching lines...) Expand all
103 gfx::Vector2dF GetTranslationForOverscroll(float delta_x, float delta_y); 99 gfx::Vector2dF GetTranslationForOverscroll(float delta_x, float delta_y);
104 100
105 // A window showing the screenshot is overlayed during a navigation triggered 101 // A window showing the screenshot is overlayed during a navigation triggered
106 // by overscroll. This function sets this up. 102 // by overscroll. This function sets this up.
107 void PrepareOverscrollNavigationOverlay(); 103 void PrepareOverscrollNavigationOverlay();
108 104
109 // Changes the brightness of the layer depending on the amount of horizontal 105 // Changes the brightness of the layer depending on the amount of horizontal
110 // overscroll (|delta_x|, in pixels). 106 // overscroll (|delta_x|, in pixels).
111 void UpdateOverscrollWindowBrightness(float delta_x); 107 void UpdateOverscrollWindowBrightness(float delta_x);
112 108
113 void AttachTouchEditableToRenderView();
114
115 void OverscrollUpdateForWebContentsDelegate(float delta_y); 109 void OverscrollUpdateForWebContentsDelegate(float delta_y);
116 110
117 // Overridden from WebContentsView: 111 // Overridden from WebContentsView:
118 gfx::NativeView GetNativeView() const override; 112 gfx::NativeView GetNativeView() const override;
119 gfx::NativeView GetContentNativeView() const override; 113 gfx::NativeView GetContentNativeView() const override;
120 gfx::NativeWindow GetTopLevelNativeWindow() const override; 114 gfx::NativeWindow GetTopLevelNativeWindow() const override;
121 void GetContainerBounds(gfx::Rect* out) const override; 115 void GetContainerBounds(gfx::Rect* out) const override;
122 void SizeContents(const gfx::Size& size) override; 116 void SizeContents(const gfx::Size& size) override;
123 void Focus() override; 117 void Focus() override;
124 void SetInitialFocus() override; 118 void SetInitialFocus() override;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // This is the completed overscroll gesture. This is used for the animation 234 // This is the completed overscroll gesture. This is used for the animation
241 // callback that happens in response to a completed overscroll gesture. 235 // callback that happens in response to a completed overscroll gesture.
242 OverscrollMode completed_overscroll_gesture_; 236 OverscrollMode completed_overscroll_gesture_;
243 237
244 // This manages the overlay window that shows the screenshot during a history 238 // This manages the overlay window that shows the screenshot during a history
245 // navigation triggered by the overscroll gesture. 239 // navigation triggered by the overscroll gesture.
246 scoped_ptr<OverscrollNavigationOverlay> navigation_overlay_; 240 scoped_ptr<OverscrollNavigationOverlay> navigation_overlay_;
247 241
248 scoped_ptr<ShadowLayerDelegate> overscroll_shadow_; 242 scoped_ptr<ShadowLayerDelegate> overscroll_shadow_;
249 243
250 scoped_ptr<TouchEditableImplAura> touch_editable_;
251 scoped_ptr<GestureNavSimple> gesture_nav_simple_; 244 scoped_ptr<GestureNavSimple> gesture_nav_simple_;
252 245
253 #if defined(OS_WIN) 246 #if defined(OS_WIN)
254 // The LegacyRenderWidgetHostHWND class provides a dummy HWND which is used 247 // The LegacyRenderWidgetHostHWND class provides a dummy HWND which is used
255 // for accessibility, as the container for windowless plugins like 248 // for accessibility, as the container for windowless plugins like
256 // Flash/Silverlight, etc and for legacy drivers for trackpoints/trackpads, 249 // Flash/Silverlight, etc and for legacy drivers for trackpoints/trackpads,
257 // etc. 250 // etc.
258 scoped_ptr<LegacyRenderWidgetHostHWND> legacy_hwnd_; 251 scoped_ptr<LegacyRenderWidgetHostHWND> legacy_hwnd_;
259 #endif 252 #endif
260 253
261 // On Windows we can run into problems if resources get released within the 254 // On Windows we can run into problems if resources get released within the
262 // initialization phase while the content (and its dimensions) are not known. 255 // initialization phase while the content (and its dimensions) are not known.
263 bool is_or_was_visible_; 256 bool is_or_was_visible_;
264 257
265 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); 258 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura);
266 }; 259 };
267 260
268 } // namespace content 261 } // namespace content
269 262
270 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ 263 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698