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

Unified Diff: ash/root_window_controller.cc

Issue 25111002: Only show virtual keyboard on primary root window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move container_ initialization back Created 7 years, 2 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/root_window_controller.h ('k') | ash/root_window_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 3b36a710965dc96bd43d78c610f0cb55e440cc7e..b52305c8c9aa94c41215912a4322461b785facd5 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -331,7 +331,6 @@ void RootWindowController::Init(bool first_run_after_boot) {
CreateSystemBackground(first_run_after_boot);
InitLayoutManagers();
- InitKeyboard();
InitTouchHuds();
if (Shell::GetPrimaryRootWindowController()->
@@ -519,26 +518,33 @@ const aura::Window* RootWindowController::GetTopmostFullscreenWindow() const {
return NULL;
}
-void RootWindowController::InitKeyboard() {
+void RootWindowController::EnableKeyboard(
+ keyboard::KeyboardController* keyboard_controller) {
if (keyboard::IsKeyboardEnabled()) {
oshima 2013/10/03 16:38:46 Please add check if the keyboard controller is alr
bshe 2013/10/04 00:58:08 Done.
+ keyboard_controller->AddObserver(shelf()->shelf_layout_manager());
+ keyboard_controller->AddObserver(panel_layout_manager_);
varkha 2013/10/03 18:39:41 You will need to add (move here) keyboard_controll
bshe 2013/10/04 00:58:08 Aha. Looks like your CL has landed. I will add it
aura::Window* parent = root_window();
-
- keyboard::KeyboardControllerProxy* proxy =
- Shell::GetInstance()->delegate()->CreateKeyboardControllerProxy();
- keyboard_controller_.reset(
- new keyboard::KeyboardController(proxy));
-
- keyboard_controller_->AddObserver(shelf()->shelf_layout_manager());
- keyboard_controller_->AddObserver(panel_layout_manager_);
-
aura::Window* keyboard_container =
- keyboard_controller_->GetContainerWindow();
+ keyboard_controller->GetContainerWindow();
keyboard_container->set_id(kShellWindowId_VirtualKeyboardContainer);
parent->AddChild(keyboard_container);
keyboard_container->SetBounds(parent->bounds());
}
}
+void RootWindowController::DisableKeyboard(
+ keyboard::KeyboardController* keyboard_controller) {
+ if (keyboard::IsKeyboardEnabled()) {
+ aura::Window* keyboard_container =
+ keyboard_controller->GetContainerWindow();
+ if (root_window()->Contains(keyboard_container)) {
oshima 2013/10/03 16:38:46 keyboard_container->GetRootWindow() == root_window
bshe 2013/10/04 00:58:08 Done.
+ root_window()->RemoveChild(keyboard_controller->GetContainerWindow());
+ keyboard_controller->RemoveObserver(shelf()->shelf_layout_manager());
+ keyboard_controller->RemoveObserver(panel_layout_manager_);
varkha 2013/10/03 18:39:41 You will need to add keyboard_controller->RemoveOb
bshe 2013/10/04 00:58:08 ditto On 2013/10/03 18:39:41, varkha wrote:
+ }
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////
// RootWindowController, private:
@@ -812,8 +818,6 @@ void RootWindowController::DisableTouchHudProjection() {
}
void RootWindowController::OnLoginStateChanged(user::LoginStatus status) {
- if (status != user::LOGGED_IN_NONE)
- InitKeyboard();
shelf_->shelf_layout_manager()->UpdateVisibilityState();
}
« no previous file with comments | « ash/root_window_controller.h ('k') | ash/root_window_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698