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

Unified Diff: content/browser/renderer_host/text_input_manager.h

Issue 2132633002: Tracking composition range on the browser side (Aura) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatting Fixes Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/text_input_manager.h
diff --git a/content/browser/renderer_host/text_input_manager.h b/content/browser/renderer_host/text_input_manager.h
index f240a1b9b7408130b72f6711ee0cd6cd15e76202..ccd3a6c6577ca48372faa85ff9d9e6a260c99b94 100644
--- a/content/browser/renderer_host/text_input_manager.h
+++ b/content/browser/renderer_host/text_input_manager.h
@@ -16,6 +16,10 @@
struct ViewHostMsg_SelectionBounds_Params;
+namespace gfx {
EhsanK 2016/07/07 22:10:58 Not quite sure if space is needed.
kenrb 2016/07/08 18:13:42 It isn't.
EhsanK 2016/07/11 18:07:21 Acknowledged.
+class Range;
+}
+
namespace content {
EhsanK 2016/07/07 22:10:58 Same dilemma, but maybe a different case than abov
kenrb 2016/07/08 18:13:42 A blank line here is appropriate.
EhsanK 2016/07/11 18:07:21 Acknowledged.
class RenderWidgetHostImpl;
class RenderWidgetHostView;
@@ -70,6 +74,9 @@ class CONTENT_EXPORT TextInputManager {
// Returns the rect between selection bounds for the |active_view_|.
gfx::Rect GetSelectionBoundsRect();
+ // Returns a vector of rects for the character bounds of the active widget.
+ const std::vector<gfx::Rect>* GetCompositionCharacterBounds();
kenrb 2016/07/08 18:13:42 In RenderWidgetHostViewAura you call this without
EhsanK 2016/07/11 18:07:21 In RWHVAura we check if there is an active widget
+
// ---------------------------------------------------------------------------
// The following methods are called by RWHVs on the tab to update their IME-
// related state.
@@ -88,6 +95,12 @@ class CONTENT_EXPORT TextInputManager {
void SelectionBoundsChanged(RenderWidgetHostViewBase* view,
const ViewHostMsg_SelectionBounds_Params& params);
+ // Called when the composition range and/or character bounds have changed.
+ void ImeCompositionRangeChanged(
+ RenderWidgetHostViewBase* view,
+ const gfx::Range& range,
+ const std::vector<gfx::Rect>& character_bounds);
+
// Registers the given |view| for tracking its TextInputState. This is called
// by any view which has updates in its TextInputState (whether tab's RWHV or
// that of a child frame). The |view| must unregister itself before being
@@ -128,6 +141,15 @@ class CONTENT_EXPORT TextInputManager {
gfx::SelectionBound focus;
};
+ // Ccomposition range information.
+ struct CompositionRangeInfo {
EhsanK 2016/07/07 22:10:58 We do not store gfx::Range for Aura since it was n
+ CompositionRangeInfo();
+ CompositionRangeInfo(const CompositionRangeInfo& other);
+ ~CompositionRangeInfo();
+
+ std::vector<gfx::Rect> character_bounds;
+ };
+
// This class is used to create maps which hold specific IME state for a
// view.
template <class Value>
@@ -146,6 +168,7 @@ class CONTENT_EXPORT TextInputManager {
// Text selection bounds information for registered views.
ViewMap<SelectionRegion> selection_region_map_;
+ ViewMap<CompositionRangeInfo> composition_range_info_map_;
base::ObserverList<Observer> observer_list_;

Powered by Google App Engine
This is Rietveld 408576698