Chromium Code Reviews| 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 19 matching lines...) Expand all Loading... | |
| 30 class CONTENT_EXPORT TextInputManager { | 30 class CONTENT_EXPORT TextInputManager { |
| 31 public: | 31 public: |
| 32 // The tab's top-level RWHV should be an observer of TextInputManager to get | 32 // The tab's top-level RWHV should be an observer of TextInputManager to get |
| 33 // notifications about changes in TextInputState or other IME related state | 33 // notifications about changes in TextInputState or other IME related state |
| 34 // for child frames. | 34 // for child frames. |
| 35 class CONTENT_EXPORT Observer { | 35 class CONTENT_EXPORT Observer { |
| 36 public: | 36 public: |
| 37 // Called when a view has called UpdateTextInputState on TextInputManager. | 37 // Called when a view has called UpdateTextInputState on TextInputManager. |
| 38 // If the call has led to a change in TextInputState, |did_update_state| is | 38 // If the call has led to a change in TextInputState, |did_update_state| is |
| 39 // true. In some plaforms, we need this update even when the state has not | 39 // true. In some plaforms, we need this update even when the state has not |
| 40 // changed (e.g., Aura for updating IME). | 40 // changed (e.g., Aura for updating IME). Also note that |updated_view| is |
| 41 // the view which has most recently received an update in TextInputState. | |
| 42 // |updated_view| should not be used to obtain any IME state since this | |
| 43 // this observer method might have been called in response to unregistering | |
|
Charlie Reis
2016/11/30 00:05:23
nit: this this
EhsanK
2016/11/30 00:34:25
Acknowledged.
| |
| 44 // the |active_view_| from TextInputManager in which case all the the |view| | |
|
Charlie Reis
2016/11/30 00:05:23
nit: the the
nit: What does "all the |view| is not
EhsanK
2016/11/30 00:34:25
Thanks. I rephrased this part.
| |
| 45 // is not registered anymore. | |
| 41 virtual void OnUpdateTextInputStateCalled( | 46 virtual void OnUpdateTextInputStateCalled( |
| 42 TextInputManager* text_input_manager, | 47 TextInputManager* text_input_manager, |
| 43 RenderWidgetHostViewBase* updated_view, | 48 RenderWidgetHostViewBase* updated_view, |
| 44 bool did_update_state) {} | 49 bool did_update_state) {} |
| 45 // Called when |updated_view| has called ImeCancelComposition on | 50 // Called when |updated_view| has called ImeCancelComposition on |
| 46 // TextInputManager. | 51 // TextInputManager. |
| 47 virtual void OnImeCancelComposition( | 52 virtual void OnImeCancelComposition( |
| 48 TextInputManager* text_input_manager, | 53 TextInputManager* text_input_manager, |
| 49 RenderWidgetHostViewBase* updated_view) {} | 54 RenderWidgetHostViewBase* updated_view) {} |
| 50 // Called when |updated_view| has changed its SelectionRegion. | 55 // Called when |updated_view| has changed its SelectionRegion. |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 ViewMap<CompositionRangeInfo> composition_range_info_map_; | 235 ViewMap<CompositionRangeInfo> composition_range_info_map_; |
| 231 ViewMap<TextSelection> text_selection_map_; | 236 ViewMap<TextSelection> text_selection_map_; |
| 232 | 237 |
| 233 base::ObserverList<Observer> observer_list_; | 238 base::ObserverList<Observer> observer_list_; |
| 234 | 239 |
| 235 DISALLOW_COPY_AND_ASSIGN(TextInputManager); | 240 DISALLOW_COPY_AND_ASSIGN(TextInputManager); |
| 236 }; | 241 }; |
| 237 } | 242 } |
| 238 | 243 |
| 239 #endif // CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ | 244 #endif // CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ |
| OLD | NEW |