OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/ime/input_method_gtk.h" | 5 #include "views/ime/input_method_gtk.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // Free the synthesized event if there was no underlying native event. | 154 // Free the synthesized event if there was no underlying native event. |
155 if (event != key.native_event()) | 155 if (event != key.native_event()) |
156 gdk_event_free(event); | 156 gdk_event_free(event); |
157 } | 157 } |
158 | 158 |
159 void InputMethodGtk::OnTextInputTypeChanged(View* view) { | 159 void InputMethodGtk::OnTextInputTypeChanged(View* view) { |
160 if (IsViewFocused(view)) { | 160 if (IsViewFocused(view)) { |
161 DCHECK(!composing_text_); | 161 DCHECK(!composing_text_); |
162 UpdateContextFocusState(); | 162 UpdateContextFocusState(); |
163 } | 163 } |
| 164 InputMethodBase::OnTextInputTypeChanged(view); |
164 } | 165 } |
165 | 166 |
166 void InputMethodGtk::OnCaretBoundsChanged(View* view) { | 167 void InputMethodGtk::OnCaretBoundsChanged(View* view) { |
167 gfx::Rect rect; | 168 gfx::Rect rect; |
168 if (!IsViewFocused(view) || !GetCaretBoundsInWidget(&rect)) | 169 if (!IsViewFocused(view) || !GetCaretBoundsInWidget(&rect)) |
169 return; | 170 return; |
170 | 171 |
171 GdkRectangle gdk_rect = rect.ToGdkRectangle(); | 172 GdkRectangle gdk_rect = rect.ToGdkRectangle(); |
172 gtk_im_context_set_cursor_location(context_, &gdk_rect); | 173 gtk_im_context_set_cursor_location(context_, &gdk_rect); |
173 } | 174 } |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 gtk_im_context_set_client_window(context_simple_, widget->window); | 441 gtk_im_context_set_client_window(context_simple_, widget->window); |
441 } | 442 } |
442 } | 443 } |
443 | 444 |
444 void InputMethodGtk::OnWidgetUnrealize(GtkWidget* widget) { | 445 void InputMethodGtk::OnWidgetUnrealize(GtkWidget* widget) { |
445 gtk_im_context_set_client_window(context_, NULL); | 446 gtk_im_context_set_client_window(context_, NULL); |
446 gtk_im_context_set_client_window(context_simple_, NULL); | 447 gtk_im_context_set_client_window(context_simple_, NULL); |
447 } | 448 } |
448 | 449 |
449 } // namespace views | 450 } // namespace views |
OLD | NEW |