OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1193 text_input_manager_->GetActiveWidget()->ImeCancelComposition(); | 1193 text_input_manager_->GetActiveWidget()->ImeCancelComposition(); |
1194 has_composition_text_ = false; | 1194 has_composition_text_ = false; |
1195 } | 1195 } |
1196 | 1196 |
1197 void RenderWidgetHostViewAura::InsertText(const base::string16& text) { | 1197 void RenderWidgetHostViewAura::InsertText(const base::string16& text) { |
1198 DCHECK_NE(GetTextInputType(), ui::TEXT_INPUT_TYPE_NONE); | 1198 DCHECK_NE(GetTextInputType(), ui::TEXT_INPUT_TYPE_NONE); |
1199 | 1199 |
1200 if (text_input_manager_ && text_input_manager_->GetActiveWidget()) { | 1200 if (text_input_manager_ && text_input_manager_->GetActiveWidget()) { |
1201 if (text.length()) | 1201 if (text.length()) |
1202 text_input_manager_->GetActiveWidget()->ImeCommitText( | 1202 text_input_manager_->GetActiveWidget()->ImeCommitText( |
1203 text, gfx::Range::InvalidRange(), 0); | 1203 text, std::vector<blink::WebCompositionUnderline>(), |
| 1204 gfx::Range::InvalidRange(), 0); |
1204 else if (has_composition_text_) | 1205 else if (has_composition_text_) |
1205 text_input_manager_->GetActiveWidget()->ImeFinishComposingText(false); | 1206 text_input_manager_->GetActiveWidget()->ImeFinishComposingText(false); |
1206 } | 1207 } |
1207 has_composition_text_ = false; | 1208 has_composition_text_ = false; |
1208 } | 1209 } |
1209 | 1210 |
1210 void RenderWidgetHostViewAura::InsertChar(const ui::KeyEvent& event) { | 1211 void RenderWidgetHostViewAura::InsertChar(const ui::KeyEvent& event) { |
1211 if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab()) { | 1212 if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab()) { |
1212 popup_child_host_view_->InsertChar(event); | 1213 popup_child_host_view_->InsertChar(event); |
1213 return; | 1214 return; |
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2383 | 2384 |
2384 void RenderWidgetHostViewAura::SetPopupChild( | 2385 void RenderWidgetHostViewAura::SetPopupChild( |
2385 RenderWidgetHostViewAura* popup_child_host_view) { | 2386 RenderWidgetHostViewAura* popup_child_host_view) { |
2386 popup_child_host_view_ = popup_child_host_view; | 2387 popup_child_host_view_ = popup_child_host_view; |
2387 event_handler_->SetPopupChild( | 2388 event_handler_->SetPopupChild( |
2388 popup_child_host_view, | 2389 popup_child_host_view, |
2389 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); | 2390 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); |
2390 } | 2391 } |
2391 | 2392 |
2392 } // namespace content | 2393 } // namespace content |
OLD | NEW |