| 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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 } | 605 } |
| 606 | 606 |
| 607 void RootWindowController::ActivateKeyboard( | 607 void RootWindowController::ActivateKeyboard( |
| 608 keyboard::KeyboardController* keyboard_controller) { | 608 keyboard::KeyboardController* keyboard_controller) { |
| 609 if (!keyboard::IsKeyboardEnabled() || | 609 if (!keyboard::IsKeyboardEnabled() || |
| 610 GetContainer(kShellWindowId_VirtualKeyboardContainer)) { | 610 GetContainer(kShellWindowId_VirtualKeyboardContainer)) { |
| 611 return; | 611 return; |
| 612 } | 612 } |
| 613 DCHECK(keyboard_controller); | 613 DCHECK(keyboard_controller); |
| 614 if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) { | 614 if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) { |
| 615 aura::client::SetVirtualKeyboardClient(root_window(), keyboard_controller); |
| 615 keyboard_controller->AddObserver(shelf()->shelf_layout_manager()); | 616 keyboard_controller->AddObserver(shelf()->shelf_layout_manager()); |
| 616 keyboard_controller->AddObserver(panel_layout_manager_); | 617 keyboard_controller->AddObserver(panel_layout_manager_); |
| 617 keyboard_controller->AddObserver(docked_layout_manager_); | 618 keyboard_controller->AddObserver(docked_layout_manager_); |
| 618 } | 619 } |
| 619 aura::Window* parent = GetContainer( | 620 aura::Window* parent = GetContainer( |
| 620 kShellWindowId_VirtualKeyboardParentContainer); | 621 kShellWindowId_VirtualKeyboardParentContainer); |
| 621 DCHECK(parent); | 622 DCHECK(parent); |
| 622 aura::Window* keyboard_container = | 623 aura::Window* keyboard_container = |
| 623 keyboard_controller->GetContainerWindow(); | 624 keyboard_controller->GetContainerWindow(); |
| 624 keyboard_container->set_id(kShellWindowId_VirtualKeyboardContainer); | 625 keyboard_container->set_id(kShellWindowId_VirtualKeyboardContainer); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 638 keyboard_controller->GetContainerWindow(); | 639 keyboard_controller->GetContainerWindow(); |
| 639 if (keyboard_container->GetRootWindow() == root_window()) { | 640 if (keyboard_container->GetRootWindow() == root_window()) { |
| 640 aura::Window* parent = GetContainer( | 641 aura::Window* parent = GetContainer( |
| 641 kShellWindowId_VirtualKeyboardParentContainer); | 642 kShellWindowId_VirtualKeyboardParentContainer); |
| 642 DCHECK(parent); | 643 DCHECK(parent); |
| 643 parent->RemoveChild(keyboard_container); | 644 parent->RemoveChild(keyboard_container); |
| 644 if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) { | 645 if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) { |
| 645 // Virtual keyboard may be deactivated while still showing, notify all | 646 // Virtual keyboard may be deactivated while still showing, notify all |
| 646 // observers that keyboard bounds changed to 0 before remove them. | 647 // observers that keyboard bounds changed to 0 before remove them. |
| 647 keyboard_controller->NotifyKeyboardBoundsChanging(gfx::Rect()); | 648 keyboard_controller->NotifyKeyboardBoundsChanging(gfx::Rect()); |
| 649 aura::client::SetVirtualKeyboardClient(root_window(), NULL); |
| 648 keyboard_controller->RemoveObserver(shelf()->shelf_layout_manager()); | 650 keyboard_controller->RemoveObserver(shelf()->shelf_layout_manager()); |
| 649 keyboard_controller->RemoveObserver(panel_layout_manager_); | 651 keyboard_controller->RemoveObserver(panel_layout_manager_); |
| 650 keyboard_controller->RemoveObserver(docked_layout_manager_); | 652 keyboard_controller->RemoveObserver(docked_layout_manager_); |
| 651 } | 653 } |
| 652 } | 654 } |
| 653 } | 655 } |
| 654 | 656 |
| 655 //////////////////////////////////////////////////////////////////////////////// | 657 //////////////////////////////////////////////////////////////////////////////// |
| 656 // RootWindowController, private: | 658 // RootWindowController, private: |
| 657 | 659 |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 DisableTouchHudProjection(); | 1007 DisableTouchHudProjection(); |
| 1006 } | 1008 } |
| 1007 | 1009 |
| 1008 RootWindowController* GetRootWindowController( | 1010 RootWindowController* GetRootWindowController( |
| 1009 const aura::Window* root_window) { | 1011 const aura::Window* root_window) { |
| 1010 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 1012 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
| 1011 } | 1013 } |
| 1012 | 1014 |
| 1013 } // namespace internal | 1015 } // namespace internal |
| 1014 } // namespace ash | 1016 } // namespace ash |
| OLD | NEW |