Chromium Code Reviews| 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; |
|
not at google - send to devlin
2014/04/01 16:05:12
typically you would use base::Singleton for single
|
| + |
| 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( |