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 2963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2974 if (state && state->type != ui::TEXT_INPUT_TYPE_NONE) { | 2974 if (state && state->type != ui::TEXT_INPUT_TYPE_NONE) { |
| 2975 // Start monitoring the composition information if the focused node is | 2975 // Start monitoring the composition information if the focused node is |
| 2976 // editable. | 2976 // editable. |
| 2977 RenderWidgetHostImpl* last_active_widget = | 2977 RenderWidgetHostImpl* last_active_widget = |
| 2978 text_input_manager_->GetActiveWidget(); | 2978 text_input_manager_->GetActiveWidget(); |
| 2979 last_active_widget_routing_id_ = last_active_widget->GetRoutingID(); | 2979 last_active_widget_routing_id_ = last_active_widget->GetRoutingID(); |
| 2980 last_active_widget_process_id_ = last_active_widget->GetProcess()->GetID(); | 2980 last_active_widget_process_id_ = last_active_widget->GetProcess()->GetID(); |
| 2981 last_active_widget->Send(new InputMsg_RequestCompositionUpdate( | 2981 last_active_widget->Send(new InputMsg_RequestCompositionUpdate( |
| 2982 last_active_widget->GetRoutingID(), false /* immediate request */, | 2982 last_active_widget->GetRoutingID(), false /* immediate request */, |
| 2983 true /* monitor request */)); | 2983 true /* monitor request */)); |
| 2984 if (has_composition_text_ && state->composition_start == -1) { | |
|
aelias_OOO_until_Jul13
2016/09/26 21:25:59
Code in RenderWidgetHostViewAura only executes on
Changwan Ryu
2016/09/27 03:00:12
http://crbug.com/164427#c16
was the reason why it
aelias_OOO_until_Jul13
2016/09/27 04:39:47
OK, understood, but the history (including the lin
| |
| 2985 // JS-triggered change caused composition to be lost. | |
| 2986 // TODO(changwan): add a unit test. | |
| 2987 GetInputMethod()->CancelComposition(this); | |
| 2988 has_composition_text_ = false; | |
| 2989 } | |
| 2984 } else { | 2990 } else { |
| 2985 // Stop monitoring the composition information if the focused node is not | 2991 // Stop monitoring the composition information if the focused node is not |
| 2986 // editable. | 2992 // editable. |
| 2987 RenderWidgetHostImpl* last_active_widget = RenderWidgetHostImpl::FromID( | 2993 RenderWidgetHostImpl* last_active_widget = RenderWidgetHostImpl::FromID( |
| 2988 last_active_widget_process_id_, last_active_widget_routing_id_); | 2994 last_active_widget_process_id_, last_active_widget_routing_id_); |
| 2989 if (last_active_widget) { | 2995 if (last_active_widget) { |
| 2990 last_active_widget->Send(new InputMsg_RequestCompositionUpdate( | 2996 last_active_widget->Send(new InputMsg_RequestCompositionUpdate( |
| 2991 last_active_widget->GetRoutingID(), false /* immediate request */, | 2997 last_active_widget->GetRoutingID(), false /* immediate request */, |
| 2992 false /* monitor request */)); | 2998 false /* monitor request */)); |
| 2993 } | 2999 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3040 ->GetTextSelection(focused_view) | 3046 ->GetTextSelection(focused_view) |
| 3041 ->GetSelectedText(&selected_text)) { | 3047 ->GetSelectedText(&selected_text)) { |
| 3042 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. | 3048 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. |
| 3043 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); | 3049 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); |
| 3044 clipboard_writer.WriteText(selected_text); | 3050 clipboard_writer.WriteText(selected_text); |
| 3045 } | 3051 } |
| 3046 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) | 3052 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) |
| 3047 } | 3053 } |
| 3048 | 3054 |
| 3049 } // namespace content | 3055 } // namespace content |
| OLD | NEW |