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

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

Issue 699333003: Support InputMethodManager#updateCursorAnchorInfo for Android 5.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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/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/render_widget_host_view_base.h" 23 #include "content/browser/renderer_host/render_widget_host_view_base.h"
24 #include "content/common/content_export.h" 24 #include "content/common/content_export.h"
25 #include "content/public/browser/readback_types.h" 25 #include "content/public/browser/readback_types.h"
26 #include "gpu/command_buffer/common/mailbox.h" 26 #include "gpu/command_buffer/common/mailbox.h"
27 #include "third_party/skia/include/core/SkColor.h" 27 #include "third_party/skia/include/core/SkColor.h"
28 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" 28 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
29 #include "ui/base/android/window_android_observer.h" 29 #include "ui/base/android/window_android_observer.h"
30 #include "ui/base/ime/android/cursor_anchor_info_sender.h"
30 #include "ui/events/gesture_detection/filtered_gesture_provider.h" 31 #include "ui/events/gesture_detection/filtered_gesture_provider.h"
31 #include "ui/gfx/geometry/size.h" 32 #include "ui/gfx/geometry/size.h"
32 #include "ui/gfx/geometry/vector2d_f.h" 33 #include "ui/gfx/geometry/vector2d_f.h"
33 #include "ui/touch_selection/touch_selection_controller.h" 34 #include "ui/touch_selection/touch_selection_controller.h"
34 35
35 struct ViewHostMsg_TextInputState_Params; 36 struct ViewHostMsg_TextInputState_Params;
36 37
37 namespace cc { 38 namespace cc {
38 class CopyOutputResult; 39 class CopyOutputResult;
39 class DelegatedFrameProvider; 40 class DelegatedFrameProvider;
40 class DelegatedRendererLayer; 41 class DelegatedRendererLayer;
41 class Layer; 42 class Layer;
42 } 43 }
43 44
44 namespace blink { 45 namespace blink {
45 class WebExternalTextureLayer; 46 class WebExternalTextureLayer;
46 class WebTouchEvent; 47 class WebTouchEvent;
47 class WebMouseEvent; 48 class WebMouseEvent;
48 } 49 }
49 50
51 namespace ui {
52 class CursorAnchorInfoBuilder;
53 class CursorAnchorInfoController;
54 }
55
50 namespace content { 56 namespace content {
51 class ContentViewCoreImpl; 57 class ContentViewCoreImpl;
52 class OverscrollControllerAndroid; 58 class OverscrollControllerAndroid;
53 class RenderWidgetHost; 59 class RenderWidgetHost;
54 class RenderWidgetHostImpl; 60 class RenderWidgetHostImpl;
55 struct DidOverscrollParams; 61 struct DidOverscrollParams;
56 struct NativeWebKeyboardEvent; 62 struct NativeWebKeyboardEvent;
57 63
58 class ReadbackRequest { 64 class ReadbackRequest {
59 public: 65 public:
(...skipping 14 matching lines...) Expand all
74 gfx::Rect src_subrect_; 80 gfx::Rect src_subrect_;
75 ReadbackRequestCallback result_callback_; 81 ReadbackRequestCallback result_callback_;
76 }; 82 };
77 83
78 // ----------------------------------------------------------------------------- 84 // -----------------------------------------------------------------------------
79 // See comments in render_widget_host_view.h about this class and its members. 85 // See comments in render_widget_host_view.h about this class and its members.
80 // ----------------------------------------------------------------------------- 86 // -----------------------------------------------------------------------------
81 class CONTENT_EXPORT RenderWidgetHostViewAndroid 87 class CONTENT_EXPORT RenderWidgetHostViewAndroid
82 : public RenderWidgetHostViewBase, 88 : public RenderWidgetHostViewBase,
83 public cc::DelegatedFrameResourceCollectionClient, 89 public cc::DelegatedFrameResourceCollectionClient,
90 public ui::CursorAnchorInfoSender,
84 public ui::GestureProviderClient, 91 public ui::GestureProviderClient,
85 public ui::WindowAndroidObserver, 92 public ui::WindowAndroidObserver,
86 public DelegatedFrameEvictorClient, 93 public DelegatedFrameEvictorClient,
87 public StylusTextSelectorClient, 94 public StylusTextSelectorClient,
88 public ui::TouchSelectionControllerClient { 95 public ui::TouchSelectionControllerClient {
89 public: 96 public:
90 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, 97 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget,
91 ContentViewCoreImpl* content_view_core); 98 ContentViewCoreImpl* content_view_core);
92 virtual ~RenderWidgetHostViewAndroid(); 99 virtual ~RenderWidgetHostViewAndroid();
93 100
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 override; 185 override;
179 virtual void LockCompositingSurface() override; 186 virtual void LockCompositingSurface() override;
180 virtual void UnlockCompositingSurface() override; 187 virtual void UnlockCompositingSurface() override;
181 virtual void OnTextSurroundingSelectionResponse(const base::string16& content, 188 virtual void OnTextSurroundingSelectionResponse(const base::string16& content,
182 size_t start_offset, 189 size_t start_offset,
183 size_t end_offset) override; 190 size_t end_offset) override;
184 191
185 // cc::DelegatedFrameResourceCollectionClient implementation. 192 // cc::DelegatedFrameResourceCollectionClient implementation.
186 virtual void UnusedResourcesAreAvailable() override; 193 virtual void UnusedResourcesAreAvailable() override;
187 194
195 // ui::CursorAnchorInfoControllerSender implementation.
196 virtual void SendCursorAnchorInfo(
197 ui::CursorAnchorInfoBuilder* builder) override;
198
188 // ui::GestureProviderClient implementation. 199 // ui::GestureProviderClient implementation.
189 virtual void OnGestureEvent(const ui::GestureEventData& gesture) override; 200 virtual void OnGestureEvent(const ui::GestureEventData& gesture) override;
190 201
191 // ui::WindowAndroidObserver implementation. 202 // ui::WindowAndroidObserver implementation.
192 virtual void OnCompositingDidCommit() override; 203 virtual void OnCompositingDidCommit() override;
193 virtual void OnAttachCompositor() override; 204 virtual void OnAttachCompositor() override;
194 virtual void OnDetachCompositor() override; 205 virtual void OnDetachCompositor() override;
195 virtual void OnVSync(base::TimeTicks frame_time, 206 virtual void OnVSync(base::TimeTicks frame_time,
196 base::TimeDelta vsync_period) override; 207 base::TimeDelta vsync_period) override;
197 virtual void OnAnimate(base::TimeTicks begin_frame_time) override; 208 virtual void OnAnimate(base::TimeTicks begin_frame_time) override;
(...skipping 21 matching lines...) Expand all
219 virtual scoped_ptr<ui::TouchHandleDrawable> CreateDrawable() override; 230 virtual scoped_ptr<ui::TouchHandleDrawable> CreateDrawable() override;
220 231
221 // Non-virtual methods 232 // Non-virtual methods
222 void SetContentViewCore(ContentViewCoreImpl* content_view_core); 233 void SetContentViewCore(ContentViewCoreImpl* content_view_core);
223 SkColor GetCachedBackgroundColor() const; 234 SkColor GetCachedBackgroundColor() const;
224 void SendKeyEvent(const NativeWebKeyboardEvent& event); 235 void SendKeyEvent(const NativeWebKeyboardEvent& event);
225 void SendMouseEvent(const blink::WebMouseEvent& event); 236 void SendMouseEvent(const blink::WebMouseEvent& event);
226 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); 237 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event);
227 void SendGestureEvent(const blink::WebGestureEvent& event); 238 void SendGestureEvent(const blink::WebGestureEvent& event);
228 239
240 bool RequestCursorUpdates(uint32 cursor_update_mode);
241
229 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); 242 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params);
230 void OnDidChangeBodyBackgroundColor(SkColor color); 243 void OnDidChangeBodyBackgroundColor(SkColor color);
231 void OnStartContentIntent(const GURL& content_url); 244 void OnStartContentIntent(const GURL& content_url);
232 void OnSetNeedsBeginFrames(bool enabled); 245 void OnSetNeedsBeginFrames(bool enabled);
233 void OnSmartClipDataExtracted(const base::string16& text, 246 void OnSmartClipDataExtracted(const base::string16& text,
234 const base::string16& html, 247 const base::string16& html,
235 const gfx::Rect rect); 248 const gfx::Rect rect);
236 249
237 bool OnTouchEvent(const ui::MotionEvent& event); 250 bool OnTouchEvent(const ui::MotionEvent& event);
238 bool OnTouchHandleEvent(const ui::MotionEvent& event); 251 bool OnTouchHandleEvent(const ui::MotionEvent& event);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 // Used to control action dispatch at the next |OnVSync()| call. 357 // Used to control action dispatch at the next |OnVSync()| call.
345 uint32 outstanding_vsync_requests_; 358 uint32 outstanding_vsync_requests_;
346 359
347 bool is_showing_; 360 bool is_showing_;
348 361
349 // ContentViewCoreImpl is our interface to the view system. 362 // ContentViewCoreImpl is our interface to the view system.
350 ContentViewCoreImpl* content_view_core_; 363 ContentViewCoreImpl* content_view_core_;
351 364
352 ImeAdapterAndroid ime_adapter_android_; 365 ImeAdapterAndroid ime_adapter_android_;
353 366
367 scoped_ptr<ui::CursorAnchorInfoController> cursor_anchor_info_controller_;
368
354 // Body background color of the underlying document. 369 // Body background color of the underlying document.
355 SkColor cached_background_color_; 370 SkColor cached_background_color_;
356 371
357 scoped_refptr<cc::DelegatedFrameResourceCollection> resource_collection_; 372 scoped_refptr<cc::DelegatedFrameResourceCollection> resource_collection_;
358 scoped_refptr<cc::DelegatedFrameProvider> frame_provider_; 373 scoped_refptr<cc::DelegatedFrameProvider> frame_provider_;
359 scoped_refptr<cc::DelegatedRendererLayer> layer_; 374 scoped_refptr<cc::DelegatedRendererLayer> layer_;
360 375
361 // The most recent texture size that was pushed to the texture layer. 376 // The most recent texture size that was pushed to the texture layer.
362 gfx::Size texture_size_in_layer_; 377 gfx::Size texture_size_in_layer_;
363 378
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 gfx::Vector2dF last_scroll_offset_; 430 gfx::Vector2dF last_scroll_offset_;
416 431
417 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; 432 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_;
418 433
419 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); 434 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
420 }; 435 };
421 436
422 } // namespace content 437 } // namespace content
423 438
424 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 439 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698