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 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1190 text_input_manager_->GetActiveWidget()->ImeCancelComposition(); | 1190 text_input_manager_->GetActiveWidget()->ImeCancelComposition(); |
1191 has_composition_text_ = false; | 1191 has_composition_text_ = false; |
1192 } | 1192 } |
1193 | 1193 |
1194 void RenderWidgetHostViewAura::InsertText(const base::string16& text) { | 1194 void RenderWidgetHostViewAura::InsertText(const base::string16& text) { |
1195 DCHECK_NE(GetTextInputType(), ui::TEXT_INPUT_TYPE_NONE); | 1195 DCHECK_NE(GetTextInputType(), ui::TEXT_INPUT_TYPE_NONE); |
1196 | 1196 |
1197 if (text_input_manager_ && text_input_manager_->GetActiveWidget()) { | 1197 if (text_input_manager_ && text_input_manager_->GetActiveWidget()) { |
1198 if (text.length()) | 1198 if (text.length()) |
1199 text_input_manager_->GetActiveWidget()->ImeCommitText( | 1199 text_input_manager_->GetActiveWidget()->ImeCommitText( |
1200 text, gfx::Range::InvalidRange(), 0); | 1200 text, std::vector<blink::WebCompositionUnderline>(), |
| 1201 gfx::Range::InvalidRange(), 0); |
1201 else if (has_composition_text_) | 1202 else if (has_composition_text_) |
1202 text_input_manager_->GetActiveWidget()->ImeFinishComposingText(false); | 1203 text_input_manager_->GetActiveWidget()->ImeFinishComposingText(false); |
1203 } | 1204 } |
1204 has_composition_text_ = false; | 1205 has_composition_text_ = false; |
1205 } | 1206 } |
1206 | 1207 |
1207 void RenderWidgetHostViewAura::InsertChar(const ui::KeyEvent& event) { | 1208 void RenderWidgetHostViewAura::InsertChar(const ui::KeyEvent& event) { |
1208 if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab()) { | 1209 if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab()) { |
1209 popup_child_host_view_->InsertChar(event); | 1210 popup_child_host_view_->InsertChar(event); |
1210 return; | 1211 return; |
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2380 | 2381 |
2381 void RenderWidgetHostViewAura::SetPopupChild( | 2382 void RenderWidgetHostViewAura::SetPopupChild( |
2382 RenderWidgetHostViewAura* popup_child_host_view) { | 2383 RenderWidgetHostViewAura* popup_child_host_view) { |
2383 popup_child_host_view_ = popup_child_host_view; | 2384 popup_child_host_view_ = popup_child_host_view; |
2384 event_handler_->SetPopupChild( | 2385 event_handler_->SetPopupChild( |
2385 popup_child_host_view, | 2386 popup_child_host_view, |
2386 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); | 2387 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); |
2387 } | 2388 } |
2388 | 2389 |
2389 } // namespace content | 2390 } // namespace content |
OLD | NEW |