OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 keyboard::KeyboardController* keyboard_controller) { | 681 keyboard::KeyboardController* keyboard_controller) { |
682 if (!keyboard::IsKeyboardEnabled() || | 682 if (!keyboard::IsKeyboardEnabled() || |
683 GetContainer(kShellWindowId_VirtualKeyboardContainer)) { | 683 GetContainer(kShellWindowId_VirtualKeyboardContainer)) { |
684 return; | 684 return; |
685 } | 685 } |
686 DCHECK(keyboard_controller); | 686 DCHECK(keyboard_controller); |
687 if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) { | 687 if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) { |
688 keyboard_controller->AddObserver(shelf()->shelf_layout_manager()); | 688 keyboard_controller->AddObserver(shelf()->shelf_layout_manager()); |
689 keyboard_controller->AddObserver(panel_layout_manager_); | 689 keyboard_controller->AddObserver(panel_layout_manager_); |
690 keyboard_controller->AddObserver(docked_layout_manager_); | 690 keyboard_controller->AddObserver(docked_layout_manager_); |
| 691 keyboard_controller->AddObserver(workspace_controller_->layout_manager()); |
691 Shell::GetInstance()->delegate()->VirtualKeyboardActivated(true); | 692 Shell::GetInstance()->delegate()->VirtualKeyboardActivated(true); |
692 } | 693 } |
693 aura::Window* parent = GetContainer( | 694 aura::Window* parent = GetContainer( |
694 kShellWindowId_VirtualKeyboardParentContainer); | 695 kShellWindowId_VirtualKeyboardParentContainer); |
695 DCHECK(parent); | 696 DCHECK(parent); |
696 aura::Window* keyboard_container = | 697 aura::Window* keyboard_container = |
697 keyboard_controller->GetContainerWindow(); | 698 keyboard_controller->GetContainerWindow(); |
698 keyboard_container->set_id(kShellWindowId_VirtualKeyboardContainer); | 699 keyboard_container->set_id(kShellWindowId_VirtualKeyboardContainer); |
699 parent->AddChild(keyboard_container); | 700 parent->AddChild(keyboard_container); |
700 // TODO(oshima): Bounds of keyboard container should be handled by | 701 // TODO(oshima): Bounds of keyboard container should be handled by |
(...skipping 14 matching lines...) Expand all Loading... |
715 kShellWindowId_VirtualKeyboardParentContainer); | 716 kShellWindowId_VirtualKeyboardParentContainer); |
716 DCHECK(parent); | 717 DCHECK(parent); |
717 parent->RemoveChild(keyboard_container); | 718 parent->RemoveChild(keyboard_container); |
718 if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) { | 719 if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) { |
719 // Virtual keyboard may be deactivated while still showing, notify all | 720 // Virtual keyboard may be deactivated while still showing, notify all |
720 // observers that keyboard bounds changed to 0 before remove them. | 721 // observers that keyboard bounds changed to 0 before remove them. |
721 keyboard_controller->NotifyKeyboardBoundsChanging(gfx::Rect()); | 722 keyboard_controller->NotifyKeyboardBoundsChanging(gfx::Rect()); |
722 keyboard_controller->RemoveObserver(shelf()->shelf_layout_manager()); | 723 keyboard_controller->RemoveObserver(shelf()->shelf_layout_manager()); |
723 keyboard_controller->RemoveObserver(panel_layout_manager_); | 724 keyboard_controller->RemoveObserver(panel_layout_manager_); |
724 keyboard_controller->RemoveObserver(docked_layout_manager_); | 725 keyboard_controller->RemoveObserver(docked_layout_manager_); |
| 726 keyboard_controller->RemoveObserver( |
| 727 workspace_controller_->layout_manager()); |
725 Shell::GetInstance()->delegate()->VirtualKeyboardActivated(false); | 728 Shell::GetInstance()->delegate()->VirtualKeyboardActivated(false); |
726 } | 729 } |
727 } | 730 } |
728 } | 731 } |
729 | 732 |
730 bool RootWindowController::IsVirtualKeyboardWindow(aura::Window* window) { | 733 bool RootWindowController::IsVirtualKeyboardWindow(aura::Window* window) { |
731 aura::Window* parent = GetContainer( | 734 aura::Window* parent = GetContainer( |
732 kShellWindowId_VirtualKeyboardParentContainer); | 735 kShellWindowId_VirtualKeyboardParentContainer); |
733 return parent ? parent->Contains(window) : false; | 736 return parent ? parent->Contains(window) : false; |
734 } | 737 } |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 else | 1100 else |
1098 DisableTouchHudProjection(); | 1101 DisableTouchHudProjection(); |
1099 } | 1102 } |
1100 | 1103 |
1101 RootWindowController* GetRootWindowController( | 1104 RootWindowController* GetRootWindowController( |
1102 const aura::Window* root_window) { | 1105 const aura::Window* root_window) { |
1103 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 1106 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
1104 } | 1107 } |
1105 | 1108 |
1106 } // namespace ash | 1109 } // namespace ash |
OLD | NEW |