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 <queue> | 7 #include <queue> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 void RootWindowController::ShowShelf() { | 396 void RootWindowController::ShowShelf() { |
397 if (!shelf_widget_->shelf()) | 397 if (!shelf_widget_->shelf()) |
398 return; | 398 return; |
399 shelf_widget_->shelf()->SetVisible(true); | 399 shelf_widget_->shelf()->SetVisible(true); |
400 shelf_widget_->status_area_widget()->Show(); | 400 shelf_widget_->status_area_widget()->Show(); |
401 } | 401 } |
402 | 402 |
403 void RootWindowController::CreateShelf() { | 403 void RootWindowController::CreateShelf() { |
404 if (shelf_widget_->shelf()) | 404 if (shelf_widget_->shelf()) |
405 return; | 405 return; |
406 shelf_widget_->CreateShelf(); | 406 shelf_widget_->CreateShelf(wm_shelf_aura_.get()); |
407 | 407 |
408 if (panel_layout_manager_) | 408 if (panel_layout_manager_) |
409 panel_layout_manager_->SetShelf(shelf_widget_->shelf()->wm_shelf()); | 409 panel_layout_manager_->SetShelf(wm_shelf_aura_.get()); |
410 if (docked_layout_manager_) { | 410 if (docked_layout_manager_) { |
411 docked_layout_manager_->SetShelf(shelf_widget_->shelf()->wm_shelf()); | 411 docked_layout_manager_->SetShelf(wm_shelf_aura_.get()); |
412 if (shelf_widget_->shelf_layout_manager()) | 412 if (shelf_widget_->shelf_layout_manager()) |
413 docked_layout_manager_->AddObserver( | 413 docked_layout_manager_->AddObserver( |
414 shelf_widget_->shelf_layout_manager()); | 414 shelf_widget_->shelf_layout_manager()); |
415 } | 415 } |
416 | 416 |
417 // Notify shell observers that the shelf has been created. | 417 // Notify shell observers that the shelf has been created. |
418 Shell::GetInstance()->OnShelfCreatedForRootWindow(GetRootWindow()); | 418 Shell::GetInstance()->OnShelfCreatedForRootWindow(GetRootWindow()); |
419 | 419 |
420 shelf_widget_->PostCreateShelf(); | 420 shelf_widget_->PostCreateShelf(); |
421 } | 421 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 if (docked_layout_manager_) { | 493 if (docked_layout_manager_) { |
494 docked_layout_manager_->Shutdown(); | 494 docked_layout_manager_->Shutdown(); |
495 docked_layout_manager_ = NULL; | 495 docked_layout_manager_ = NULL; |
496 } | 496 } |
497 aura::Window* root_window = GetRootWindow(); | 497 aura::Window* root_window = GetRootWindow(); |
498 aura::client::SetDragDropClient(root_window, NULL); | 498 aura::client::SetDragDropClient(root_window, NULL); |
499 | 499 |
500 if (shelf_widget_) | 500 if (shelf_widget_) |
501 shelf_widget_->Shutdown(); | 501 shelf_widget_->Shutdown(); |
502 | 502 |
| 503 wm_shelf_aura_->Shutdown(); |
| 504 |
503 // Close background widget first as it depends on tooltip. | 505 // Close background widget first as it depends on tooltip. |
504 wallpaper_controller_.reset(); | 506 wallpaper_controller_.reset(); |
505 animating_wallpaper_controller_.reset(); | 507 animating_wallpaper_controller_.reset(); |
506 | 508 |
507 workspace_controller_.reset(); | 509 workspace_controller_.reset(); |
508 aura::client::SetTooltipClient(root_window, NULL); | 510 aura::client::SetTooltipClient(root_window, NULL); |
509 | 511 |
510 // Explicitly destroy top level windows. We do this as during part of | 512 // Explicitly destroy top level windows. We do this as during part of |
511 // destruction such windows may query the RootWindow for state. | 513 // destruction such windows may query the RootWindow for state. |
512 aura::WindowTracker non_toplevel_windows; | 514 aura::WindowTracker non_toplevel_windows; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 if (touch_exploration_manager_) | 658 if (touch_exploration_manager_) |
657 touch_exploration_manager_->SetTouchAccessibilityAnchorPoint(anchor_point); | 659 touch_exploration_manager_->SetTouchAccessibilityAnchorPoint(anchor_point); |
658 #endif // defined(OS_CHROMEOS) | 660 #endif // defined(OS_CHROMEOS) |
659 } | 661 } |
660 | 662 |
661 //////////////////////////////////////////////////////////////////////////////// | 663 //////////////////////////////////////////////////////////////////////////////// |
662 // RootWindowController, private: | 664 // RootWindowController, private: |
663 | 665 |
664 RootWindowController::RootWindowController(AshWindowTreeHost* ash_host) | 666 RootWindowController::RootWindowController(AshWindowTreeHost* ash_host) |
665 : ash_host_(ash_host), | 667 : ash_host_(ash_host), |
| 668 wm_shelf_aura_(new WmShelfAura), |
666 docked_layout_manager_(NULL), | 669 docked_layout_manager_(NULL), |
667 panel_layout_manager_(NULL), | 670 panel_layout_manager_(NULL), |
668 touch_hud_debug_(NULL), | 671 touch_hud_debug_(NULL), |
669 touch_hud_projection_(NULL) { | 672 touch_hud_projection_(NULL) { |
670 aura::Window* root_window = GetRootWindow(); | 673 aura::Window* root_window = GetRootWindow(); |
671 root_window_controller_common_.reset( | 674 root_window_controller_common_.reset( |
672 new RootWindowControllerCommon(WmWindowAura::Get(root_window))); | 675 new RootWindowControllerCommon(WmWindowAura::Get(root_window))); |
673 GetRootWindowSettings(root_window)->controller = this; | 676 GetRootWindowSettings(root_window)->controller = this; |
674 | 677 |
675 stacking_controller_.reset(new StackingController); | 678 stacking_controller_.reset(new StackingController); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 always_on_top_controller_.reset( | 758 always_on_top_controller_.reset( |
756 new AlwaysOnTopController(always_on_top_container)); | 759 new AlwaysOnTopController(always_on_top_container)); |
757 | 760 |
758 DCHECK(!shelf_widget_.get()); | 761 DCHECK(!shelf_widget_.get()); |
759 WmWindow* shelf_container = | 762 WmWindow* shelf_container = |
760 WmWindowAura::Get(GetContainer(kShellWindowId_ShelfContainer)); | 763 WmWindowAura::Get(GetContainer(kShellWindowId_ShelfContainer)); |
761 WmWindow* status_container = | 764 WmWindow* status_container = |
762 WmWindowAura::Get(GetContainer(kShellWindowId_StatusContainer)); | 765 WmWindowAura::Get(GetContainer(kShellWindowId_StatusContainer)); |
763 shelf_widget_.reset(new ShelfWidget(shelf_container, status_container, | 766 shelf_widget_.reset(new ShelfWidget(shelf_container, status_container, |
764 workspace_controller())); | 767 workspace_controller())); |
| 768 wm_shelf_aura_->SetShelfLayoutManager(shelf_widget_->shelf_layout_manager()); |
765 workspace_layout_manager_delegate->set_shelf( | 769 workspace_layout_manager_delegate->set_shelf( |
766 shelf_widget_->shelf_layout_manager()); | 770 shelf_widget_->shelf_layout_manager()); |
767 | 771 |
768 if (!Shell::GetInstance()->session_state_delegate()-> | 772 if (!Shell::GetInstance()->session_state_delegate()-> |
769 IsActiveUserSessionStarted()) { | 773 IsActiveUserSessionStarted()) { |
770 // This window exists only to be a event target on login screen. | 774 // This window exists only to be a event target on login screen. |
771 // It does not have to handle events, nor be visible. | 775 // It does not have to handle events, nor be visible. |
772 mouse_event_target_.reset(new aura::Window(new EmptyWindowDelegate)); | 776 mouse_event_target_.reset(new aura::Window(new EmptyWindowDelegate)); |
773 mouse_event_target_->Init(ui::LAYER_NOT_DRAWN); | 777 mouse_event_target_->Init(ui::LAYER_NOT_DRAWN); |
774 | 778 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 aura::Window* primary_root_window = Shell::GetInstance() | 887 aura::Window* primary_root_window = Shell::GetInstance() |
884 ->window_tree_host_manager() | 888 ->window_tree_host_manager() |
885 ->GetPrimaryRootWindow(); | 889 ->GetPrimaryRootWindow(); |
886 return GetRootWindowSettings(primary_root_window)->controller; | 890 return GetRootWindowSettings(primary_root_window)->controller; |
887 } | 891 } |
888 | 892 |
889 return GetRootWindowSettings(root_window)->controller; | 893 return GetRootWindowSettings(root_window)->controller; |
890 } | 894 } |
891 | 895 |
892 } // namespace ash | 896 } // namespace ash |
OLD | NEW |