Chromium Code Reviews| 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 2975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2986 if (!GetInputMethod()) | 2986 if (!GetInputMethod()) |
| 2987 return; | 2987 return; |
| 2988 | 2988 |
| 2989 if (did_update_state) | 2989 if (did_update_state) |
| 2990 GetInputMethod()->OnTextInputTypeChanged(this); | 2990 GetInputMethod()->OnTextInputTypeChanged(this); |
| 2991 | 2991 |
| 2992 const TextInputState* state = text_input_manager_->GetTextInputState(); | 2992 const TextInputState* state = text_input_manager_->GetTextInputState(); |
| 2993 if (state && state->show_ime_if_needed) | 2993 if (state && state->show_ime_if_needed) |
| 2994 GetInputMethod()->ShowImeIfNeeded(); | 2994 GetInputMethod()->ShowImeIfNeeded(); |
| 2995 | 2995 |
| 2996 if (state && host_->delegate()) | |
|
nyquist
2016/10/05 04:20:56
Nit: I think this needs curlies. It's multi-line.
Charlie Reis
2016/10/05 21:19:33
Yes, that's right.
| |
| 2997 host_->delegate()->OnUpdateTextInputState(host_, state->type, state->value, | |
| 2998 state->placeholder, | |
| 2999 state->show_ime_if_needed); | |
|
Charlie Reis
2016/10/05 21:19:33
Why is this only done in Aura?
If it's not needed
| |
| 2996 | 3000 |
| 2997 if (state && state->type != ui::TEXT_INPUT_TYPE_NONE) { | 3001 if (state && state->type != ui::TEXT_INPUT_TYPE_NONE) { |
| 2998 // Start monitoring the composition information if the focused node is | 3002 // Start monitoring the composition information if the focused node is |
| 2999 // editable. | 3003 // editable. |
| 3000 RenderWidgetHostImpl* last_active_widget = | 3004 RenderWidgetHostImpl* last_active_widget = |
| 3001 text_input_manager_->GetActiveWidget(); | 3005 text_input_manager_->GetActiveWidget(); |
| 3002 last_active_widget_routing_id_ = last_active_widget->GetRoutingID(); | 3006 last_active_widget_routing_id_ = last_active_widget->GetRoutingID(); |
| 3003 last_active_widget_process_id_ = last_active_widget->GetProcess()->GetID(); | 3007 last_active_widget_process_id_ = last_active_widget->GetProcess()->GetID(); |
| 3004 last_active_widget->Send(new InputMsg_RequestCompositionUpdate( | 3008 last_active_widget->Send(new InputMsg_RequestCompositionUpdate( |
| 3005 last_active_widget->GetRoutingID(), false /* immediate request */, | 3009 last_active_widget->GetRoutingID(), false /* immediate request */, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3063 ->GetTextSelection(focused_view) | 3067 ->GetTextSelection(focused_view) |
| 3064 ->GetSelectedText(&selected_text)) { | 3068 ->GetSelectedText(&selected_text)) { |
| 3065 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. | 3069 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. |
| 3066 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); | 3070 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); |
| 3067 clipboard_writer.WriteText(selected_text); | 3071 clipboard_writer.WriteText(selected_text); |
| 3068 } | 3072 } |
| 3069 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) | 3073 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) |
| 3070 } | 3074 } |
| 3071 | 3075 |
| 3072 } // namespace content | 3076 } // namespace content |
| OLD | NEW |