OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/display/virtual_keyboard_window_controller.h" | 5 #include "ash/display/virtual_keyboard_window_controller.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/display/display_info.h" | 8 #include "ash/display/display_info.h" |
9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
10 #include "ash/host/root_window_host_factory.h" | 10 #include "ash/host/root_window_host_factory.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 // No need to remove RootWindowObserver because | 45 // No need to remove RootWindowObserver because |
46 // the DisplayController object outlives RootWindow objects. | 46 // the DisplayController object outlives RootWindow objects. |
47 root_window->AddRootWindowObserver( | 47 root_window->AddRootWindowObserver( |
48 Shell::GetInstance()->display_controller()); | 48 Shell::GetInstance()->display_controller()); |
49 InitRootWindowSettings(root_window)->display_id = display_info.id(); | 49 InitRootWindowSettings(root_window)->display_id = display_info.id(); |
50 root_window->Init(); | 50 root_window->Init(); |
51 RootWindowController::CreateForVirtualKeyboardDisplay(root_window); | 51 RootWindowController::CreateForVirtualKeyboardDisplay(root_window); |
52 root_window_controller_.reset(GetRootWindowController(root_window)); | 52 root_window_controller_.reset(GetRootWindowController(root_window)); |
53 root_window_controller_->root_window()->ShowRootWindow(); | 53 root_window_controller_->root_window()->ShowRootWindow(); |
| 54 root_window_controller_->ActivateKeyboard( |
| 55 Shell::GetInstance()->keyboard_controller()); |
54 } else { | 56 } else { |
55 aura::RootWindow* root_window = root_window_controller_->root_window(); | 57 aura::RootWindow* root_window = root_window_controller_->root_window(); |
56 GetRootWindowSettings(root_window)->display_id = display_info.id(); | 58 GetRootWindowSettings(root_window)->display_id = display_info.id(); |
57 root_window->SetHostBounds(display_info.bounds_in_native()); | 59 root_window->SetHostBounds(display_info.bounds_in_native()); |
58 } | 60 } |
59 } | 61 } |
60 | 62 |
61 void VirtualKeyboardWindowController::Close() { | 63 void VirtualKeyboardWindowController::Close() { |
62 if (root_window_controller_.get()) { | 64 if (root_window_controller_.get()) { |
63 root_window_controller_->root_window()->RemoveRootWindowObserver( | 65 root_window_controller_->root_window()->RemoveRootWindowObserver( |
64 Shell::GetInstance()->display_controller()); | 66 Shell::GetInstance()->display_controller()); |
65 root_window_controller_->Shutdown(); | 67 root_window_controller_->Shutdown(); |
66 root_window_controller_.reset(); | 68 root_window_controller_.reset(); |
67 } | 69 } |
68 } | 70 } |
69 | 71 |
70 } // namespace internal | 72 } // namespace internal |
71 } // namespace ash | 73 } // namespace ash |
OLD | NEW |