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

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

Issue 11415266: Extract a delegate interface from c/b/input_method to permit decoupling from c/b. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Class comment. Created 8 years 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
Index: chrome/browser/chromeos/input_method/input_method_manager_impl.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
index a72b12746faf99cd4a9af144edcae71368b590e0..8a45e83c264eb4cdc1456121a4204fbabac2c19e 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -12,6 +12,7 @@
#include "base/stringprintf.h"
#include "chrome/browser/chromeos/input_method/browser_state_monitor.h"
#include "chrome/browser/chromeos/input_method/candidate_window_controller.h"
+#include "chrome/browser/chromeos/input_method/input_method_delegate.h"
#include "chrome/browser/chromeos/input_method/input_method_engine_ibus.h"
#include "chrome/browser/chromeos/input_method/input_method_util.h"
#include "chrome/browser/chromeos/input_method/xkeyboard.h"
@@ -32,9 +33,11 @@ bool Contains(const std::vector<std::string>& container,
} // namespace
-InputMethodManagerImpl::InputMethodManagerImpl()
- : state_(STATE_LOGIN_SCREEN),
- util_(GetSupportedInputMethods()) {
+InputMethodManagerImpl::InputMethodManagerImpl(
+ scoped_ptr<InputMethodDelegate> delegate)
+ : delegate_(delegate.Pass()),
+ state_(STATE_LOGIN_SCREEN),
+ util_(delegate_.get(), GetSupportedInputMethods()) {
}
InputMethodManagerImpl::~InputMethodManagerImpl() {
@@ -579,7 +582,7 @@ void InputMethodManagerImpl::OnDisconnected() {
void InputMethodManagerImpl::Init() {
DCHECK(!ibus_controller_.get());
- browser_state_monitor_.reset(new BrowserStateMonitor(this));
+ browser_state_monitor_.reset(new BrowserStateMonitor(this, delegate_.get()));
ibus_controller_.reset(IBusController::Create());
xkeyboard_.reset(XKeyboard::Create(util_));
ibus_controller_->AddObserver(this);
@@ -682,10 +685,5 @@ void InputMethodManagerImpl::MaybeInitializeCandidateWindowController() {
DVLOG(1) << "Failed to initialize the candidate window controller";
}
-// static
-InputMethodManagerImpl* InputMethodManagerImpl::GetInstanceForTesting() {
- return new InputMethodManagerImpl;
-}
-
} // namespace input_method
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698