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

Side by Side Diff: views/ime/input_method_ibus.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_gtk.cc ('k') | views/ime/input_method_win.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_ibus.h" 5 #include "views/ime/input_method_ibus.h"
6 6
7 #include <ibus.h> 7 #include <ibus.h>
8 8
9 #include <cstring> 9 #include <cstring>
10 #include <set> 10 #include <set>
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 // We don't want to suppress the result generated by this key event, but it 409 // We don't want to suppress the result generated by this key event, but it
410 // may cause problem. See comment in ResetContext() method. 410 // may cause problem. See comment in ResetContext() method.
411 suppress_next_result_ = false; 411 suppress_next_result_ = false;
412 } 412 }
413 413
414 void InputMethodIBus::OnTextInputTypeChanged(View* view) { 414 void InputMethodIBus::OnTextInputTypeChanged(View* view) {
415 if (context_ && IsViewFocused(view)) { 415 if (context_ && IsViewFocused(view)) {
416 ResetContext(); 416 ResetContext();
417 UpdateContextFocusState(); 417 UpdateContextFocusState();
418 } 418 }
419 InputMethodBase::OnTextInputTypeChanged(view);
419 } 420 }
420 421
421 void InputMethodIBus::OnCaretBoundsChanged(View* view) { 422 void InputMethodIBus::OnCaretBoundsChanged(View* view) {
422 if (!context_focused_ || !IsViewFocused(view)) 423 if (!context_focused_ || !IsViewFocused(view))
423 return; 424 return;
424 425
425 // The current text input type should not be NONE if |context_| is focused. 426 // The current text input type should not be NONE if |context_| is focused.
426 DCHECK(!IsTextInputTypeNone()); 427 DCHECK(!IsTextInputTypeNone());
427 428
428 gfx::Rect rect = GetTextInputClient()->GetCaretBounds(); 429 gfx::Rect rect = GetTextInputClient()->GetCaretBounds();
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 DCHECK_EQ(GetIBus(), bus); 1004 DCHECK_EQ(GetIBus(), bus);
1004 DCHECK(data); 1005 DCHECK(data);
1005 IBusInputContext* ic = 1006 IBusInputContext* ic =
1006 ibus_bus_create_input_context_async_finish(bus, res, NULL); 1007 ibus_bus_create_input_context_async_finish(bus, res, NULL);
1007 if (ic) 1008 if (ic)
1008 data->StoreOrAbandonInputContext(ic); 1009 data->StoreOrAbandonInputContext(ic);
1009 delete data; 1010 delete data;
1010 } 1011 }
1011 1012
1012 } // namespace views 1013 } // namespace views
OLDNEW
« no previous file with comments | « views/ime/input_method_gtk.cc ('k') | views/ime/input_method_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698