| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/input_method/ibus_controller_impl.h" | 5 #include "chrome/browser/chromeos/input_method/ibus_controller_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> // for std::reverse. | 7 #include <algorithm> // for std::reverse. |
| 8 #include <cstdio> | 8 #include <cstdio> |
| 9 #include <cstring> // for std::strcmp. | 9 #include <cstring> // for std::strcmp. |
| 10 #include <set> | 10 #include <set> |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 } | 404 } |
| 405 | 405 |
| 406 bool IBusControllerImpl::Start() { | 406 bool IBusControllerImpl::Start() { |
| 407 MaybeInitializeIBusBus(); | 407 MaybeInitializeIBusBus(); |
| 408 should_launch_daemon_ = true; | 408 should_launch_daemon_ = true; |
| 409 if (IBusConnectionsAreAlive()) | 409 if (IBusConnectionsAreAlive()) |
| 410 return true; | 410 return true; |
| 411 return MaybeLaunchIBusDaemon(); | 411 return MaybeLaunchIBusDaemon(); |
| 412 } | 412 } |
| 413 | 413 |
| 414 void IBusControllerImpl::Reset() { |
| 415 if (!IBusConnectionsAreAlive()) |
| 416 return; |
| 417 IBusInputContext* context = |
| 418 GetInputContext(current_input_context_path_, ibus_); |
| 419 if (!context) |
| 420 return; |
| 421 ibus_input_context_reset(context); |
| 422 } |
| 423 |
| 414 bool IBusControllerImpl::Stop() { | 424 bool IBusControllerImpl::Stop() { |
| 415 if (IBusConnectionsAreAlive()) { | 425 if (IBusConnectionsAreAlive()) { |
| 416 // Ask IBus to exit *asynchronously*. | 426 // Ask IBus to exit *asynchronously*. |
| 417 ibus_bus_exit_async(ibus_, | 427 ibus_bus_exit_async(ibus_, |
| 418 FALSE /* do not restart */, | 428 FALSE /* do not restart */, |
| 419 -1 /* timeout */, | 429 -1 /* timeout */, |
| 420 NULL /* cancellable */, | 430 NULL /* cancellable */, |
| 421 NULL /* callback */, | 431 NULL /* callback */, |
| 422 NULL /* user_data */); | 432 NULL /* user_data */); |
| 423 if (ibus_config_) { | 433 if (ibus_config_) { |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 | 978 |
| 969 // static | 979 // static |
| 970 bool IBusControllerImpl::FindAndUpdatePropertyForTesting( | 980 bool IBusControllerImpl::FindAndUpdatePropertyForTesting( |
| 971 const chromeos::input_method::InputMethodProperty& new_prop, | 981 const chromeos::input_method::InputMethodProperty& new_prop, |
| 972 chromeos::input_method::InputMethodPropertyList* prop_list) { | 982 chromeos::input_method::InputMethodPropertyList* prop_list) { |
| 973 return FindAndUpdateProperty(new_prop, prop_list); | 983 return FindAndUpdateProperty(new_prop, prop_list); |
| 974 } | 984 } |
| 975 | 985 |
| 976 } // namespace input_method | 986 } // namespace input_method |
| 977 } // namespace chromeos | 987 } // namespace chromeos |
| OLD | NEW |