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

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 signed unsigned comparison error 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 25 matching lines...) Expand all
58 59
59 // ----------------------------------------------------------------------------- 60 // -----------------------------------------------------------------------------
60 // See comments in render_widget_host_view.h about this class and its members. 61 // See comments in render_widget_host_view.h about this class and its members.
61 // ----------------------------------------------------------------------------- 62 // -----------------------------------------------------------------------------
62 class CONTENT_EXPORT RenderWidgetHostViewAndroid 63 class CONTENT_EXPORT RenderWidgetHostViewAndroid
63 : public RenderWidgetHostViewBase, 64 : public RenderWidgetHostViewBase,
64 public cc::DelegatedFrameResourceCollectionClient, 65 public cc::DelegatedFrameResourceCollectionClient,
65 public ImageTransportFactoryAndroidObserver, 66 public ImageTransportFactoryAndroidObserver,
66 public ui::GestureProviderClient, 67 public ui::GestureProviderClient,
67 public ui::WindowAndroidObserver, 68 public ui::WindowAndroidObserver,
68 public DelegatedFrameEvictorClient { 69 public DelegatedFrameEvictorClient,
70 public GestureTextSelectorClient {
69 public: 71 public:
70 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, 72 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget,
71 ContentViewCoreImpl* content_view_core); 73 ContentViewCoreImpl* content_view_core);
72 virtual ~RenderWidgetHostViewAndroid(); 74 virtual ~RenderWidgetHostViewAndroid();
73 75
74 // RenderWidgetHostView implementation. 76 // RenderWidgetHostView implementation.
75 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 77 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
76 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; 78 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE;
77 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, 79 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
78 const gfx::Rect& pos) OVERRIDE; 80 const gfx::Rect& pos) OVERRIDE;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 virtual void OnAnimate(base::TimeTicks begin_frame_time) OVERRIDE; 181 virtual void OnAnimate(base::TimeTicks begin_frame_time) OVERRIDE;
180 182
181 // ImageTransportFactoryAndroidObserver implementation. 183 // ImageTransportFactoryAndroidObserver implementation.
182 virtual void OnLostResources() OVERRIDE; 184 virtual void OnLostResources() OVERRIDE;
183 185
184 // DelegatedFrameEvictor implementation 186 // DelegatedFrameEvictor implementation
185 virtual void EvictDelegatedFrame() OVERRIDE; 187 virtual void EvictDelegatedFrame() OVERRIDE;
186 188
187 virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE; 189 virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE;
188 190
191 // GestureTextSelectorClient implementation.
192 virtual void ShowSelectionHandlesAutomatically() OVERRIDE;
193 virtual void SelectRange(float x1, float y1, float x2, float y2) OVERRIDE;
194 virtual void Unselect() OVERRIDE;
195
189 // Non-virtual methods 196 // Non-virtual methods
190 void SetContentViewCore(ContentViewCoreImpl* content_view_core); 197 void SetContentViewCore(ContentViewCoreImpl* content_view_core);
191 SkColor GetCachedBackgroundColor() const; 198 SkColor GetCachedBackgroundColor() const;
192 void SendKeyEvent(const NativeWebKeyboardEvent& event); 199 void SendKeyEvent(const NativeWebKeyboardEvent& event);
193 void SendTouchEvent(const blink::WebTouchEvent& event); 200 void SendTouchEvent(const blink::WebTouchEvent& event);
194 void SendMouseEvent(const blink::WebMouseEvent& event); 201 void SendMouseEvent(const blink::WebMouseEvent& event);
195 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); 202 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event);
196 void SendGestureEvent(const blink::WebGestureEvent& event); 203 void SendGestureEvent(const blink::WebGestureEvent& event);
197 204
198 void OnDidChangeBodyBackgroundColor(SkColor color); 205 void OnDidChangeBodyBackgroundColor(SkColor color);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 335
329 const bool overscroll_effect_enabled_; 336 const bool overscroll_effect_enabled_;
330 // Used to render overscroll overlays. 337 // Used to render overscroll overlays.
331 // Note: |overscroll_effect_| will never be NULL, even if it's never enabled. 338 // Note: |overscroll_effect_| will never be NULL, even if it's never enabled.
332 scoped_ptr<OverscrollGlow> overscroll_effect_; 339 scoped_ptr<OverscrollGlow> overscroll_effect_;
333 340
334 // Provides gesture synthesis given a stream of touch events (derived from 341 // Provides gesture synthesis given a stream of touch events (derived from
335 // Android MotionEvent's) and touch event acks. 342 // Android MotionEvent's) and touch event acks.
336 ui::FilteredGestureProvider gesture_provider_; 343 ui::FilteredGestureProvider gesture_provider_;
337 344
345 // Handles gesture based text selection
346 GestureTextSelector gesture_text_selector_;
347
338 bool flush_input_requested_; 348 bool flush_input_requested_;
339 349
340 int accelerated_surface_route_id_; 350 int accelerated_surface_route_id_;
341 351
342 // Size to use if we have no backing ContentViewCore 352 // Size to use if we have no backing ContentViewCore
343 gfx::Size default_size_; 353 gfx::Size default_size_;
344 354
345 const bool using_synchronous_compositor_; 355 const bool using_synchronous_compositor_;
346 356
347 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; 357 scoped_ptr<DelegatedFrameEvictor> frame_evictor_;
(...skipping 12 matching lines...) Expand all
360 scoped_ptr<LastFrameInfo> last_frame_info_; 370 scoped_ptr<LastFrameInfo> last_frame_info_;
361 371
362 TextSurroundingSelectionCallback text_surrounding_selection_callback_; 372 TextSurroundingSelectionCallback text_surrounding_selection_callback_;
363 373
364 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); 374 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
365 }; 375 };
366 376
367 } // namespace content 377 } // namespace content
368 378
369 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 379 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698