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

Unified Diff: ash/shell.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 | « ash/shell.h ('k') | ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index f297ca2c1d9eafc8b1bb7137c62e3f43d25a9096..bdc9c579838b31d0a8fed881bff8cd495347c391 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -410,22 +410,22 @@ void Shell::CreateKeyboard() {
InitKeyboard();
if (keyboard::IsKeyboardUsabilityExperimentEnabled()) {
display_controller()->virtual_keyboard_window_controller()->
- ActivateKeyboard(keyboard_controller_.get());
+ ActivateKeyboard(keyboard::KeyboardController::GetInstance());
} else {
GetPrimaryRootWindowController()->
- ActivateKeyboard(keyboard_controller_.get());
+ ActivateKeyboard(keyboard::KeyboardController::GetInstance());
}
}
void Shell::DeactivateKeyboard() {
- if (keyboard_controller_.get()) {
+ if (keyboard::KeyboardController::GetInstance()) {
RootWindowControllerList controllers = GetAllRootWindowControllers();
for (RootWindowControllerList::iterator iter = controllers.begin();
iter != controllers.end(); ++iter) {
- (*iter)->DeactivateKeyboard(keyboard_controller_.get());
+ (*iter)->DeactivateKeyboard(keyboard::KeyboardController::GetInstance());
}
}
- keyboard_controller_.reset();
+ keyboard::KeyboardController::ResetInstance(NULL);
}
void Shell::ShowShelf() {
@@ -753,12 +753,12 @@ Shell::~Shell() {
display_controller_->Shutdown();
display_controller_.reset();
screen_position_controller_.reset();
-
- keyboard_controller_.reset();
accessibility_delegate_.reset();
new_window_delegate_.reset();
media_delegate_.reset();
+ keyboard::KeyboardController::ResetInstance(NULL);
+
#if defined(OS_CHROMEOS)
if (display_change_observer_)
output_configurator_->RemoveObserver(display_change_observer_.get());
@@ -1023,16 +1023,17 @@ void Shell::Init() {
void Shell::InitKeyboard() {
if (keyboard::IsKeyboardEnabled()) {
- if (keyboard_controller_.get()) {
+ if (keyboard::KeyboardController::GetInstance()) {
RootWindowControllerList controllers = GetAllRootWindowControllers();
for (RootWindowControllerList::iterator iter = controllers.begin();
iter != controllers.end(); ++iter) {
- (*iter)->DeactivateKeyboard(keyboard_controller_.get());
+ (*iter)->DeactivateKeyboard(
+ keyboard::KeyboardController::GetInstance());
}
}
keyboard::KeyboardControllerProxy* proxy =
delegate_->CreateKeyboardControllerProxy();
- keyboard_controller_.reset(
+ keyboard::KeyboardController::ResetInstance(
new keyboard::KeyboardController(proxy));
}
}
« no previous file with comments | « ash/shell.h ('k') | ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698