Index: ash/shell/keyboard_controller_proxy_stub.cc |
diff --git a/ash/shell/keyboard_controller_proxy_stub.cc b/ash/shell/keyboard_controller_proxy_stub.cc |
index 700c834365f02671dff6509ae3871363f809e74c..9ebe37b9ad8ac360bf4e1348d6b718c1a223acca 100644 |
--- a/ash/shell/keyboard_controller_proxy_stub.cc |
+++ b/ash/shell/keyboard_controller_proxy_stub.cc |
@@ -20,9 +20,11 @@ KeyboardControllerProxyStub::~KeyboardControllerProxyStub() { |
} |
aura::Window* KeyboardControllerProxyStub::GetKeyboardWindow() { |
- aura::Window* window = new aura::Window(&delegate_); |
- window->Init(ui::LAYER_NOT_DRAWN); |
- return window; |
+ if (!keyboard_) { |
+ keyboard_.reset(new aura::Window(&delegate_)); |
+ keyboard_->Init(ui::LAYER_NOT_DRAWN); |
+ } |
+ return keyboard_.get(); |
} |
BrowserContext* KeyboardControllerProxyStub::GetBrowserContext() { |