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/display/root_window_transformers.h" | 10 #include "ash/display/root_window_transformers.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 root_window_controller_->ActivateKeyboard(keyboard_controller); | 36 root_window_controller_->ActivateKeyboard(keyboard_controller); |
37 } | 37 } |
38 | 38 |
39 void VirtualKeyboardWindowController::UpdateWindow( | 39 void VirtualKeyboardWindowController::UpdateWindow( |
40 const DisplayInfo& display_info) { | 40 const DisplayInfo& display_info) { |
41 static int virtual_keyboard_root_window_count = 0; | 41 static int virtual_keyboard_root_window_count = 0; |
42 if (!root_window_controller_.get()) { | 42 if (!root_window_controller_.get()) { |
43 const gfx::Rect& bounds_in_native = display_info.bounds_in_native(); | 43 const gfx::Rect& bounds_in_native = display_info.bounds_in_native(); |
44 aura::RootWindow::CreateParams params(bounds_in_native); | 44 aura::RootWindow::CreateParams params(bounds_in_native); |
45 params.host = Shell::GetInstance()->root_window_host_factory()-> | 45 params.host = Shell::GetInstance()->root_window_host_factory()-> |
46 CreateRootWindowHost(bounds_in_native); | 46 CreateWindowTreeHost(bounds_in_native); |
47 aura::RootWindow* root_window = new aura::RootWindow(params); | 47 aura::RootWindow* root_window = new aura::RootWindow(params); |
48 | 48 |
49 root_window->window()->SetName( | 49 root_window->window()->SetName( |
50 base::StringPrintf("VirtualKeyboardRootWindow-%d", | 50 base::StringPrintf("VirtualKeyboardRootWindow-%d", |
51 virtual_keyboard_root_window_count++)); | 51 virtual_keyboard_root_window_count++)); |
52 | 52 |
53 // No need to remove RootWindowObserver because | 53 // No need to remove RootWindowObserver because |
54 // the DisplayController object outlives RootWindow objects. | 54 // the DisplayController object outlives RootWindow objects. |
55 root_window->AddRootWindowObserver( | 55 root_window->AddRootWindowObserver( |
56 Shell::GetInstance()->display_controller()); | 56 Shell::GetInstance()->display_controller()); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 aura::RootWindow* root_window = root_window_controller_->dispatcher(); | 94 aura::RootWindow* root_window = root_window_controller_->dispatcher(); |
95 scoped_ptr<aura::RootWindowTransformer> transformer( | 95 scoped_ptr<aura::RootWindowTransformer> transformer( |
96 internal::CreateRootWindowTransformerForDisplay(root_window->window(), | 96 internal::CreateRootWindowTransformerForDisplay(root_window->window(), |
97 display_manager->non_desktop_display())); | 97 display_manager->non_desktop_display())); |
98 root_window->host()->SetRootWindowTransformer(transformer.Pass()); | 98 root_window->host()->SetRootWindowTransformer(transformer.Pass()); |
99 } | 99 } |
100 | 100 |
101 } // namespace internal | 101 } // namespace internal |
102 } // namespace ash | 102 } // namespace ash |
OLD | NEW |