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 #include "content/common/view_messages.h" | 9 #include "content/common/view_messages.h" |
10 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // the tab's top-level RWHV will be notified about |TextInputState.type| | 35 // the tab's top-level RWHV will be notified about |TextInputState.type| |
36 // resetting to none (i.e., we do not have an active RWHV anymore). | 36 // resetting to none (i.e., we do not have an active RWHV anymore). |
37 if (active_view_) | 37 if (active_view_) |
38 Unregister(active_view_); | 38 Unregister(active_view_); |
39 | 39 |
40 // Unregister all the remaining views. | 40 // Unregister all the remaining views. |
41 std::vector<RenderWidgetHostViewBase*> views; | 41 std::vector<RenderWidgetHostViewBase*> views; |
42 for (auto pair : text_input_state_map_) | 42 for (auto pair : text_input_state_map_) |
43 views.push_back(pair.first); | 43 views.push_back(pair.first); |
44 | 44 |
45 for (auto view : views) | 45 for (auto* view : views) |
46 Unregister(view); | 46 Unregister(view); |
47 } | 47 } |
48 | 48 |
49 RenderWidgetHostImpl* TextInputManager::GetActiveWidget() const { | 49 RenderWidgetHostImpl* TextInputManager::GetActiveWidget() const { |
50 return !!active_view_ ? static_cast<RenderWidgetHostImpl*>( | 50 return !!active_view_ ? static_cast<RenderWidgetHostImpl*>( |
51 active_view_->GetRenderWidgetHost()) | 51 active_view_->GetRenderWidgetHost()) |
52 : nullptr; | 52 : nullptr; |
53 } | 53 } |
54 | 54 |
55 const TextInputState* TextInputManager::GetTextInputState() const { | 55 const TextInputState* TextInputManager::GetTextInputState() const { |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 const SelectionRegion& other) = default; | 232 const SelectionRegion& other) = default; |
233 | 233 |
234 TextInputManager::CompositionRangeInfo::CompositionRangeInfo() {} | 234 TextInputManager::CompositionRangeInfo::CompositionRangeInfo() {} |
235 | 235 |
236 TextInputManager::CompositionRangeInfo::CompositionRangeInfo( | 236 TextInputManager::CompositionRangeInfo::CompositionRangeInfo( |
237 const CompositionRangeInfo& other) = default; | 237 const CompositionRangeInfo& other) = default; |
238 | 238 |
239 TextInputManager::CompositionRangeInfo::~CompositionRangeInfo() {} | 239 TextInputManager::CompositionRangeInfo::~CompositionRangeInfo() {} |
240 | 240 |
241 } // namespace content | 241 } // namespace content |
OLD | NEW |