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

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: do not select text when two buttons are pressed 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;
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;
239 virtual void SelectRange(float x1, float y1, float x2, float y2) OVERRIDE;
240 virtual void SelectWord(float x, float y) OVERRIDE;
241 virtual void Unselect() OVERRIDE;
242
234 private: 243 private:
235 void RunAckCallbacks(); 244 void RunAckCallbacks();
236 245
237 void DestroyDelegatedContent(); 246 void DestroyDelegatedContent();
238 void SwapDelegatedFrame(uint32 output_surface_id, 247 void SwapDelegatedFrame(uint32 output_surface_id,
239 scoped_ptr<cc::DelegatedFrameData> frame_data); 248 scoped_ptr<cc::DelegatedFrameData> frame_data);
240 void SendDelegatedFrameAck(uint32 output_surface_id); 249 void SendDelegatedFrameAck(uint32 output_surface_id);
241 void SendReturnedDelegatedResources(uint32 output_surface_id); 250 void SendReturnedDelegatedResources(uint32 output_surface_id);
242 251
243 void OnFrameMetadataUpdated( 252 void OnFrameMetadataUpdated(
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 scoped_ptr<cc::CompositorFrame> output_frame); 363 scoped_ptr<cc::CompositorFrame> output_frame);
355 ~LastFrameInfo(); 364 ~LastFrameInfo();
356 uint32 output_surface_id; 365 uint32 output_surface_id;
357 scoped_ptr<cc::CompositorFrame> frame; 366 scoped_ptr<cc::CompositorFrame> frame;
358 }; 367 };
359 368
360 scoped_ptr<LastFrameInfo> last_frame_info_; 369 scoped_ptr<LastFrameInfo> last_frame_info_;
361 370
362 TextSurroundingSelectionCallback text_surrounding_selection_callback_; 371 TextSurroundingSelectionCallback text_surrounding_selection_callback_;
363 372
373 scoped_ptr<GestureTextSelector> gesture_text_selector_;
jdduke (slow) 2014/06/24 15:38:37 I don't think we need to heap allocate this, I wou
Changwan Ryu 2014/06/25 07:26:21 Done.
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