| 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_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/desktop_background/desktop_background_widget_controller.h" | 10 #include "ash/desktop_background/desktop_background_widget_controller.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "ash/wm/panel_window_event_filter.h" | 23 #include "ash/wm/panel_window_event_filter.h" |
| 24 #include "ash/wm/property_util.h" | 24 #include "ash/wm/property_util.h" |
| 25 #include "ash/wm/root_window_layout_manager.h" | 25 #include "ash/wm/root_window_layout_manager.h" |
| 26 #include "ash/wm/screen_dimmer.h" | 26 #include "ash/wm/screen_dimmer.h" |
| 27 #include "ash/wm/shelf_layout_manager.h" | 27 #include "ash/wm/shelf_layout_manager.h" |
| 28 #include "ash/wm/shelf_types.h" | 28 #include "ash/wm/shelf_types.h" |
| 29 #include "ash/wm/status_area_layout_manager.h" | 29 #include "ash/wm/status_area_layout_manager.h" |
| 30 #include "ash/wm/system_background_controller.h" | 30 #include "ash/wm/system_background_controller.h" |
| 31 #include "ash/wm/system_modal_container_layout_manager.h" | 31 #include "ash/wm/system_modal_container_layout_manager.h" |
| 32 #include "ash/wm/toplevel_window_event_handler.h" | 32 #include "ash/wm/toplevel_window_event_handler.h" |
| 33 #include "ash/wm/visibility_controller.h" | |
| 34 #include "ash/wm/window_properties.h" | 33 #include "ash/wm/window_properties.h" |
| 35 #include "ash/wm/workspace_controller.h" | 34 #include "ash/wm/workspace_controller.h" |
| 36 #include "base/command_line.h" | 35 #include "base/command_line.h" |
| 37 #include "base/time.h" | 36 #include "base/time.h" |
| 38 #include "ui/aura/client/activation_client.h" | 37 #include "ui/aura/client/activation_client.h" |
| 39 #include "ui/aura/client/aura_constants.h" | 38 #include "ui/aura/client/aura_constants.h" |
| 40 #include "ui/aura/client/capture_client.h" | 39 #include "ui/aura/client/capture_client.h" |
| 41 #include "ui/aura/client/focus_client.h" | 40 #include "ui/aura/client/focus_client.h" |
| 42 #include "ui/aura/client/tooltip_client.h" | 41 #include "ui/aura/client/tooltip_client.h" |
| 43 #include "ui/aura/root_window.h" | 42 #include "ui/aura/root_window.h" |
| 44 #include "ui/aura/window.h" | 43 #include "ui/aura/window.h" |
| 45 #include "ui/aura/window_observer.h" | 44 #include "ui/aura/window_observer.h" |
| 46 #include "ui/aura/window_tracker.h" | 45 #include "ui/aura/window_tracker.h" |
| 47 #include "ui/base/models/menu_model.h" | 46 #include "ui/base/models/menu_model.h" |
| 48 #include "ui/gfx/display.h" | 47 #include "ui/gfx/display.h" |
| 49 #include "ui/gfx/screen.h" | 48 #include "ui/gfx/screen.h" |
| 50 #include "ui/views/controls/menu/menu_model_adapter.h" | 49 #include "ui/views/controls/menu/menu_model_adapter.h" |
| 51 #include "ui/views/controls/menu/menu_runner.h" | 50 #include "ui/views/controls/menu/menu_runner.h" |
| 51 #include "ui/views/corewm/visibility_controller.h" |
| 52 #include "ui/views/view_model.h" | 52 #include "ui/views/view_model.h" |
| 53 #include "ui/views/view_model_utils.h" | 53 #include "ui/views/view_model_utils.h" |
| 54 | 54 |
| 55 namespace ash { | 55 namespace ash { |
| 56 namespace { | 56 namespace { |
| 57 | 57 |
| 58 #if defined(OS_CHROMEOS) | 58 #if defined(OS_CHROMEOS) |
| 59 // Background color used for the Chrome OS boot splash screen. | 59 // Background color used for the Chrome OS boot splash screen. |
| 60 const SkColor kChromeOsBootColor = SkColorSetARGB(0xff, 0xfe, 0xfe, 0xfe); | 60 const SkColor kChromeOsBootColor = SkColorSetARGB(0xff, 0xfe, 0xfe, 0xfe); |
| 61 #endif | 61 #endif |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 | 509 |
| 510 // The desktop background container is not part of the lock animation, so it | 510 // The desktop background container is not part of the lock animation, so it |
| 511 // is not included in those animate groups. | 511 // is not included in those animate groups. |
| 512 // When screen is locked desktop background is moved to lock screen background | 512 // When screen is locked desktop background is moved to lock screen background |
| 513 // container (moved back on unlock). We want to make sure that there's an | 513 // container (moved back on unlock). We want to make sure that there's an |
| 514 // opaque layer occluding the non-lock-screen layers. | 514 // opaque layer occluding the non-lock-screen layers. |
| 515 aura::Window* desktop_background_container = CreateContainer( | 515 aura::Window* desktop_background_container = CreateContainer( |
| 516 kShellWindowId_DesktopBackgroundContainer, | 516 kShellWindowId_DesktopBackgroundContainer, |
| 517 "DesktopBackgroundContainer", | 517 "DesktopBackgroundContainer", |
| 518 root_window); | 518 root_window); |
| 519 SetChildWindowVisibilityChangesAnimated(desktop_background_container); | 519 views::corewm::SetChildWindowVisibilityChangesAnimated( |
| 520 desktop_background_container); |
| 520 | 521 |
| 521 aura::Window* non_lock_screen_containers = CreateContainer( | 522 aura::Window* non_lock_screen_containers = CreateContainer( |
| 522 kShellWindowId_NonLockScreenContainersContainer, | 523 kShellWindowId_NonLockScreenContainersContainer, |
| 523 "NonLockScreenContainersContainer", | 524 "NonLockScreenContainersContainer", |
| 524 root_window); | 525 root_window); |
| 525 | 526 |
| 526 aura::Window* lock_background_containers = CreateContainer( | 527 aura::Window* lock_background_containers = CreateContainer( |
| 527 kShellWindowId_LockScreenBackgroundContainer, | 528 kShellWindowId_LockScreenBackgroundContainer, |
| 528 "LockScreenBackgroundContainer", | 529 "LockScreenBackgroundContainer", |
| 529 root_window); | 530 root_window); |
| 530 SetChildWindowVisibilityChangesAnimated(lock_background_containers); | 531 views::corewm::SetChildWindowVisibilityChangesAnimated( |
| 532 lock_background_containers); |
| 531 | 533 |
| 532 aura::Window* lock_screen_containers = CreateContainer( | 534 aura::Window* lock_screen_containers = CreateContainer( |
| 533 kShellWindowId_LockScreenContainersContainer, | 535 kShellWindowId_LockScreenContainersContainer, |
| 534 "LockScreenContainersContainer", | 536 "LockScreenContainersContainer", |
| 535 root_window); | 537 root_window); |
| 536 aura::Window* lock_screen_related_containers = CreateContainer( | 538 aura::Window* lock_screen_related_containers = CreateContainer( |
| 537 kShellWindowId_LockScreenRelatedContainersContainer, | 539 kShellWindowId_LockScreenRelatedContainersContainer, |
| 538 "LockScreenRelatedContainersContainer", | 540 "LockScreenRelatedContainersContainer", |
| 539 root_window); | 541 root_window); |
| 540 | 542 |
| 541 CreateContainer(kShellWindowId_UnparentedControlContainer, | 543 CreateContainer(kShellWindowId_UnparentedControlContainer, |
| 542 "UnparentedControlContainer", | 544 "UnparentedControlContainer", |
| 543 non_lock_screen_containers); | 545 non_lock_screen_containers); |
| 544 | 546 |
| 545 aura::Window* default_container = CreateContainer( | 547 aura::Window* default_container = CreateContainer( |
| 546 kShellWindowId_DefaultContainer, | 548 kShellWindowId_DefaultContainer, |
| 547 "DefaultContainer", | 549 "DefaultContainer", |
| 548 non_lock_screen_containers); | 550 non_lock_screen_containers); |
| 549 SetChildWindowVisibilityChangesAnimated(default_container); | 551 views::corewm::SetChildWindowVisibilityChangesAnimated(default_container); |
| 550 SetUsesScreenCoordinates(default_container); | 552 SetUsesScreenCoordinates(default_container); |
| 551 | 553 |
| 552 aura::Window* always_on_top_container = CreateContainer( | 554 aura::Window* always_on_top_container = CreateContainer( |
| 553 kShellWindowId_AlwaysOnTopContainer, | 555 kShellWindowId_AlwaysOnTopContainer, |
| 554 "AlwaysOnTopContainer", | 556 "AlwaysOnTopContainer", |
| 555 non_lock_screen_containers); | 557 non_lock_screen_containers); |
| 556 always_on_top_container_handler_.reset( | 558 always_on_top_container_handler_.reset( |
| 557 new ToplevelWindowEventHandler(always_on_top_container)); | 559 new ToplevelWindowEventHandler(always_on_top_container)); |
| 558 SetChildWindowVisibilityChangesAnimated(always_on_top_container); | 560 views::corewm::SetChildWindowVisibilityChangesAnimated( |
| 561 always_on_top_container); |
| 559 SetUsesScreenCoordinates(always_on_top_container); | 562 SetUsesScreenCoordinates(always_on_top_container); |
| 560 | 563 |
| 561 aura::Window* panel_container = CreateContainer( | 564 aura::Window* panel_container = CreateContainer( |
| 562 kShellWindowId_PanelContainer, | 565 kShellWindowId_PanelContainer, |
| 563 "PanelContainer", | 566 "PanelContainer", |
| 564 non_lock_screen_containers); | 567 non_lock_screen_containers); |
| 565 SetUsesScreenCoordinates(panel_container); | 568 SetUsesScreenCoordinates(panel_container); |
| 566 | 569 |
| 567 aura::Window* launcher_container = | 570 aura::Window* launcher_container = |
| 568 CreateContainer(kShellWindowId_LauncherContainer, | 571 CreateContainer(kShellWindowId_LauncherContainer, |
| 569 "LauncherContainer", | 572 "LauncherContainer", |
| 570 non_lock_screen_containers); | 573 non_lock_screen_containers); |
| 571 SetUsesScreenCoordinates(launcher_container); | 574 SetUsesScreenCoordinates(launcher_container); |
| 572 | 575 |
| 573 aura::Window* app_list_container = | 576 aura::Window* app_list_container = |
| 574 CreateContainer(kShellWindowId_AppListContainer, | 577 CreateContainer(kShellWindowId_AppListContainer, |
| 575 "AppListContainer", | 578 "AppListContainer", |
| 576 non_lock_screen_containers); | 579 non_lock_screen_containers); |
| 577 SetUsesScreenCoordinates(app_list_container); | 580 SetUsesScreenCoordinates(app_list_container); |
| 578 | 581 |
| 579 aura::Window* modal_container = CreateContainer( | 582 aura::Window* modal_container = CreateContainer( |
| 580 kShellWindowId_SystemModalContainer, | 583 kShellWindowId_SystemModalContainer, |
| 581 "SystemModalContainer", | 584 "SystemModalContainer", |
| 582 non_lock_screen_containers); | 585 non_lock_screen_containers); |
| 583 modal_container_handler_.reset( | 586 modal_container_handler_.reset( |
| 584 new ToplevelWindowEventHandler(modal_container)); | 587 new ToplevelWindowEventHandler(modal_container)); |
| 585 modal_container->SetLayoutManager( | 588 modal_container->SetLayoutManager( |
| 586 new SystemModalContainerLayoutManager(modal_container)); | 589 new SystemModalContainerLayoutManager(modal_container)); |
| 587 SetChildWindowVisibilityChangesAnimated(modal_container); | 590 views::corewm::SetChildWindowVisibilityChangesAnimated(modal_container); |
| 588 SetUsesScreenCoordinates(modal_container); | 591 SetUsesScreenCoordinates(modal_container); |
| 589 | 592 |
| 590 aura::Window* input_method_container = CreateContainer( | 593 aura::Window* input_method_container = CreateContainer( |
| 591 kShellWindowId_InputMethodContainer, | 594 kShellWindowId_InputMethodContainer, |
| 592 "InputMethodContainer", | 595 "InputMethodContainer", |
| 593 non_lock_screen_containers); | 596 non_lock_screen_containers); |
| 594 SetUsesScreenCoordinates(input_method_container); | 597 SetUsesScreenCoordinates(input_method_container); |
| 595 | 598 |
| 596 // TODO(beng): Figure out if we can make this use | 599 // TODO(beng): Figure out if we can make this use |
| 597 // SystemModalContainerEventFilter instead of stops_event_propagation. | 600 // SystemModalContainerEventFilter instead of stops_event_propagation. |
| 598 aura::Window* lock_container = CreateContainer( | 601 aura::Window* lock_container = CreateContainer( |
| 599 kShellWindowId_LockScreenContainer, | 602 kShellWindowId_LockScreenContainer, |
| 600 "LockScreenContainer", | 603 "LockScreenContainer", |
| 601 lock_screen_containers); | 604 lock_screen_containers); |
| 602 lock_container->SetLayoutManager( | 605 lock_container->SetLayoutManager( |
| 603 new BaseLayoutManager(root_window)); | 606 new BaseLayoutManager(root_window)); |
| 604 SetUsesScreenCoordinates(lock_container); | 607 SetUsesScreenCoordinates(lock_container); |
| 605 // TODO(beng): stopsevents | 608 // TODO(beng): stopsevents |
| 606 | 609 |
| 607 aura::Window* lock_modal_container = CreateContainer( | 610 aura::Window* lock_modal_container = CreateContainer( |
| 608 kShellWindowId_LockSystemModalContainer, | 611 kShellWindowId_LockSystemModalContainer, |
| 609 "LockSystemModalContainer", | 612 "LockSystemModalContainer", |
| 610 lock_screen_containers); | 613 lock_screen_containers); |
| 611 lock_modal_container_handler_.reset( | 614 lock_modal_container_handler_.reset( |
| 612 new ToplevelWindowEventHandler(lock_modal_container)); | 615 new ToplevelWindowEventHandler(lock_modal_container)); |
| 613 lock_modal_container->SetLayoutManager( | 616 lock_modal_container->SetLayoutManager( |
| 614 new SystemModalContainerLayoutManager(lock_modal_container)); | 617 new SystemModalContainerLayoutManager(lock_modal_container)); |
| 615 SetChildWindowVisibilityChangesAnimated(lock_modal_container); | 618 views::corewm::SetChildWindowVisibilityChangesAnimated(lock_modal_container); |
| 616 SetUsesScreenCoordinates(lock_modal_container); | 619 SetUsesScreenCoordinates(lock_modal_container); |
| 617 | 620 |
| 618 aura::Window* status_container = | 621 aura::Window* status_container = |
| 619 CreateContainer(kShellWindowId_StatusContainer, | 622 CreateContainer(kShellWindowId_StatusContainer, |
| 620 "StatusContainer", | 623 "StatusContainer", |
| 621 lock_screen_related_containers); | 624 lock_screen_related_containers); |
| 622 SetUsesScreenCoordinates(status_container); | 625 SetUsesScreenCoordinates(status_container); |
| 623 | 626 |
| 624 aura::Window* settings_bubble_container = CreateContainer( | 627 aura::Window* settings_bubble_container = CreateContainer( |
| 625 kShellWindowId_SettingBubbleContainer, | 628 kShellWindowId_SettingBubbleContainer, |
| 626 "SettingBubbleContainer", | 629 "SettingBubbleContainer", |
| 627 lock_screen_related_containers); | 630 lock_screen_related_containers); |
| 628 SetChildWindowVisibilityChangesAnimated(settings_bubble_container); | 631 views::corewm::SetChildWindowVisibilityChangesAnimated( |
| 632 settings_bubble_container); |
| 629 SetUsesScreenCoordinates(settings_bubble_container); | 633 SetUsesScreenCoordinates(settings_bubble_container); |
| 630 | 634 |
| 631 aura::Window* menu_container = CreateContainer( | 635 aura::Window* menu_container = CreateContainer( |
| 632 kShellWindowId_MenuContainer, | 636 kShellWindowId_MenuContainer, |
| 633 "MenuContainer", | 637 "MenuContainer", |
| 634 lock_screen_related_containers); | 638 lock_screen_related_containers); |
| 635 SetChildWindowVisibilityChangesAnimated(menu_container); | 639 views::corewm::SetChildWindowVisibilityChangesAnimated(menu_container); |
| 636 SetUsesScreenCoordinates(menu_container); | 640 SetUsesScreenCoordinates(menu_container); |
| 637 | 641 |
| 638 aura::Window* drag_drop_container = CreateContainer( | 642 aura::Window* drag_drop_container = CreateContainer( |
| 639 kShellWindowId_DragImageAndTooltipContainer, | 643 kShellWindowId_DragImageAndTooltipContainer, |
| 640 "DragImageAndTooltipContainer", | 644 "DragImageAndTooltipContainer", |
| 641 lock_screen_related_containers); | 645 lock_screen_related_containers); |
| 642 SetChildWindowVisibilityChangesAnimated(drag_drop_container); | 646 views::corewm::SetChildWindowVisibilityChangesAnimated(drag_drop_container); |
| 643 SetUsesScreenCoordinates(drag_drop_container); | 647 SetUsesScreenCoordinates(drag_drop_container); |
| 644 | 648 |
| 645 aura::Window* overlay_container = CreateContainer( | 649 aura::Window* overlay_container = CreateContainer( |
| 646 kShellWindowId_OverlayContainer, | 650 kShellWindowId_OverlayContainer, |
| 647 "OverlayContainer", | 651 "OverlayContainer", |
| 648 lock_screen_related_containers); | 652 lock_screen_related_containers); |
| 649 SetUsesScreenCoordinates(overlay_container); | 653 SetUsesScreenCoordinates(overlay_container); |
| 650 | 654 |
| 651 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, | 655 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, |
| 652 "PowerButtonAnimationContainer", root_window) ; | 656 "PowerButtonAnimationContainer", root_window) ; |
| 653 } | 657 } |
| 654 | 658 |
| 655 } // namespace internal | 659 } // namespace internal |
| 656 } // namespace ash | 660 } // namespace ash |
| OLD | NEW |