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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 #include "ui/aura/client/capture_client.h" | 42 #include "ui/aura/client/capture_client.h" |
43 #include "ui/aura/client/focus_client.h" | 43 #include "ui/aura/client/focus_client.h" |
44 #include "ui/aura/client/tooltip_client.h" | 44 #include "ui/aura/client/tooltip_client.h" |
45 #include "ui/aura/root_window.h" | 45 #include "ui/aura/root_window.h" |
46 #include "ui/aura/window.h" | 46 #include "ui/aura/window.h" |
47 #include "ui/aura/window_observer.h" | 47 #include "ui/aura/window_observer.h" |
48 #include "ui/aura/window_tracker.h" | 48 #include "ui/aura/window_tracker.h" |
49 #include "ui/base/models/menu_model.h" | 49 #include "ui/base/models/menu_model.h" |
50 #include "ui/gfx/display.h" | 50 #include "ui/gfx/display.h" |
51 #include "ui/gfx/screen.h" | 51 #include "ui/gfx/screen.h" |
52 #include "ui/keyboard/keyboard_controller.h" | |
53 #include "ui/keyboard/keyboard_util.h" | |
52 #include "ui/views/controls/menu/menu_runner.h" | 54 #include "ui/views/controls/menu/menu_runner.h" |
53 #include "ui/views/corewm/visibility_controller.h" | 55 #include "ui/views/corewm/visibility_controller.h" |
54 #include "ui/views/view_model.h" | 56 #include "ui/views/view_model.h" |
55 #include "ui/views/view_model_utils.h" | 57 #include "ui/views/view_model_utils.h" |
56 | 58 |
57 namespace ash { | 59 namespace ash { |
58 namespace { | 60 namespace { |
59 | 61 |
60 // Duration for the animation that hides the boot splash screen, in | 62 // Duration for the animation that hides the boot splash screen, in |
61 // milliseconds. This should be short enough in relation to | 63 // milliseconds. This should be short enough in relation to |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
283 aura::Window* panel_container = GetContainer( | 285 aura::Window* panel_container = GetContainer( |
284 internal::kShellWindowId_PanelContainer); | 286 internal::kShellWindowId_PanelContainer); |
285 panel_layout_manager_ = | 287 panel_layout_manager_ = |
286 new internal::PanelLayoutManager(panel_container); | 288 new internal::PanelLayoutManager(panel_container); |
287 panel_container_handler_.reset( | 289 panel_container_handler_.reset( |
288 new ToplevelWindowEventHandler(panel_container)); | 290 new ToplevelWindowEventHandler(panel_container)); |
289 panel_container->SetLayoutManager(panel_layout_manager_); | 291 panel_container->SetLayoutManager(panel_layout_manager_); |
290 } | 292 } |
291 if (Shell::GetInstance()->delegate()->IsUserLoggedIn()) | 293 if (Shell::GetInstance()->delegate()->IsUserLoggedIn()) |
292 shelf_->CreateLauncher(); | 294 shelf_->CreateLauncher(); |
295 | |
296 // TODO(bryeung): Move this to CreateContainersInRootWindow when the | |
297 // keyboard controller will take care of deferring creation of the keyboard. | |
298 InitKeyboard(); | |
293 } | 299 } |
294 | 300 |
295 void RootWindowController::CreateContainers() { | 301 void RootWindowController::CreateContainers() { |
296 CreateContainersInRootWindow(root_window_.get()); | 302 CreateContainersInRootWindow(root_window_.get()); |
297 | 303 |
298 // Create touch observer HUD if needed. HUD should be created after the | 304 // Create touch observer HUD if needed. HUD should be created after the |
299 // containers have been created, so that its widget can be added to them. | 305 // containers have been created, so that its widget can be added to them. |
300 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 306 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
301 if (command_line->HasSwitch(switches::kAshTouchHud)) { | 307 if (command_line->HasSwitch(switches::kAshTouchHud)) { |
302 int64 id = root_window_->GetProperty(kDisplayIdKey); | 308 int64 id = root_window_->GetProperty(kDisplayIdKey); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
484 bool RootWindowController::IsImmersiveMode() const { | 490 bool RootWindowController::IsImmersiveMode() const { |
485 aura::Window* container = workspace_controller_->GetActiveWorkspaceWindow(); | 491 aura::Window* container = workspace_controller_->GetActiveWorkspaceWindow(); |
486 for (size_t i = 0; i < container->children().size(); ++i) { | 492 for (size_t i = 0; i < container->children().size(); ++i) { |
487 aura::Window* child = container->children()[i]; | 493 aura::Window* child = container->children()[i]; |
488 if (child->IsVisible() && child->GetProperty(kImmersiveModeKey)) | 494 if (child->IsVisible() && child->GetProperty(kImmersiveModeKey)) |
489 return true; | 495 return true; |
490 } | 496 } |
491 return false; | 497 return false; |
492 } | 498 } |
493 | 499 |
500 void RootWindowController::InitKeyboard() { | |
501 if (keyboard::IsKeyboardEnabled()) { | |
502 aura::Window* parent = root_window(); | |
503 | |
504 keyboard::KeyboardControllerProxy* proxy = | |
505 Shell::GetInstance()->delegate()->CreateKeyboardControllerProxy(); | |
sadrul
2013/04/04 22:08:25
indent 2 more spaces
bryeung
2013/04/05 12:29:38
Done.
| |
506 keyboard_controller_.reset( | |
507 new keyboard::KeyboardController(proxy)); | |
508 aura::Window* keyboard_container = | |
509 keyboard_controller_->GetContainerWindow(); | |
sadrul
2013/04/04 22:08:25
ditto
bryeung
2013/04/05 12:29:38
Done.
| |
510 parent->AddChild(keyboard_container); | |
511 // TODO(bryeung): move this to the controller on visibility changed | |
512 parent->StackChildAtTop(keyboard_container); | |
513 keyboard_container->Show(); | |
514 } | |
515 } | |
516 | |
517 | |
494 //////////////////////////////////////////////////////////////////////////////// | 518 //////////////////////////////////////////////////////////////////////////////// |
495 // RootWindowController, private: | 519 // RootWindowController, private: |
496 | 520 |
497 void RootWindowController::CreateContainersInRootWindow( | 521 void RootWindowController::CreateContainersInRootWindow( |
498 aura::RootWindow* root_window) { | 522 aura::RootWindow* root_window) { |
499 // These containers are just used by PowerButtonController to animate groups | 523 // These containers are just used by PowerButtonController to animate groups |
500 // of containers simultaneously without messing up the current transformations | 524 // of containers simultaneously without messing up the current transformations |
501 // on those containers. These are direct children of the root window; all of | 525 // on those containers. These are direct children of the root window; all of |
502 // the other containers are their children. | 526 // the other containers are their children. |
503 | 527 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
645 "OverlayContainer", | 669 "OverlayContainer", |
646 lock_screen_related_containers); | 670 lock_screen_related_containers); |
647 SetUsesScreenCoordinates(overlay_container); | 671 SetUsesScreenCoordinates(overlay_container); |
648 | 672 |
649 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, | 673 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, |
650 "PowerButtonAnimationContainer", root_window) ; | 674 "PowerButtonAnimationContainer", root_window) ; |
651 } | 675 } |
652 | 676 |
653 } // namespace internal | 677 } // namespace internal |
654 } // namespace ash | 678 } // namespace ash |
OLD | NEW |