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

Unified Diff: ui/keyboard/keyboard_controller.cc

Issue 219503003: Make keyboard controller a singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix root window controller unittets. Created 6 years, 8 months 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 | « ui/keyboard/keyboard_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/keyboard_controller.cc
diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc
index 1de832c0c57f5b327996cc56556cd9d5bdbc89ab..e91c5b828e740b115abfbba57b5f48607d0b3b31 100644
--- a/ui/keyboard/keyboard_controller.cc
+++ b/ui/keyboard/keyboard_controller.cc
@@ -178,6 +178,9 @@ void CallbackAnimationObserver::OnLayerAnimationAborted(
animator_->RemoveObserver(this);
}
+// static
+KeyboardController* KeyboardController::instance_ = NULL;
+
KeyboardController::KeyboardController(KeyboardControllerProxy* proxy)
: proxy_(proxy),
input_method_(NULL),
@@ -197,6 +200,18 @@ KeyboardController::~KeyboardController() {
input_method_->RemoveObserver(this);
}
+// static
+void KeyboardController::ResetInstance(KeyboardController* controller) {
+ if (instance_ && instance_ != controller)
+ delete instance_;
+ instance_ = controller;
+}
+
+// static
+KeyboardController* KeyboardController::GetInstance() {
+ return instance_;
+}
+
aura::Window* KeyboardController::GetContainerWindow() {
if (!container_.get()) {
container_.reset(new aura::Window(
« no previous file with comments | « ui/keyboard/keyboard_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698