Chromium Code Reviews| Index: chrome/browser/chromeos/input_method/input_method_engine_ibus.cc |
| diff --git a/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc b/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc |
| index bd7d4f21c7c47d50cb2f9d545a1eb0953f173546..1804a100856ad55f9b34ac244a6d56cf83cc54d6 100644 |
| --- a/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc |
| +++ b/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc |
| @@ -54,6 +54,7 @@ InputMethodEngineIBus::InputMethodEngineIBus() |
| candidate_window_(new input_method::CandidateWindow()), |
| window_visible_(false), |
| weak_ptr_factory_(this) { |
| + ibus_engine_factory_service_.reset(IBusEngineFactoryService::Create()); |
|
satorux1
2013/11/05 03:37:55
do this in the initializer list?
ibus_engine_f
pneubeck (no reviews)
2013/11/06 09:07:56
Done.
|
| } |
| InputMethodEngineIBus::~InputMethodEngineIBus() { |
| @@ -65,7 +66,7 @@ InputMethodEngineIBus::~InputMethodEngineIBus() { |
| // InputMethodManager once ibus-daemon is gone. (crbug.com/158273) |
| if (!object_path_.value().empty()) { |
| GetCurrentService()->UnsetEngine(this); |
| - DBusThreadManager::Get()->RemoveIBusEngineService(object_path_); |
| + ibus_engine_service_.reset(); |
| } |
| } |
| @@ -527,7 +528,9 @@ void InputMethodEngineIBus::SetSurroundingText(const std::string& text, |
| } |
| IBusEngineService* InputMethodEngineIBus::GetCurrentService() { |
| - return DBusThreadManager::Get()->GetIBusEngineService(object_path_); |
| + if (!ibus_engine_service_) |
| + ibus_engine_service_.reset(IBusEngineService::Create()); |
| + return ibus_engine_service_.get(); |
| } |
| void InputMethodEngineIBus::MenuItemToProperty( |
| @@ -593,11 +596,10 @@ void InputMethodEngineIBus::RegisterComponent() { |
| } |
| void InputMethodEngineIBus::OnComponentRegistered() { |
| - DBusThreadManager::Get()->GetIBusEngineFactoryService()-> |
| - SetCreateEngineHandler(ibus_id_, |
| - base::Bind( |
| - &InputMethodEngineIBus::CreateEngineHandler, |
| - weak_ptr_factory_.GetWeakPtr())); |
| + ibus_engine_factory_service_->SetCreateEngineHandler( |
| + ibus_id_, |
| + base::Bind(&InputMethodEngineIBus::CreateEngineHandler, |
| + weak_ptr_factory_.GetWeakPtr())); |
| } |
| void InputMethodEngineIBus::OnComponentRegistrationFailed() { |
| @@ -608,10 +610,8 @@ void InputMethodEngineIBus::OnComponentRegistrationFailed() { |
| void InputMethodEngineIBus::CreateEngineHandler( |
| const IBusEngineFactoryService::CreateEngineResponseSender& sender) { |
| GetCurrentService()->UnsetEngine(this); |
| - DBusThreadManager::Get()->RemoveIBusEngineService(object_path_); |
| - |
| - object_path_ = DBusThreadManager::Get()->GetIBusEngineFactoryService()-> |
| - GenerateUniqueObjectPath(); |
| + ibus_engine_service_.reset(); |
| + object_path_ = ibus_engine_factory_service_->GenerateUniqueObjectPath(); |
| GetCurrentService()->SetEngine(this); |
| sender.Run(object_path_); |