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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.h

Issue 759433002: Reland: Move TouchSelectionController from content to ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Excluded ui/touch_selection from Windows GN build Created 6 years 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_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
7 7
8 #include <map> 8 #include <map>
9 #include <queue> 9 #include <queue>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/i18n/rtl.h" 13 #include "base/i18n/rtl.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/process/process.h" 16 #include "base/process/process.h"
17 #include "cc/layers/delegated_frame_resource_collection.h" 17 #include "cc/layers/delegated_frame_resource_collection.h"
18 #include "cc/output/begin_frame_args.h" 18 #include "cc/output/begin_frame_args.h"
19 #include "content/browser/accessibility/browser_accessibility_manager.h" 19 #include "content/browser/accessibility/browser_accessibility_manager.h"
20 #include "content/browser/renderer_host/delegated_frame_evictor.h" 20 #include "content/browser/renderer_host/delegated_frame_evictor.h"
21 #include "content/browser/renderer_host/ime_adapter_android.h" 21 #include "content/browser/renderer_host/ime_adapter_android.h"
22 #include "content/browser/renderer_host/input/stylus_text_selector.h" 22 #include "content/browser/renderer_host/input/stylus_text_selector.h"
23 #include "content/browser/renderer_host/input/touch_selection_controller.h"
24 #include "content/browser/renderer_host/render_widget_host_view_base.h" 23 #include "content/browser/renderer_host/render_widget_host_view_base.h"
25 #include "content/common/content_export.h" 24 #include "content/common/content_export.h"
26 #include "content/public/browser/readback_types.h" 25 #include "content/public/browser/readback_types.h"
27 #include "gpu/command_buffer/common/mailbox.h" 26 #include "gpu/command_buffer/common/mailbox.h"
28 #include "third_party/skia/include/core/SkColor.h" 27 #include "third_party/skia/include/core/SkColor.h"
29 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" 28 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
30 #include "ui/base/android/window_android_observer.h" 29 #include "ui/base/android/window_android_observer.h"
31 #include "ui/events/gesture_detection/filtered_gesture_provider.h" 30 #include "ui/events/gesture_detection/filtered_gesture_provider.h"
32 #include "ui/gfx/geometry/size.h" 31 #include "ui/gfx/geometry/size.h"
33 #include "ui/gfx/geometry/vector2d_f.h" 32 #include "ui/gfx/geometry/vector2d_f.h"
33 #include "ui/touch_selection/touch_selection_controller.h"
34 34
35 struct ViewHostMsg_TextInputState_Params; 35 struct ViewHostMsg_TextInputState_Params;
36 36
37 namespace cc { 37 namespace cc {
38 class CopyOutputResult; 38 class CopyOutputResult;
39 class DelegatedFrameProvider; 39 class DelegatedFrameProvider;
40 class DelegatedRendererLayer; 40 class DelegatedRendererLayer;
41 class Layer; 41 class Layer;
42 } 42 }
43 43
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // ----------------------------------------------------------------------------- 78 // -----------------------------------------------------------------------------
79 // See comments in render_widget_host_view.h about this class and its members. 79 // See comments in render_widget_host_view.h about this class and its members.
80 // ----------------------------------------------------------------------------- 80 // -----------------------------------------------------------------------------
81 class CONTENT_EXPORT RenderWidgetHostViewAndroid 81 class CONTENT_EXPORT RenderWidgetHostViewAndroid
82 : public RenderWidgetHostViewBase, 82 : public RenderWidgetHostViewBase,
83 public cc::DelegatedFrameResourceCollectionClient, 83 public cc::DelegatedFrameResourceCollectionClient,
84 public ui::GestureProviderClient, 84 public ui::GestureProviderClient,
85 public ui::WindowAndroidObserver, 85 public ui::WindowAndroidObserver,
86 public DelegatedFrameEvictorClient, 86 public DelegatedFrameEvictorClient,
87 public StylusTextSelectorClient, 87 public StylusTextSelectorClient,
88 public TouchSelectionControllerClient { 88 public ui::TouchSelectionControllerClient {
89 public: 89 public:
90 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, 90 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget,
91 ContentViewCoreImpl* content_view_core); 91 ContentViewCoreImpl* content_view_core);
92 virtual ~RenderWidgetHostViewAndroid(); 92 virtual ~RenderWidgetHostViewAndroid();
93 93
94 // RenderWidgetHostView implementation. 94 // RenderWidgetHostView implementation.
95 virtual bool OnMessageReceived(const IPC::Message& msg) override; 95 virtual bool OnMessageReceived(const IPC::Message& msg) override;
96 virtual void InitAsChild(gfx::NativeView parent_view) override; 96 virtual void InitAsChild(gfx::NativeView parent_view) override;
97 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, 97 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
98 const gfx::Rect& pos) override; 98 const gfx::Rect& pos) override;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 virtual void EvictDelegatedFrame() override; 200 virtual void EvictDelegatedFrame() override;
201 201
202 virtual SkColorType PreferredReadbackFormat() override; 202 virtual SkColorType PreferredReadbackFormat() override;
203 203
204 // StylusTextSelectorClient implementation. 204 // StylusTextSelectorClient implementation.
205 void OnStylusSelectBegin(float x0, float y0, float x1, float y1) override; 205 void OnStylusSelectBegin(float x0, float y0, float x1, float y1) override;
206 void OnStylusSelectUpdate(float x, float y) override; 206 void OnStylusSelectUpdate(float x, float y) override;
207 void OnStylusSelectEnd() override; 207 void OnStylusSelectEnd() override;
208 void OnStylusSelectTap(base::TimeTicks time, float x, float y) override; 208 void OnStylusSelectTap(base::TimeTicks time, float x, float y) override;
209 209
210 // TouchSelectionControllerClient implementation. 210 // ui::TouchSelectionControllerClient implementation.
211 virtual bool SupportsAnimation() const override; 211 virtual bool SupportsAnimation() const override;
212 virtual void SetNeedsAnimate() override; 212 virtual void SetNeedsAnimate() override;
213 virtual void MoveCaret(const gfx::PointF& position) override; 213 virtual void MoveCaret(const gfx::PointF& position) override;
214 virtual void MoveRangeSelectionExtent(const gfx::PointF& extent) override; 214 virtual void MoveRangeSelectionExtent(const gfx::PointF& extent) override;
215 virtual void SelectBetweenCoordinates(const gfx::PointF& base, 215 virtual void SelectBetweenCoordinates(const gfx::PointF& base,
216 const gfx::PointF& extent) override; 216 const gfx::PointF& extent) override;
217 virtual void OnSelectionEvent(SelectionEventType event, 217 virtual void OnSelectionEvent(ui::SelectionEventType event,
218 const gfx::PointF& anchor_position) override; 218 const gfx::PointF& anchor_position) override;
219 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() override; 219 virtual scoped_ptr<ui::TouchHandleDrawable> CreateDrawable() override;
220 220
221 // Non-virtual methods 221 // Non-virtual methods
222 void SetContentViewCore(ContentViewCoreImpl* content_view_core); 222 void SetContentViewCore(ContentViewCoreImpl* content_view_core);
223 SkColor GetCachedBackgroundColor() const; 223 SkColor GetCachedBackgroundColor() const;
224 void SendKeyEvent(const NativeWebKeyboardEvent& event); 224 void SendKeyEvent(const NativeWebKeyboardEvent& event);
225 void SendMouseEvent(const blink::WebMouseEvent& event); 225 void SendMouseEvent(const blink::WebMouseEvent& event);
226 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); 226 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event);
227 void SendGestureEvent(const blink::WebGestureEvent& event); 227 void SendGestureEvent(const blink::WebGestureEvent& event);
228 228
229 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); 229 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 375
376 // Provides gesture synthesis given a stream of touch events (derived from 376 // Provides gesture synthesis given a stream of touch events (derived from
377 // Android MotionEvent's) and touch event acks. 377 // Android MotionEvent's) and touch event acks.
378 ui::FilteredGestureProvider gesture_provider_; 378 ui::FilteredGestureProvider gesture_provider_;
379 379
380 // Handles gesture based text selection 380 // Handles gesture based text selection
381 StylusTextSelector stylus_text_selector_; 381 StylusTextSelector stylus_text_selector_;
382 382
383 // Manages selection handle rendering and manipulation. 383 // Manages selection handle rendering and manipulation.
384 // This will always be NULL if |content_view_core_| is NULL. 384 // This will always be NULL if |content_view_core_| is NULL.
385 scoped_ptr<TouchSelectionController> selection_controller_; 385 scoped_ptr<ui::TouchSelectionController> selection_controller_;
386 386
387 int accelerated_surface_route_id_; 387 int accelerated_surface_route_id_;
388 388
389 // Size to use if we have no backing ContentViewCore 389 // Size to use if we have no backing ContentViewCore
390 gfx::Size default_size_; 390 gfx::Size default_size_;
391 391
392 const bool using_browser_compositor_; 392 const bool using_browser_compositor_;
393 393
394 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; 394 scoped_ptr<DelegatedFrameEvictor> frame_evictor_;
395 395
(...skipping 19 matching lines...) Expand all
415 gfx::Vector2dF last_scroll_offset_; 415 gfx::Vector2dF last_scroll_offset_;
416 416
417 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; 417 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_;
418 418
419 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); 419 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
420 }; 420 };
421 421
422 } // namespace content 422 } // namespace content
423 423
424 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 424 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698