Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: ash/shell.cc

Issue 2041423002: Moves MruWindowTracker to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_mru_window_tracker
Patch Set: merge Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/shell.h ('k') | ash/wm/overview/window_selector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
11 #include "ash/accelerators/accelerator_controller.h" 11 #include "ash/accelerators/accelerator_controller.h"
12 #include "ash/accelerators/accelerator_delegate.h" 12 #include "ash/accelerators/accelerator_delegate.h"
13 #include "ash/accelerators/focus_manager_factory.h" 13 #include "ash/accelerators/focus_manager_factory.h"
14 #include "ash/ash_switches.h" 14 #include "ash/ash_switches.h"
15 #include "ash/aura/wm_shell_aura.h"
16 #include "ash/aura/wm_window_aura.h" 15 #include "ash/aura/wm_window_aura.h"
17 #include "ash/autoclick/autoclick_controller.h" 16 #include "ash/autoclick/autoclick_controller.h"
18 #include "ash/common/session/session_state_delegate.h" 17 #include "ash/common/session/session_state_delegate.h"
19 #include "ash/common/shelf/shelf_item_delegate.h" 18 #include "ash/common/shelf/shelf_item_delegate.h"
20 #include "ash/common/shelf/shelf_item_delegate_manager.h" 19 #include "ash/common/shelf/shelf_item_delegate_manager.h"
21 #include "ash/common/shelf/shelf_model.h" 20 #include "ash/common/shelf/shelf_model.h"
22 #include "ash/common/shell_window_ids.h" 21 #include "ash/common/shell_window_ids.h"
23 #include "ash/common/wm/mru_window_tracker.h" 22 #include "ash/common/wm/mru_window_tracker.h"
24 #include "ash/common/wm/root_window_finder.h" 23 #include "ash/common/wm/root_window_finder.h"
25 #include "ash/common/wm/window_positioner.h" 24 #include "ash/common/wm/window_positioner.h"
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 764
766 // |shelf_window_watcher_| has a weak pointer to |shelf_Model_| 765 // |shelf_window_watcher_| has a weak pointer to |shelf_Model_|
767 // and has window observers. 766 // and has window observers.
768 shelf_window_watcher_.reset(); 767 shelf_window_watcher_.reset();
769 768
770 // Destroy all child windows including widgets. 769 // Destroy all child windows including widgets.
771 window_tree_host_manager_->CloseChildWindows(); 770 window_tree_host_manager_->CloseChildWindows();
772 // MruWindowTracker must be destroyed after all windows have been deleted to 771 // MruWindowTracker must be destroyed after all windows have been deleted to
773 // avoid a possible crash when Shell is destroyed from a non-normal shutdown 772 // avoid a possible crash when Shell is destroyed from a non-normal shutdown
774 // path. (crbug.com/485438). 773 // path. (crbug.com/485438).
775 mru_window_tracker_.reset(); 774 wm_shell_->DeleteMruWindowTracker();
776 775
777 // Chrome implementation of shelf delegate depends on FocusClient, 776 // Chrome implementation of shelf delegate depends on FocusClient,
778 // so must be deleted before |focus_client_| (below). 777 // so must be deleted before |focus_client_| (below).
779 shelf_delegate_.reset(); 778 shelf_delegate_.reset();
780 779
781 // Destroy SystemTrayNotifier after destroying SystemTray as TrayItems 780 // Destroy SystemTrayNotifier after destroying SystemTray as TrayItems
782 // needs to remove observers from it. 781 // needs to remove observers from it.
783 system_tray_notifier_.reset(); 782 system_tray_notifier_.reset();
784 783
785 // These need a valid Shell instance to clean up properly, so explicitly 784 // These need a valid Shell instance to clean up properly, so explicitly
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 mouse_cursor_filter_.reset(new MouseCursorEventFilter()); 1040 mouse_cursor_filter_.reset(new MouseCursorEventFilter());
1042 PrependPreTargetHandler(mouse_cursor_filter_.get()); 1041 PrependPreTargetHandler(mouse_cursor_filter_.get());
1043 1042
1044 // Create Controllers that may need root window. 1043 // Create Controllers that may need root window.
1045 // TODO(oshima): Move as many controllers before creating 1044 // TODO(oshima): Move as many controllers before creating
1046 // RootWindowController as possible. 1045 // RootWindowController as possible.
1047 visibility_controller_.reset(new AshVisibilityController); 1046 visibility_controller_.reset(new AshVisibilityController);
1048 1047
1049 magnification_controller_.reset( 1048 magnification_controller_.reset(
1050 MagnificationController::CreateInstance()); 1049 MagnificationController::CreateInstance());
1051 mru_window_tracker_.reset(new MruWindowTracker); 1050 wm_shell_->CreateMruWindowTracker();
1052 1051
1053 partial_magnification_controller_.reset( 1052 partial_magnification_controller_.reset(
1054 new PartialMagnificationController()); 1053 new PartialMagnificationController());
1055 1054
1056 autoclick_controller_.reset(AutoclickController::CreateInstance()); 1055 autoclick_controller_.reset(AutoclickController::CreateInstance());
1057 1056
1058 high_contrast_controller_.reset(new HighContrastController); 1057 high_contrast_controller_.reset(new HighContrastController);
1059 video_detector_.reset(new VideoDetector); 1058 video_detector_.reset(new VideoDetector);
1060 window_selector_controller_.reset(new WindowSelectorController()); 1059 window_selector_controller_.reset(new WindowSelectorController());
1061 window_cycle_controller_.reset(new WindowCycleController()); 1060 window_cycle_controller_.reset(new WindowCycleController());
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 1248
1250 void Shell::OnWindowActivated( 1249 void Shell::OnWindowActivated(
1251 aura::client::ActivationChangeObserver::ActivationReason reason, 1250 aura::client::ActivationChangeObserver::ActivationReason reason,
1252 aura::Window* gained_active, 1251 aura::Window* gained_active,
1253 aura::Window* lost_active) { 1252 aura::Window* lost_active) {
1254 if (gained_active) 1253 if (gained_active)
1255 target_root_window_ = gained_active->GetRootWindow(); 1254 target_root_window_ = gained_active->GetRootWindow();
1256 } 1255 }
1257 1256
1258 } // namespace ash 1257 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.h ('k') | ash/wm/overview/window_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698