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

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

Issue 2240553003: Track text selection on the browser side (Mac) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the failing tests on 'mac_chromium_rel_ng' Created 4 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_TEXT_INPUT_MANAGER_H__ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__
6 #define CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ 6 #define CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__
7 7
8 #include <unordered_map> 8 #include <unordered_map>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 // Returns a vector of rects representing the character bounds. 103 // Returns a vector of rects representing the character bounds.
104 const std::vector<gfx::Rect>* GetCompositionCharacterBounds() const; 104 const std::vector<gfx::Rect>* GetCompositionCharacterBounds() const;
105 105
106 // The following method returns the text selection state for the given |view|. 106 // The following method returns the text selection state for the given |view|.
107 // If |view| == nullptr, it will assume |active_view_| and return its state. 107 // If |view| == nullptr, it will assume |active_view_| and return its state.
108 // In the case of |active_view_| == nullptr, the method will return nullptr. 108 // In the case of |active_view_| == nullptr, the method will return nullptr.
109 const TextSelection* GetTextSelection( 109 const TextSelection* GetTextSelection(
110 RenderWidgetHostViewBase* view = nullptr) const; 110 RenderWidgetHostViewBase* view = nullptr) const;
111 111
112 // This method will try to obtain the selected text for |view|. If successful,
113 // it will return true and populate |selected_text| with the right value.
114 // Otherwise reutrns false.
Avi (use Gerrit) 2016/08/12 15:53:10 returns
EhsanK 2016/08/16 13:36:45 Done.
115 bool GetSelectedText(RenderWidgetHostViewBase* view,
116 base::string16* selected_text) const;
117
112 // --------------------------------------------------------------------------- 118 // ---------------------------------------------------------------------------
113 // The following methods are called by RWHVs on the tab to update their IME- 119 // The following methods are called by RWHVs on the tab to update their IME-
114 // related state. 120 // related state.
115 121
116 // Updates the TextInputState for |view|. 122 // Updates the TextInputState for |view|.
117 void UpdateTextInputState(RenderWidgetHostViewBase* view, 123 void UpdateTextInputState(RenderWidgetHostViewBase* view,
118 const TextInputState& state); 124 const TextInputState& state);
119 125
120 // The current IME composition has been cancelled on the renderer side for 126 // The current IME composition has been cancelled on the renderer side for
121 // the widget corresponding to |view|. 127 // the widget corresponding to |view|.
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 ViewMap<CompositionRangeInfo> composition_range_info_map_; 216 ViewMap<CompositionRangeInfo> composition_range_info_map_;
211 ViewMap<TextSelection> text_selection_map_; 217 ViewMap<TextSelection> text_selection_map_;
212 218
213 base::ObserverList<Observer> observer_list_; 219 base::ObserverList<Observer> observer_list_;
214 220
215 DISALLOW_COPY_AND_ASSIGN(TextInputManager); 221 DISALLOW_COPY_AND_ASSIGN(TextInputManager);
216 }; 222 };
217 } 223 }
218 224
219 #endif // CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ 225 #endif // CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698