| 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 "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "content/browser/renderer_host/render_widget_host_impl.h" | 8 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 9 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 9 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 } | 259 } |
| 260 | 260 |
| 261 void TextInputManager::AddObserver(Observer* observer) { | 261 void TextInputManager::AddObserver(Observer* observer) { |
| 262 observer_list_.AddObserver(observer); | 262 observer_list_.AddObserver(observer); |
| 263 } | 263 } |
| 264 | 264 |
| 265 void TextInputManager::RemoveObserver(Observer* observer) { | 265 void TextInputManager::RemoveObserver(Observer* observer) { |
| 266 observer_list_.RemoveObserver(observer); | 266 observer_list_.RemoveObserver(observer); |
| 267 } | 267 } |
| 268 | 268 |
| 269 bool TextInputManager::HasObserver(Observer* observer) const { |
| 270 return observer_list_.HasObserver(observer); |
| 271 } |
| 272 |
| 269 size_t TextInputManager::GetRegisteredViewsCountForTesting() { | 273 size_t TextInputManager::GetRegisteredViewsCountForTesting() { |
| 270 return text_input_state_map_.size(); | 274 return text_input_state_map_.size(); |
| 271 } | 275 } |
| 272 | 276 |
| 273 ui::TextInputType TextInputManager::GetTextInputTypeForViewForTesting( | 277 ui::TextInputType TextInputManager::GetTextInputTypeForViewForTesting( |
| 274 RenderWidgetHostViewBase* view) { | 278 RenderWidgetHostViewBase* view) { |
| 275 DCHECK(IsRegistered(view)); | 279 DCHECK(IsRegistered(view)); |
| 276 return text_input_state_map_[view].type; | 280 return text_input_state_map_[view].type; |
| 277 } | 281 } |
| 278 | 282 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 298 | 302 |
| 299 TextInputManager::TextSelection::TextSelection() | 303 TextInputManager::TextSelection::TextSelection() |
| 300 : offset(0), range(gfx::Range::InvalidRange()), text(base::string16()) {} | 304 : offset(0), range(gfx::Range::InvalidRange()), text(base::string16()) {} |
| 301 | 305 |
| 302 TextInputManager::TextSelection::TextSelection(const TextSelection& other) = | 306 TextInputManager::TextSelection::TextSelection(const TextSelection& other) = |
| 303 default; | 307 default; |
| 304 | 308 |
| 305 TextInputManager::TextSelection::~TextSelection() {} | 309 TextInputManager::TextSelection::~TextSelection() {} |
| 306 | 310 |
| 307 } // namespace content | 311 } // namespace content |
| OLD | NEW |