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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 view = active_view_; | 70 view = active_view_; |
71 return view ? &selection_region_map_.at(view) : nullptr; | 71 return view ? &selection_region_map_.at(view) : nullptr; |
72 } | 72 } |
73 | 73 |
74 const TextInputManager::CompositionRangeInfo* | 74 const TextInputManager::CompositionRangeInfo* |
75 TextInputManager::GetCompositionRangeInfo( | 75 TextInputManager::GetCompositionRangeInfo( |
76 RenderWidgetHostViewBase* view) const { | 76 RenderWidgetHostViewBase* view) const { |
77 DCHECK(!view || IsRegistered(view)); | 77 DCHECK(!view || IsRegistered(view)); |
78 if (!view) | 78 if (!view) |
79 view = active_view_; | 79 view = active_view_; |
80 return active_view_ ? &composition_range_info_map_.at(active_view_) : nullptr; | 80 return view ? &composition_range_info_map_.at(view) : nullptr; |
EhsanK
2017/04/10 14:50:29
Right now we do not actually even use this method
Charlie Reis
2017/04/10 18:31:21
Let's go ahead and remove it for now, since it's e
EhsanK
2017/04/10 18:37:10
Acknowledged.
| |
81 } | 81 } |
82 | 82 |
83 const TextInputManager::TextSelection* TextInputManager::GetTextSelection( | 83 const TextInputManager::TextSelection* TextInputManager::GetTextSelection( |
84 RenderWidgetHostViewBase* view) const { | 84 RenderWidgetHostViewBase* view) const { |
85 DCHECK(!view || IsRegistered(view)); | 85 DCHECK(!view || IsRegistered(view)); |
86 if (!view) | 86 if (!view) |
87 view = active_view_; | 87 view = active_view_; |
88 return !!view ? &text_selection_map_.at(view) : nullptr; | 88 return !!view ? &text_selection_map_.at(view) : nullptr; |
89 } | 89 } |
90 | 90 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
346 if (pos >= text.length()) { | 346 if (pos >= text.length()) { |
347 LOG(WARNING) << "The text cannot cover range (selection range's starting " | 347 LOG(WARNING) << "The text cannot cover range (selection range's starting " |
348 "point exceeds text length)."; | 348 "point exceeds text length)."; |
349 } else { | 349 } else { |
350 selected_text_.append(text.substr(pos, n)); | 350 selected_text_.append(text.substr(pos, n)); |
351 } | 351 } |
352 } | 352 } |
353 } | 353 } |
354 | 354 |
355 } // namespace content | 355 } // namespace content |
OLD | NEW |