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

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: Rebase 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
« no previous file with comments | « views/ime/input_method_base.cc ('k') | views/ime/input_method_ibus.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
« no previous file with comments | « views/ime/input_method_base.cc ('k') | views/ime/input_method_ibus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698