| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 DispatchKeyEventPostIME(key); | 150 DispatchKeyEventPostIME(key); |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 | 153 |
| 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 InputMethodBase::OnTextInputTypeChanged(view); |
| 160 if (IsViewFocused(view)) { | 161 if (IsViewFocused(view)) { |
| 161 DCHECK(!composing_text_); | 162 DCHECK(!composing_text_); |
| 162 UpdateContextFocusState(); | 163 UpdateContextFocusState(); |
| 163 } | 164 } |
| 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; |
| (...skipping 270 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 |