| 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/shell.h" | 5 #include "ash/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/app_list/app_list.h" | 9 #include "ash/app_list/app_list.h" |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 // TooltipController is deleted with the Shell so removing its references. | 559 // TooltipController is deleted with the Shell so removing its references. |
| 560 RemoveRootWindowEventFilter(tooltip_controller_.get()); | 560 RemoveRootWindowEventFilter(tooltip_controller_.get()); |
| 561 aura::client::SetTooltipClient(GetRootWindow(), NULL); | 561 aura::client::SetTooltipClient(GetRootWindow(), NULL); |
| 562 | 562 |
| 563 // Make sure we delete WorkspaceController before launcher is | 563 // Make sure we delete WorkspaceController before launcher is |
| 564 // deleted as it has a reference to launcher model. | 564 // deleted as it has a reference to launcher model. |
| 565 workspace_controller_.reset(); | 565 workspace_controller_.reset(); |
| 566 | 566 |
| 567 // The system tray needs to be reset before all the windows are destroyed. | 567 // The system tray needs to be reset before all the windows are destroyed. |
| 568 tray_.reset(); | 568 tray_.reset(); |
| 569 tray_delegate_.reset(); |
| 569 | 570 |
| 570 // Desroy secondary monitor's widgets before all the windows are destroyed. | 571 // Desroy secondary monitor's widgets before all the windows are destroyed. |
| 571 monitor_controller_.reset(); | 572 monitor_controller_.reset(); |
| 572 | 573 |
| 573 // Delete containers now so that child windows does not access | 574 // Delete containers now so that child windows does not access |
| 574 // observers when they are destructed. | 575 // observers when they are destructed. |
| 575 aura::RootWindow* root_window = GetRootWindow(); | 576 aura::RootWindow* root_window = GetRootWindow(); |
| 576 while (!root_window->children().empty()) { | 577 while (!root_window->children().empty()) { |
| 577 aura::Window* child = root_window->children()[0]; | 578 aura::Window* child = root_window->children()[0]; |
| 578 delete child; | 579 delete child; |
| 579 } | 580 } |
| 580 | 581 |
| 581 // These need a valid Shell instance to clean up properly, so explicitly | 582 // These need a valid Shell instance to clean up properly, so explicitly |
| 582 // delete them before invalidating the instance. | 583 // delete them before invalidating the instance. |
| 583 // Alphabetical. | 584 // Alphabetical. |
| 584 activation_controller_.reset(); | 585 activation_controller_.reset(); |
| 585 drag_drop_controller_.reset(); | 586 drag_drop_controller_.reset(); |
| 586 resize_shadow_controller_.reset(); | 587 resize_shadow_controller_.reset(); |
| 587 shadow_controller_.reset(); | 588 shadow_controller_.reset(); |
| 588 window_cycle_controller_.reset(); | 589 window_cycle_controller_.reset(); |
| 589 event_client_.reset(); | 590 event_client_.reset(); |
| 590 monitor_controller_.reset(); | 591 monitor_controller_.reset(); |
| 592 tooltip_controller_.reset(); |
| 591 | 593 |
| 592 // Launcher widget has a InputMethodBridge that references to | 594 // Launcher widget has a InputMethodBridge that references to |
| 593 // input_method_filter_'s input_method_. So explicitly release launcher_ | 595 // input_method_filter_'s input_method_. So explicitly release launcher_ |
| 594 // before input_method_filter_. And this needs to be after we delete all | 596 // before input_method_filter_. And this needs to be after we delete all |
| 595 // containers in case there are still live browser windows which access | 597 // containers in case there are still live browser windows which access |
| 596 // LauncherModel during close. | 598 // LauncherModel during close. |
| 597 launcher_.reset(); | 599 launcher_.reset(); |
| 598 | 600 |
| 599 DCHECK(instance_ == this); | 601 DCHECK(instance_ == this); |
| 600 instance_ = NULL; | 602 instance_ = NULL; |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 // Create desktop background widget. | 936 // Create desktop background widget. |
| 935 desktop_background_controller_->SetDesktopBackgroundImageMode(); | 937 desktop_background_controller_->SetDesktopBackgroundImageMode(); |
| 936 } | 938 } |
| 937 | 939 |
| 938 void Shell::DisableWorkspaceGridLayout() { | 940 void Shell::DisableWorkspaceGridLayout() { |
| 939 if (workspace_controller_.get()) | 941 if (workspace_controller_.get()) |
| 940 workspace_controller_->workspace_manager()->set_grid_size(0); | 942 workspace_controller_->workspace_manager()->set_grid_size(0); |
| 941 } | 943 } |
| 942 | 944 |
| 943 } // namespace ash | 945 } // namespace ash |
| OLD | NEW |