Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: chrome/browser/renderer_host/gtk_im_context_wrapper.cc

Issue 7548008: Use input method's context for tracking focus states in OnGrabNotify. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Retrieve the focus state from IM wrapper. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698