| 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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 // Not supported. | 458 // Not supported. |
| 459 return std::string(""); | 459 return std::string(""); |
| 460 } | 460 } |
| 461 | 461 |
| 462 base::i18n::TextDirection InputMethodIBus::GetInputTextDirection() { | 462 base::i18n::TextDirection InputMethodIBus::GetInputTextDirection() { |
| 463 // Not supported. | 463 // Not supported. |
| 464 return base::i18n::UNKNOWN_DIRECTION; | 464 return base::i18n::UNKNOWN_DIRECTION; |
| 465 } | 465 } |
| 466 | 466 |
| 467 bool InputMethodIBus::IsActive() { | 467 bool InputMethodIBus::IsActive() { |
| 468 return context_ != NULL; | 468 return true; |
| 469 } | 469 } |
| 470 | 470 |
| 471 // static | 471 // static |
| 472 bool InputMethodIBus::IsInputMethodIBusEnabled() { | 472 bool InputMethodIBus::IsInputMethodIBusEnabled() { |
| 473 #if defined(TOUCH_UI) | 473 #if defined(TOUCH_UI) |
| 474 return true; | 474 return true; |
| 475 #else | 475 #else |
| 476 return inputmethod_ibus_enabled || | 476 return inputmethod_ibus_enabled || |
| 477 CommandLine::ForCurrentProcess()->HasSwitch( | 477 CommandLine::ForCurrentProcess()->HasSwitch( |
| 478 kEnableInputMethodIBusSwitch); | 478 kEnableInputMethodIBusSwitch); |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 DCHECK_EQ(GetIBus(), bus); | 1012 DCHECK_EQ(GetIBus(), bus); |
| 1013 DCHECK(data); | 1013 DCHECK(data); |
| 1014 IBusInputContext* ic = | 1014 IBusInputContext* ic = |
| 1015 ibus_bus_create_input_context_async_finish(bus, res, NULL); | 1015 ibus_bus_create_input_context_async_finish(bus, res, NULL); |
| 1016 if (ic) | 1016 if (ic) |
| 1017 data->StoreOrAbandonInputContext(ic); | 1017 data->StoreOrAbandonInputContext(ic); |
| 1018 delete data; | 1018 delete data; |
| 1019 } | 1019 } |
| 1020 | 1020 |
| 1021 } // namespace views | 1021 } // namespace views |
| OLD | NEW |