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

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

Issue 342633003: [Android] Select text when stylus first button is pressed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed nits and moved mock_motion_event Created 6 years, 6 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_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/image_transport_factory_android.h" 21 #include "content/browser/renderer_host/image_transport_factory_android.h"
22 #include "content/browser/renderer_host/ime_adapter_android.h" 22 #include "content/browser/renderer_host/ime_adapter_android.h"
23 #include "content/browser/renderer_host/input/gesture_text_selector.h"
23 #include "content/browser/renderer_host/render_widget_host_view_base.h" 24 #include "content/browser/renderer_host/render_widget_host_view_base.h"
24 #include "content/common/content_export.h" 25 #include "content/common/content_export.h"
25 #include "gpu/command_buffer/common/mailbox.h" 26 #include "gpu/command_buffer/common/mailbox.h"
26 #include "third_party/skia/include/core/SkColor.h" 27 #include "third_party/skia/include/core/SkColor.h"
27 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" 28 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
28 #include "ui/base/android/window_android_observer.h" 29 #include "ui/base/android/window_android_observer.h"
29 #include "ui/events/gesture_detection/filtered_gesture_provider.h" 30 #include "ui/events/gesture_detection/filtered_gesture_provider.h"
30 #include "ui/gfx/size.h" 31 #include "ui/gfx/size.h"
31 #include "ui/gfx/vector2d_f.h" 32 #include "ui/gfx/vector2d_f.h"
32 33
(...skipping 10 matching lines...) Expand all
43 } 44 }
44 45
45 namespace blink { 46 namespace blink {
46 class WebExternalTextureLayer; 47 class WebExternalTextureLayer;
47 class WebTouchEvent; 48 class WebTouchEvent;
48 class WebMouseEvent; 49 class WebMouseEvent;
49 } 50 }
50 51
51 namespace content { 52 namespace content {
52 class ContentViewCoreImpl; 53 class ContentViewCoreImpl;
54 class GestureTextSelector;
jdduke (slow) 2014/06/26 00:33:21 Nit: No need for forward decl when we include the
Changwan Ryu 2014/06/26 02:54:10 Done.
53 class OverscrollGlow; 55 class OverscrollGlow;
54 class RenderWidgetHost; 56 class RenderWidgetHost;
55 class RenderWidgetHostImpl; 57 class RenderWidgetHostImpl;
56 struct DidOverscrollParams; 58 struct DidOverscrollParams;
57 struct NativeWebKeyboardEvent; 59 struct NativeWebKeyboardEvent;
58 60
59 // ----------------------------------------------------------------------------- 61 // -----------------------------------------------------------------------------
60 // See comments in render_widget_host_view.h about this class and its members. 62 // See comments in render_widget_host_view.h about this class and its members.
61 // ----------------------------------------------------------------------------- 63 // -----------------------------------------------------------------------------
62 class CONTENT_EXPORT RenderWidgetHostViewAndroid 64 class CONTENT_EXPORT RenderWidgetHostViewAndroid
63 : public RenderWidgetHostViewBase, 65 : public RenderWidgetHostViewBase,
64 public cc::DelegatedFrameResourceCollectionClient, 66 public cc::DelegatedFrameResourceCollectionClient,
65 public ImageTransportFactoryAndroidObserver, 67 public ImageTransportFactoryAndroidObserver,
66 public ui::GestureProviderClient, 68 public ui::GestureProviderClient,
67 public ui::WindowAndroidObserver, 69 public ui::WindowAndroidObserver,
68 public DelegatedFrameEvictorClient { 70 public DelegatedFrameEvictorClient,
71 public GestureTextSelectorClient {
69 public: 72 public:
70 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, 73 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget,
71 ContentViewCoreImpl* content_view_core); 74 ContentViewCoreImpl* content_view_core);
72 virtual ~RenderWidgetHostViewAndroid(); 75 virtual ~RenderWidgetHostViewAndroid();
73 76
74 // RenderWidgetHostView implementation. 77 // RenderWidgetHostView implementation.
75 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 78 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
76 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; 79 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE;
77 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, 80 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
78 const gfx::Rect& pos) OVERRIDE; 81 const gfx::Rect& pos) OVERRIDE;
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 const cc::CompositorFrameMetadata& frame_metadata); 227 const cc::CompositorFrameMetadata& frame_metadata);
225 228
226 void SetOverlayVideoMode(bool enabled); 229 void SetOverlayVideoMode(bool enabled);
227 230
228 typedef base::Callback< 231 typedef base::Callback<
229 void(const base::string16& content, int start_offset, int end_offset)> 232 void(const base::string16& content, int start_offset, int end_offset)>
230 TextSurroundingSelectionCallback; 233 TextSurroundingSelectionCallback;
231 void SetTextSurroundingSelectionCallback( 234 void SetTextSurroundingSelectionCallback(
232 const TextSurroundingSelectionCallback& callback); 235 const TextSurroundingSelectionCallback& callback);
233 236
237 // GestureTextSelectorClient implementation.
238 virtual void ShowSelectionHandlesAutomatically() OVERRIDE;
aelias_OOO_until_Jul13 2014/06/26 01:12:39 nit: move these up next to the other virtual metho
Changwan Ryu 2014/06/26 02:54:10 Done.
239 virtual void SelectRange(float x1, float y1, float x2, float y2) OVERRIDE;
240 virtual void Unselect() OVERRIDE;
241
234 private: 242 private:
235 void RunAckCallbacks(); 243 void RunAckCallbacks();
236 244
237 void DestroyDelegatedContent(); 245 void DestroyDelegatedContent();
238 void SwapDelegatedFrame(uint32 output_surface_id, 246 void SwapDelegatedFrame(uint32 output_surface_id,
239 scoped_ptr<cc::DelegatedFrameData> frame_data); 247 scoped_ptr<cc::DelegatedFrameData> frame_data);
240 void SendDelegatedFrameAck(uint32 output_surface_id); 248 void SendDelegatedFrameAck(uint32 output_surface_id);
241 void SendReturnedDelegatedResources(uint32 output_surface_id); 249 void SendReturnedDelegatedResources(uint32 output_surface_id);
242 250
243 void OnFrameMetadataUpdated( 251 void OnFrameMetadataUpdated(
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 336
329 const bool overscroll_effect_enabled_; 337 const bool overscroll_effect_enabled_;
330 // Used to render overscroll overlays. 338 // Used to render overscroll overlays.
331 // Note: |overscroll_effect_| will never be NULL, even if it's never enabled. 339 // Note: |overscroll_effect_| will never be NULL, even if it's never enabled.
332 scoped_ptr<OverscrollGlow> overscroll_effect_; 340 scoped_ptr<OverscrollGlow> overscroll_effect_;
333 341
334 // Provides gesture synthesis given a stream of touch events (derived from 342 // Provides gesture synthesis given a stream of touch events (derived from
335 // Android MotionEvent's) and touch event acks. 343 // Android MotionEvent's) and touch event acks.
336 ui::FilteredGestureProvider gesture_provider_; 344 ui::FilteredGestureProvider gesture_provider_;
337 345
346 // Handles gesture based text selection
347 GestureTextSelector gesture_text_selector_;
348
338 bool flush_input_requested_; 349 bool flush_input_requested_;
339 350
340 int accelerated_surface_route_id_; 351 int accelerated_surface_route_id_;
341 352
342 // Size to use if we have no backing ContentViewCore 353 // Size to use if we have no backing ContentViewCore
343 gfx::Size default_size_; 354 gfx::Size default_size_;
344 355
345 const bool using_synchronous_compositor_; 356 const bool using_synchronous_compositor_;
346 357
347 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; 358 scoped_ptr<DelegatedFrameEvictor> frame_evictor_;
(...skipping 12 matching lines...) Expand all
360 scoped_ptr<LastFrameInfo> last_frame_info_; 371 scoped_ptr<LastFrameInfo> last_frame_info_;
361 372
362 TextSurroundingSelectionCallback text_surrounding_selection_callback_; 373 TextSurroundingSelectionCallback text_surrounding_selection_callback_;
363 374
364 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); 375 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
365 }; 376 };
366 377
367 } // namespace content 378 } // namespace content
368 379
369 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 380 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698