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

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

Issue 2354793003: Browser Side TextInputState Tracking for Android (Closed)
Patch Set: Rebased Created 4 years, 1 month 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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <map> 11 #include <map>
12 #include <memory> 12 #include <memory>
13 #include <queue> 13 #include <queue>
14 14
15 #include "base/callback.h" 15 #include "base/callback.h"
16 #include "base/compiler_specific.h" 16 #include "base/compiler_specific.h"
17 #include "base/i18n/rtl.h" 17 #include "base/i18n/rtl.h"
18 #include "base/macros.h" 18 #include "base/macros.h"
19 #include "base/memory/weak_ptr.h" 19 #include "base/memory/weak_ptr.h"
20 #include "base/process/process.h" 20 #include "base/process/process.h"
21 #include "cc/input/selection.h" 21 #include "cc/input/selection.h"
22 #include "cc/output/begin_frame_args.h" 22 #include "cc/output/begin_frame_args.h"
23 #include "content/browser/accessibility/browser_accessibility_manager.h" 23 #include "content/browser/accessibility/browser_accessibility_manager.h"
24 #include "content/browser/android/content_view_core_impl_observer.h" 24 #include "content/browser/android/content_view_core_impl_observer.h"
25 #include "content/browser/renderer_host/delegated_frame_evictor.h" 25 #include "content/browser/renderer_host/delegated_frame_evictor.h"
26 #include "content/browser/renderer_host/ime_adapter_android.h" 26 #include "content/browser/renderer_host/ime_adapter_android.h"
27 #include "content/browser/renderer_host/input/stylus_text_selector.h" 27 #include "content/browser/renderer_host/input/stylus_text_selector.h"
28 #include "content/browser/renderer_host/render_widget_host_view_base.h" 28 #include "content/browser/renderer_host/render_widget_host_view_base.h"
29 #include "content/browser/renderer_host/text_input_manager.h"
29 #include "content/common/content_export.h" 30 #include "content/common/content_export.h"
30 #include "content/public/browser/readback_types.h" 31 #include "content/public/browser/readback_types.h"
31 #include "gpu/command_buffer/common/mailbox.h" 32 #include "gpu/command_buffer/common/mailbox.h"
32 #include "third_party/skia/include/core/SkColor.h" 33 #include "third_party/skia/include/core/SkColor.h"
33 #include "ui/android/view_android.h" 34 #include "ui/android/view_android.h"
34 #include "ui/android/window_android_observer.h" 35 #include "ui/android/window_android_observer.h"
35 #include "ui/events/gesture_detection/filtered_gesture_provider.h" 36 #include "ui/events/gesture_detection/filtered_gesture_provider.h"
36 #include "ui/gfx/geometry/size.h" 37 #include "ui/gfx/geometry/size.h"
37 #include "ui/gfx/geometry/vector2d_f.h" 38 #include "ui/gfx/geometry/vector2d_f.h"
38 #include "ui/gfx/selection_bound.h" 39 #include "ui/gfx/selection_bound.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // ----------------------------------------------------------------------------- 73 // -----------------------------------------------------------------------------
73 // See comments in render_widget_host_view.h about this class and its members. 74 // See comments in render_widget_host_view.h about this class and its members.
74 // ----------------------------------------------------------------------------- 75 // -----------------------------------------------------------------------------
75 class CONTENT_EXPORT RenderWidgetHostViewAndroid 76 class CONTENT_EXPORT RenderWidgetHostViewAndroid
76 : public RenderWidgetHostViewBase, 77 : public RenderWidgetHostViewBase,
77 public ui::GestureProviderClient, 78 public ui::GestureProviderClient,
78 public ui::WindowAndroidObserver, 79 public ui::WindowAndroidObserver,
79 public DelegatedFrameEvictorClient, 80 public DelegatedFrameEvictorClient,
80 public StylusTextSelectorClient, 81 public StylusTextSelectorClient,
81 public ui::TouchSelectionControllerClient, 82 public ui::TouchSelectionControllerClient,
82 public content::ContentViewCoreImplObserver { 83 public content::ContentViewCoreImplObserver,
84 public content::TextInputManager::Observer {
83 public: 85 public:
84 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, 86 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget,
85 ContentViewCoreImpl* content_view_core); 87 ContentViewCoreImpl* content_view_core);
86 ~RenderWidgetHostViewAndroid() override; 88 ~RenderWidgetHostViewAndroid() override;
87 89
88 void Blur(); 90 void Blur();
89 91
90 // RenderWidgetHostView implementation. 92 // RenderWidgetHostView implementation.
91 bool OnMessageReceived(const IPC::Message& msg) override; 93 bool OnMessageReceived(const IPC::Message& msg) override;
92 void InitAsChild(gfx::NativeView parent_view) override; 94 void InitAsChild(gfx::NativeView parent_view) override;
(...skipping 13 matching lines...) Expand all
106 void Hide() override; 108 void Hide() override;
107 bool IsShowing() override; 109 bool IsShowing() override;
108 gfx::Rect GetViewBounds() const override; 110 gfx::Rect GetViewBounds() const override;
109 gfx::Size GetVisibleViewportSize() const override; 111 gfx::Size GetVisibleViewportSize() const override;
110 gfx::Size GetPhysicalBackingSize() const override; 112 gfx::Size GetPhysicalBackingSize() const override;
111 bool DoBrowserControlsShrinkBlinkSize() const override; 113 bool DoBrowserControlsShrinkBlinkSize() const override;
112 float GetTopControlsHeight() const override; 114 float GetTopControlsHeight() const override;
113 float GetBottomControlsHeight() const override; 115 float GetBottomControlsHeight() const override;
114 void UpdateCursor(const WebCursor& cursor) override; 116 void UpdateCursor(const WebCursor& cursor) override;
115 void SetIsLoading(bool is_loading) override; 117 void SetIsLoading(bool is_loading) override;
116 void TextInputStateChanged(const TextInputState& params) override;
117 void ImeCancelComposition() override; 118 void ImeCancelComposition() override;
118 void ImeCompositionRangeChanged( 119 void ImeCompositionRangeChanged(
119 const gfx::Range& range, 120 const gfx::Range& range,
120 const std::vector<gfx::Rect>& character_bounds) override; 121 const std::vector<gfx::Rect>& character_bounds) override;
121 void FocusedNodeChanged(bool is_editable_node, 122 void FocusedNodeChanged(bool is_editable_node,
122 const gfx::Rect& node_bounds_in_screen) override; 123 const gfx::Rect& node_bounds_in_screen) override;
123 void RenderProcessGone(base::TerminationStatus status, 124 void RenderProcessGone(base::TerminationStatus status,
124 int error_code) override; 125 int error_code) override;
125 void Destroy() override; 126 void Destroy() override;
126 void SetTooltipText(const base::string16& tooltip_text) override; 127 void SetTooltipText(const base::string16& tooltip_text) override;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 void MoveCaret(const gfx::Point& point); 238 void MoveCaret(const gfx::Point& point);
238 void DismissTextHandles(); 239 void DismissTextHandles();
239 void SetTextHandlesTemporarilyHidden(bool hidden); 240 void SetTextHandlesTemporarilyHidden(bool hidden);
240 void OnShowingPastePopup(const gfx::PointF& point); 241 void OnShowingPastePopup(const gfx::PointF& point);
241 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); 242 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip);
242 243
243 void SynchronousFrameMetadata(cc::CompositorFrameMetadata frame_metadata); 244 void SynchronousFrameMetadata(cc::CompositorFrameMetadata frame_metadata);
244 245
245 static void OnContextLost(); 246 static void OnContextLost();
246 247
248 // TextInputManager::Observer overrides.
249 void OnUpdateTextInputStateCalled(TextInputManager* text_input_manager,
250 RenderWidgetHostViewBase* updated_view,
251 bool did_change_state) override;
252
247 private: 253 private:
248 void RunAckCallbacks(); 254 void RunAckCallbacks();
249 255
250 void CheckCompositorFrameSinkChanged(uint32_t compositor_frame_sink_id); 256 void CheckCompositorFrameSinkChanged(uint32_t compositor_frame_sink_id);
251 void SubmitCompositorFrame(cc::CompositorFrame frame_data); 257 void SubmitCompositorFrame(cc::CompositorFrame frame_data);
252 void SendReclaimCompositorResources(uint32_t compositor_frame_sink_id, 258 void SendReclaimCompositorResources(uint32_t compositor_frame_sink_id,
253 bool is_swap_ack); 259 bool is_swap_ack);
254 260
255 void OnFrameMetadataUpdated(const cc::CompositorFrameMetadata& frame_metadata, 261 void OnFrameMetadataUpdated(const cc::CompositorFrameMetadata& frame_metadata,
256 bool is_transparent); 262 bool is_transparent);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 gfx::Vector2dF last_scroll_offset_; 381 gfx::Vector2dF last_scroll_offset_;
376 382
377 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; 383 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_;
378 384
379 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); 385 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
380 }; 386 };
381 387
382 } // namespace content 388 } // namespace content
383 389
384 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 390 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698