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 "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 Loading... |
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 Loading... |
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 |
OLD | NEW |