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 23 matching lines...) Expand all Loading... |
34 root_window_controller_->ActivateKeyboard(keyboard_controller); | 34 root_window_controller_->ActivateKeyboard(keyboard_controller); |
35 } | 35 } |
36 | 36 |
37 void VirtualKeyboardWindowController::UpdateWindow( | 37 void VirtualKeyboardWindowController::UpdateWindow( |
38 const DisplayInfo& display_info) { | 38 const DisplayInfo& display_info) { |
39 static int virtual_keyboard_root_window_count = 0; | 39 static int virtual_keyboard_root_window_count = 0; |
40 if (!root_window_controller_.get()) { | 40 if (!root_window_controller_.get()) { |
41 const gfx::Rect& bounds_in_native = display_info.bounds_in_native(); | 41 const gfx::Rect& bounds_in_native = display_info.bounds_in_native(); |
42 aura::RootWindow::CreateParams params(bounds_in_native); | 42 aura::RootWindow::CreateParams params(bounds_in_native); |
43 params.host = Shell::GetInstance()->root_window_host_factory()-> | 43 params.host = Shell::GetInstance()->root_window_host_factory()-> |
44 CreateWindowTreeHost(bounds_in_native); | 44 CreateRootWindowHost(bounds_in_native); |
45 aura::RootWindow* root_window = new aura::RootWindow(params); | 45 aura::RootWindow* root_window = new aura::RootWindow(params); |
46 | 46 |
47 root_window->window()->SetName( | 47 root_window->window()->SetName( |
48 base::StringPrintf("VirtualKeyboardRootWindow-%d", | 48 base::StringPrintf("VirtualKeyboardRootWindow-%d", |
49 virtual_keyboard_root_window_count++)); | 49 virtual_keyboard_root_window_count++)); |
50 | 50 |
51 // No need to remove RootWindowObserver because | 51 // No need to remove RootWindowObserver because |
52 // the DisplayController object outlives RootWindow objects. | 52 // the DisplayController object outlives RootWindow objects. |
53 root_window->AddRootWindowObserver( | 53 root_window->AddRootWindowObserver( |
54 Shell::GetInstance()->display_controller()); | 54 Shell::GetInstance()->display_controller()); |
(...skipping 18 matching lines...) Expand all Loading... |
73 if (root_window_controller_.get()) { | 73 if (root_window_controller_.get()) { |
74 root_window_controller_->dispatcher()->RemoveRootWindowObserver( | 74 root_window_controller_->dispatcher()->RemoveRootWindowObserver( |
75 Shell::GetInstance()->display_controller()); | 75 Shell::GetInstance()->display_controller()); |
76 root_window_controller_->Shutdown(); | 76 root_window_controller_->Shutdown(); |
77 root_window_controller_.reset(); | 77 root_window_controller_.reset(); |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 } // namespace internal | 81 } // namespace internal |
82 } // namespace ash | 82 } // namespace ash |
OLD | NEW |