| 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 2954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2965 bool did_update_state) { | 2965 bool did_update_state) { |
| 2966 DCHECK_EQ(text_input_manager_, text_input_manager); | 2966 DCHECK_EQ(text_input_manager_, text_input_manager); |
| 2967 | 2967 |
| 2968 if (!GetInputMethod()) | 2968 if (!GetInputMethod()) |
| 2969 return; | 2969 return; |
| 2970 | 2970 |
| 2971 if (did_update_state) | 2971 if (did_update_state) |
| 2972 GetInputMethod()->OnTextInputTypeChanged(this); | 2972 GetInputMethod()->OnTextInputTypeChanged(this); |
| 2973 | 2973 |
| 2974 const TextInputState* state = text_input_manager_->GetTextInputState(); | 2974 const TextInputState* state = text_input_manager_->GetTextInputState(); |
| 2975 if (state && state->show_ime_if_needed && | 2975 if (state && state->show_ime_if_needed) |
| 2976 state->type != ui::TEXT_INPUT_TYPE_NONE) { | |
| 2977 GetInputMethod()->ShowImeIfNeeded(); | 2976 GetInputMethod()->ShowImeIfNeeded(); |
| 2977 |
| 2978 |
| 2979 if (state && state->type != ui::TEXT_INPUT_TYPE_NONE) { |
| 2978 // Start monitoring the composition information if the focused node is | 2980 // Start monitoring the composition information if the focused node is |
| 2979 // editable. | 2981 // editable. |
| 2980 RenderWidgetHostImpl* last_active_widget = | 2982 RenderWidgetHostImpl* last_active_widget = |
| 2981 text_input_manager_->GetActiveWidget(); | 2983 text_input_manager_->GetActiveWidget(); |
| 2982 last_active_widget_routing_id_ = last_active_widget->GetRoutingID(); | 2984 last_active_widget_routing_id_ = last_active_widget->GetRoutingID(); |
| 2983 last_active_widget_process_id_ = last_active_widget->GetProcess()->GetID(); | 2985 last_active_widget_process_id_ = last_active_widget->GetProcess()->GetID(); |
| 2984 last_active_widget->Send(new InputMsg_RequestCompositionUpdate( | 2986 last_active_widget->Send(new InputMsg_RequestCompositionUpdate( |
| 2985 last_active_widget->GetRoutingID(), false /* immediate request */, | 2987 last_active_widget->GetRoutingID(), false /* immediate request */, |
| 2986 true /* monitor request */)); | 2988 true /* monitor request */)); |
| 2987 } else { | 2989 } else { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3043 ->GetTextSelection(focused_view) | 3045 ->GetTextSelection(focused_view) |
| 3044 ->GetSelectedText(&selected_text)) { | 3046 ->GetSelectedText(&selected_text)) { |
| 3045 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. | 3047 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. |
| 3046 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); | 3048 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); |
| 3047 clipboard_writer.WriteText(selected_text); | 3049 clipboard_writer.WriteText(selected_text); |
| 3048 } | 3050 } |
| 3049 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) | 3051 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) |
| 3050 } | 3052 } |
| 3051 | 3053 |
| 3052 } // namespace content | 3054 } // namespace content |
| OLD | NEW |