OLD | NEW |
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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 // in addition to the tab's RWHV, one or more test observers might observe | 217 // in addition to the tab's RWHV, one or more test observers might observe |
218 // TextInputManager. | 218 // TextInputManager. |
219 void AddObserver(Observer* observer); | 219 void AddObserver(Observer* observer); |
220 void RemoveObserver(Observer* observer); | 220 void RemoveObserver(Observer* observer); |
221 bool HasObserver(Observer* observer) const; | 221 bool HasObserver(Observer* observer) const; |
222 | 222 |
223 RenderWidgetHostViewBase* active_view_for_testing() { return active_view_; } | 223 RenderWidgetHostViewBase* active_view_for_testing() { return active_view_; } |
224 size_t GetRegisteredViewsCountForTesting(); | 224 size_t GetRegisteredViewsCountForTesting(); |
225 ui::TextInputType GetTextInputTypeForViewForTesting( | 225 ui::TextInputType GetTextInputTypeForViewForTesting( |
226 RenderWidgetHostViewBase* view); | 226 RenderWidgetHostViewBase* view); |
| 227 const gfx::Range* GetCompositionRangeForTesting() const; |
227 | 228 |
228 private: | 229 private: |
229 // This class is used to create maps which hold specific IME state for a | 230 // This class is used to create maps which hold specific IME state for a |
230 // view. | 231 // view. |
231 template <class Value> | 232 template <class Value> |
232 class ViewMap : public std::unordered_map<RenderWidgetHostViewBase*, Value> { | 233 class ViewMap : public std::unordered_map<RenderWidgetHostViewBase*, Value> { |
233 }; | 234 }; |
234 | 235 |
235 void NotifyObserversAboutInputStateUpdate(RenderWidgetHostViewBase* view, | 236 void NotifyObserversAboutInputStateUpdate(RenderWidgetHostViewBase* view, |
236 bool did_update_state); | 237 bool did_update_state); |
(...skipping 11 matching lines...) Expand all Loading... |
248 ViewMap<CompositionRangeInfo> composition_range_info_map_; | 249 ViewMap<CompositionRangeInfo> composition_range_info_map_; |
249 ViewMap<TextSelection> text_selection_map_; | 250 ViewMap<TextSelection> text_selection_map_; |
250 | 251 |
251 base::ObserverList<Observer> observer_list_; | 252 base::ObserverList<Observer> observer_list_; |
252 | 253 |
253 DISALLOW_COPY_AND_ASSIGN(TextInputManager); | 254 DISALLOW_COPY_AND_ASSIGN(TextInputManager); |
254 }; | 255 }; |
255 } | 256 } |
256 | 257 |
257 #endif // CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ | 258 #endif // CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ |
OLD | NEW |