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

Unified Diff: chrome/browser/chromeos/input_method/input_method_engine_ibus.cc

Issue 50243005: ChromeOS: Remove unused IBus classes from chromeos/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/input_method/input_method_engine_ibus.h ('k') | chromeos/chromeos.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6370966146b15ea1948a75fb8ffb9442f8fddc29 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc
+++ b/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc
@@ -53,8 +53,8 @@ InputMethodEngineIBus::InputMethodEngineIBus()
component_(new IBusComponent()),
candidate_window_(new input_method::CandidateWindow()),
window_visible_(false),
- weak_ptr_factory_(this) {
-}
+ ibus_engine_factory_service_(IBusEngineFactoryService::Create()),
+ weak_ptr_factory_(this) {}
InputMethodEngineIBus::~InputMethodEngineIBus() {
input_method::InputMethodManager::Get()->RemoveInputMethodExtension(ibus_id_);
@@ -65,7 +65,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 +527,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 +595,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 +609,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_);
« no previous file with comments | « chrome/browser/chromeos/input_method/input_method_engine_ibus.h ('k') | chromeos/chromeos.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698