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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 #include "ui/aura/client/capture_client.h" | 41 #include "ui/aura/client/capture_client.h" |
42 #include "ui/aura/client/focus_client.h" | 42 #include "ui/aura/client/focus_client.h" |
43 #include "ui/aura/client/tooltip_client.h" | 43 #include "ui/aura/client/tooltip_client.h" |
44 #include "ui/aura/root_window.h" | 44 #include "ui/aura/root_window.h" |
45 #include "ui/aura/window.h" | 45 #include "ui/aura/window.h" |
46 #include "ui/aura/window_observer.h" | 46 #include "ui/aura/window_observer.h" |
47 #include "ui/aura/window_tracker.h" | 47 #include "ui/aura/window_tracker.h" |
48 #include "ui/base/models/menu_model.h" | 48 #include "ui/base/models/menu_model.h" |
49 #include "ui/gfx/display.h" | 49 #include "ui/gfx/display.h" |
50 #include "ui/gfx/screen.h" | 50 #include "ui/gfx/screen.h" |
| 51 #include "ui/keyboard/keyboard_controller.h" |
51 #include "ui/views/controls/menu/menu_model_adapter.h" | 52 #include "ui/views/controls/menu/menu_model_adapter.h" |
52 #include "ui/views/controls/menu/menu_runner.h" | 53 #include "ui/views/controls/menu/menu_runner.h" |
53 #include "ui/views/corewm/visibility_controller.h" | 54 #include "ui/views/corewm/visibility_controller.h" |
54 #include "ui/views/view_model.h" | 55 #include "ui/views/view_model.h" |
55 #include "ui/views/view_model_utils.h" | 56 #include "ui/views/view_model_utils.h" |
56 | 57 |
57 namespace ash { | 58 namespace ash { |
58 namespace { | 59 namespace { |
59 | 60 |
60 // Duration for the animation that hides the boot splash screen, in | 61 // Duration for the animation that hides the boot splash screen, in |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 GetContainer(kShellWindowId_DefaultContainer); | 256 GetContainer(kShellWindowId_DefaultContainer); |
256 // Workspace manager has its own layout managers. | 257 // Workspace manager has its own layout managers. |
257 workspace_controller_.reset( | 258 workspace_controller_.reset( |
258 new WorkspaceController(default_container)); | 259 new WorkspaceController(default_container)); |
259 | 260 |
260 aura::Window* always_on_top_container = | 261 aura::Window* always_on_top_container = |
261 GetContainer(kShellWindowId_AlwaysOnTopContainer); | 262 GetContainer(kShellWindowId_AlwaysOnTopContainer); |
262 always_on_top_container->SetLayoutManager( | 263 always_on_top_container->SetLayoutManager( |
263 new BaseLayoutManager( | 264 new BaseLayoutManager( |
264 always_on_top_container->GetRootWindow())); | 265 always_on_top_container->GetRootWindow())); |
| 266 |
| 267 // TODO(bryeung): Move this to CreateContainersInRootWindow when the |
| 268 // keyboard controller will take care of deferring creation of the keyboard. |
| 269 InitKeyboard(root_window()); |
265 } | 270 } |
266 | 271 |
267 void RootWindowController::InitForPrimaryDisplay() { | 272 void RootWindowController::InitForPrimaryDisplay() { |
268 DCHECK(!shelf_.get()); | 273 DCHECK(!shelf_.get()); |
269 aura::Window* shelf_container = | 274 aura::Window* shelf_container = |
270 GetContainer(ash::internal::kShellWindowId_ShelfContainer); | 275 GetContainer(ash::internal::kShellWindowId_ShelfContainer); |
271 // TODO(harrym): Remove when status area is view. | 276 // TODO(harrym): Remove when status area is view. |
272 aura::Window* status_container = | 277 aura::Window* status_container = |
273 GetContainer(ash::internal::kShellWindowId_StatusContainer); | 278 GetContainer(ash::internal::kShellWindowId_StatusContainer); |
274 shelf_.reset(new ash::ShelfWidget( | 279 shelf_.reset(new ash::ShelfWidget( |
(...skipping 11 matching lines...) Expand all Loading... |
286 panel_container->SetLayoutManager(panel_layout_manager_); | 291 panel_container->SetLayoutManager(panel_layout_manager_); |
287 } | 292 } |
288 if (Shell::GetInstance()->delegate()->IsUserLoggedIn()) | 293 if (Shell::GetInstance()->delegate()->IsUserLoggedIn()) |
289 shelf_->CreateLauncher(); | 294 shelf_->CreateLauncher(); |
290 } | 295 } |
291 | 296 |
292 void RootWindowController::CreateContainers() { | 297 void RootWindowController::CreateContainers() { |
293 CreateContainersInRootWindow(root_window_.get()); | 298 CreateContainersInRootWindow(root_window_.get()); |
294 } | 299 } |
295 | 300 |
| 301 void RootWindowController::InitKeyboard(aura::Window* parent) { |
| 302 keyboard::KeyboardControllerProxy* proxy = |
| 303 Shell::GetInstance()->delegate()->CreateKeyboardControllerProxy(); |
| 304 keyboard_controller_.reset( |
| 305 new keyboard::KeyboardController(proxy)); |
| 306 aura::Window* keyboard_container = |
| 307 keyboard_controller_->GetContainerWindow(); |
| 308 parent->AddChild(keyboard_container); |
| 309 // TODO(bryeung): move this to the controller on visibility changed |
| 310 parent->StackChildAtTop(keyboard_container); |
| 311 } |
| 312 |
296 void RootWindowController::CreateSystemBackground( | 313 void RootWindowController::CreateSystemBackground( |
297 bool is_first_run_after_boot) { | 314 bool is_first_run_after_boot) { |
298 SkColor color = SK_ColorBLACK; | 315 SkColor color = SK_ColorBLACK; |
299 #if defined(OS_CHROMEOS) | 316 #if defined(OS_CHROMEOS) |
300 if (is_first_run_after_boot) | 317 if (is_first_run_after_boot) |
301 color = kChromeOsBootColor; | 318 color = kChromeOsBootColor; |
302 #endif | 319 #endif |
303 system_background_.reset( | 320 system_background_.reset( |
304 new SystemBackgroundController(root_window_.get(), color)); | 321 new SystemBackgroundController(root_window_.get(), color)); |
305 | 322 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 "OverlayContainer", | 642 "OverlayContainer", |
626 lock_screen_related_containers); | 643 lock_screen_related_containers); |
627 SetUsesScreenCoordinates(overlay_container); | 644 SetUsesScreenCoordinates(overlay_container); |
628 | 645 |
629 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, | 646 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, |
630 "PowerButtonAnimationContainer", root_window) ; | 647 "PowerButtonAnimationContainer", root_window) ; |
631 } | 648 } |
632 | 649 |
633 } // namespace internal | 650 } // namespace internal |
634 } // namespace ash | 651 } // namespace ash |
OLD | NEW |