| 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 "chrome/browser/renderer_host/gtk_im_context_wrapper.h" | 5 #include "chrome/browser/renderer_host/gtk_im_context_wrapper.h" |
| 6 | 6 |
| 7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
| 8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 gtk_im_context_reset(context_simple_); | 309 gtk_im_context_reset(context_simple_); |
| 310 gtk_im_context_focus_out(context_simple_); | 310 gtk_im_context_focus_out(context_simple_); |
| 311 | 311 |
| 312 is_composing_text_ = false; | 312 is_composing_text_ = false; |
| 313 | 313 |
| 314 // Disable RenderWidget's IME related events to save bandwidth. | 314 // Disable RenderWidget's IME related events to save bandwidth. |
| 315 if (host_view_->GetRenderWidgetHost()) | 315 if (host_view_->GetRenderWidgetHost()) |
| 316 host_view_->GetRenderWidgetHost()->SetInputMethodActive(false); | 316 host_view_->GetRenderWidgetHost()->SetInputMethodActive(false); |
| 317 } | 317 } |
| 318 | 318 |
| 319 bool GtkIMContextWrapper::IsFocused() const { |
| 320 return is_focused_; |
| 321 } |
| 322 |
| 319 #if !defined(TOOLKIT_VIEWS) | 323 #if !defined(TOOLKIT_VIEWS) |
| 320 // Not defined for views because the views context menu doesn't | 324 // Not defined for views because the views context menu doesn't |
| 321 // implement input methods yet. | 325 // implement input methods yet. |
| 322 void GtkIMContextWrapper::AppendInputMethodsContextMenu(MenuGtk* menu) { | 326 void GtkIMContextWrapper::AppendInputMethodsContextMenu(MenuGtk* menu) { |
| 323 gboolean show_input_method_menu = TRUE; | 327 gboolean show_input_method_menu = TRUE; |
| 324 | 328 |
| 325 g_object_get(gtk_widget_get_settings(GTK_WIDGET(host_view_->native_view())), | 329 g_object_get(gtk_widget_get_settings(GTK_WIDGET(host_view_->native_view())), |
| 326 "gtk-show-input-method-menu", &show_input_method_menu, NULL); | 330 "gtk-show-input-method-menu", &show_input_method_menu, NULL); |
| 327 if (!show_input_method_menu) | 331 if (!show_input_method_menu) |
| 328 return; | 332 return; |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | 637 |
| 634 void GtkIMContextWrapper::HandleHostViewRealizeThunk( | 638 void GtkIMContextWrapper::HandleHostViewRealizeThunk( |
| 635 GtkWidget* widget, GtkIMContextWrapper* self) { | 639 GtkWidget* widget, GtkIMContextWrapper* self) { |
| 636 self->HandleHostViewRealize(widget); | 640 self->HandleHostViewRealize(widget); |
| 637 } | 641 } |
| 638 | 642 |
| 639 void GtkIMContextWrapper::HandleHostViewUnrealizeThunk( | 643 void GtkIMContextWrapper::HandleHostViewUnrealizeThunk( |
| 640 GtkWidget* widget, GtkIMContextWrapper* self) { | 644 GtkWidget* widget, GtkIMContextWrapper* self) { |
| 641 self->HandleHostViewUnrealize(); | 645 self->HandleHostViewUnrealize(); |
| 642 } | 646 } |
| OLD | NEW |