| 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 #include "content/browser/renderer_host/text_input_manager.h" | 5 #include "content/browser/renderer_host/text_input_manager.h" |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/render_widget_host_impl.h" | 7 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 8 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 8 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 } | 100 } |
| 101 | 101 |
| 102 void TextInputManager::AddObserver(Observer* observer) { | 102 void TextInputManager::AddObserver(Observer* observer) { |
| 103 observer_list_.AddObserver(observer); | 103 observer_list_.AddObserver(observer); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void TextInputManager::RemoveObserver(Observer* observer) { | 106 void TextInputManager::RemoveObserver(Observer* observer) { |
| 107 observer_list_.RemoveObserver(observer); | 107 observer_list_.RemoveObserver(observer); |
| 108 } | 108 } |
| 109 | 109 |
| 110 size_t TextInputManager::GetRegisteredViewsCountForTesting() { |
| 111 return text_input_state_map_.size(); |
| 112 } |
| 113 |
| 114 ui::TextInputType TextInputManager::GetTextInputTypeForViewForTesting( |
| 115 RenderWidgetHostViewBase* view) { |
| 116 DCHECK(IsRegistered(view)); |
| 117 return text_input_state_map_[view].type; |
| 118 } |
| 119 |
| 110 void TextInputManager::NotifyObserversAboutInputStateUpdate( | 120 void TextInputManager::NotifyObserversAboutInputStateUpdate( |
| 111 RenderWidgetHostViewBase* updated_view, | 121 RenderWidgetHostViewBase* updated_view, |
| 112 bool did_update_state) { | 122 bool did_update_state) { |
| 113 FOR_EACH_OBSERVER( | 123 FOR_EACH_OBSERVER( |
| 114 Observer, observer_list_, | 124 Observer, observer_list_, |
| 115 OnUpdateTextInputStateCalled(this, updated_view, did_update_state)); | 125 OnUpdateTextInputStateCalled(this, updated_view, did_update_state)); |
| 116 } | 126 } |
| 117 | 127 |
| 118 } // namespace content | 128 } // namespace content |
| OLD | NEW |