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

Side by Side Diff: views/ime/input_method_gtk.cc

Issue 7217008: Use input method to control visibility of virtual keyboard (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Update Created 9 years, 5 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 "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
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);
sadrul 2011/07/11 13:56:06 I wonder if the notification should be done at the
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698