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

Side by Side Diff: ash/shell.cc

Issue 20708005: Refactor most recently used window tracking into a separate class. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address comments. Created 7 years, 4 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/mru_window_tracker.h » ('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 9
10 #include "ash/accelerators/focus_manager_factory.h" 10 #include "ash/accelerators/focus_manager_factory.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "ash/wm/ash_focus_rules.h" 43 #include "ash/wm/ash_focus_rules.h"
44 #include "ash/wm/ash_native_cursor_manager.h" 44 #include "ash/wm/ash_native_cursor_manager.h"
45 #include "ash/wm/base_layout_manager.h" 45 #include "ash/wm/base_layout_manager.h"
46 #include "ash/wm/capture_controller.h" 46 #include "ash/wm/capture_controller.h"
47 #include "ash/wm/coordinate_conversion.h" 47 #include "ash/wm/coordinate_conversion.h"
48 #include "ash/wm/custom_frame_view_ash.h" 48 #include "ash/wm/custom_frame_view_ash.h"
49 #include "ash/wm/event_client_impl.h" 49 #include "ash/wm/event_client_impl.h"
50 #include "ash/wm/event_rewriter_event_filter.h" 50 #include "ash/wm/event_rewriter_event_filter.h"
51 #include "ash/wm/lock_state_controller.h" 51 #include "ash/wm/lock_state_controller.h"
52 #include "ash/wm/lock_state_controller_impl2.h" 52 #include "ash/wm/lock_state_controller_impl2.h"
53 #include "ash/wm/mru_window_tracker.h"
53 #include "ash/wm/overlay_event_filter.h" 54 #include "ash/wm/overlay_event_filter.h"
54 #include "ash/wm/power_button_controller.h" 55 #include "ash/wm/power_button_controller.h"
55 #include "ash/wm/property_util.h" 56 #include "ash/wm/property_util.h"
56 #include "ash/wm/resize_shadow_controller.h" 57 #include "ash/wm/resize_shadow_controller.h"
57 #include "ash/wm/root_window_layout_manager.h" 58 #include "ash/wm/root_window_layout_manager.h"
58 #include "ash/wm/screen_dimmer.h" 59 #include "ash/wm/screen_dimmer.h"
59 #include "ash/wm/session_state_controller_impl.h" 60 #include "ash/wm/session_state_controller_impl.h"
60 #include "ash/wm/system_gesture_event_filter.h" 61 #include "ash/wm/system_gesture_event_filter.h"
61 #include "ash/wm/system_modal_container_event_filter.h" 62 #include "ash/wm/system_modal_container_event_filter.h"
62 #include "ash/wm/system_modal_container_layout_manager.h" 63 #include "ash/wm/system_modal_container_layout_manager.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 capture_controller_.reset(); 301 capture_controller_.reset();
301 nested_dispatcher_controller_.reset(); 302 nested_dispatcher_controller_.reset();
302 user_action_client_.reset(); 303 user_action_client_.reset();
303 visibility_controller_.reset(); 304 visibility_controller_.reset();
304 launcher_delegate_.reset(); 305 launcher_delegate_.reset();
305 launcher_model_.reset(); 306 launcher_model_.reset();
306 video_detector_.reset(); 307 video_detector_.reset();
307 308
308 power_button_controller_.reset(); 309 power_button_controller_.reset();
309 lock_state_controller_.reset(); 310 lock_state_controller_.reset();
311 mru_window_tracker_.reset();
310 312
311 // This also deletes all RootWindows. Note that we invoke Shutdown() on 313 // This also deletes all RootWindows. Note that we invoke Shutdown() on
312 // DisplayController before resetting |display_controller_|, since destruction 314 // DisplayController before resetting |display_controller_|, since destruction
313 // of its owned RootWindowControllers relies on the value. 315 // of its owned RootWindowControllers relies on the value.
314 display_controller_->Shutdown(); 316 display_controller_->Shutdown();
315 display_controller_.reset(); 317 display_controller_.reset();
316 screen_position_controller_.reset(); 318 screen_position_controller_.reset();
317 319
318 // Delete the activation controller after other controllers and launcher 320 // Delete the activation controller after other controllers and launcher
319 // because they might have registered ActivationChangeObserver. 321 // because they might have registered ActivationChangeObserver.
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 // TODO(oshima): Move as many controllers before creating 558 // TODO(oshima): Move as many controllers before creating
557 // RootWindowController as possible. 559 // RootWindowController as possible.
558 visibility_controller_.reset(new AshVisibilityController); 560 visibility_controller_.reset(new AshVisibilityController);
559 user_action_client_.reset(delegate_->CreateUserActionClient()); 561 user_action_client_.reset(delegate_->CreateUserActionClient());
560 window_modality_controller_.reset( 562 window_modality_controller_.reset(
561 new views::corewm::WindowModalityController); 563 new views::corewm::WindowModalityController);
562 AddPreTargetHandler(window_modality_controller_.get()); 564 AddPreTargetHandler(window_modality_controller_.get());
563 565
564 magnification_controller_.reset( 566 magnification_controller_.reset(
565 MagnificationController::CreateInstance()); 567 MagnificationController::CreateInstance());
568 mru_window_tracker_.reset(new MruWindowTracker(activation_client_));
566 569
567 partial_magnification_controller_.reset( 570 partial_magnification_controller_.reset(
568 new PartialMagnificationController()); 571 new PartialMagnificationController());
569 572
570 high_contrast_controller_.reset(new HighContrastController); 573 high_contrast_controller_.reset(new HighContrastController);
571 video_detector_.reset(new VideoDetector); 574 video_detector_.reset(new VideoDetector);
572 window_cycle_controller_.reset(new WindowCycleController(activation_client_)); 575 window_cycle_controller_.reset(new WindowCycleController());
573 576
574 tooltip_controller_.reset(new views::corewm::TooltipController( 577 tooltip_controller_.reset(new views::corewm::TooltipController(
575 gfx::SCREEN_TYPE_ALTERNATE)); 578 gfx::SCREEN_TYPE_ALTERNATE));
576 AddPreTargetHandler(tooltip_controller_.get()); 579 AddPreTargetHandler(tooltip_controller_.get());
577 580
578 event_client_.reset(new internal::EventClientImpl); 581 event_client_.reset(new internal::EventClientImpl);
579 582
580 // This controller needs to be set before SetupManagedWindowMode. 583 // This controller needs to be set before SetupManagedWindowMode.
581 desktop_background_controller_.reset(new DesktopBackgroundController()); 584 desktop_background_controller_.reset(new DesktopBackgroundController());
582 user_wallpaper_delegate_.reset(delegate_->CreateUserWallpaperDelegate()); 585 user_wallpaper_delegate_.reset(delegate_->CreateUserWallpaperDelegate());
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 921
919 if (nested_dispatcher_controller_) { 922 if (nested_dispatcher_controller_) {
920 aura::client::SetDispatcherClient(root_window, 923 aura::client::SetDispatcherClient(root_window,
921 nested_dispatcher_controller_.get()); 924 nested_dispatcher_controller_.get());
922 } 925 }
923 if (user_action_client_) 926 if (user_action_client_)
924 aura::client::SetUserActionClient(root_window, user_action_client_.get()); 927 aura::client::SetUserActionClient(root_window, user_action_client_.get());
925 928
926 controller->Init(first_run_after_boot); 929 controller->Init(first_run_after_boot);
927 930
928 window_cycle_controller_->OnRootWindowAdded(root_window); 931 mru_window_tracker_->OnRootWindowAdded(root_window);
929 } 932 }
930 933
931 //////////////////////////////////////////////////////////////////////////////// 934 ////////////////////////////////////////////////////////////////////////////////
932 // Shell, private: 935 // Shell, private:
933 936
934 bool Shell::CanWindowReceiveEvents(aura::Window* window) { 937 bool Shell::CanWindowReceiveEvents(aura::Window* window) {
935 RootWindowControllerList controllers = GetAllRootWindowControllers(); 938 RootWindowControllerList controllers = GetAllRootWindowControllers();
936 for (RootWindowControllerList::iterator iter = controllers.begin(); 939 for (RootWindowControllerList::iterator iter = controllers.begin();
937 iter != controllers.end(); ++iter) { 940 iter != controllers.end(); ++iter) {
938 internal::SystemModalContainerLayoutManager* layout_manager = 941 internal::SystemModalContainerLayoutManager* layout_manager =
(...skipping 21 matching lines...) Expand all
960 //////////////////////////////////////////////////////////////////////////////// 963 ////////////////////////////////////////////////////////////////////////////////
961 // Shell, aura::client::ActivationChangeObserver implementation: 964 // Shell, aura::client::ActivationChangeObserver implementation:
962 965
963 void Shell::OnWindowActivated(aura::Window* gained_active, 966 void Shell::OnWindowActivated(aura::Window* gained_active,
964 aura::Window* lost_active) { 967 aura::Window* lost_active) {
965 if (gained_active) 968 if (gained_active)
966 active_root_window_ = gained_active->GetRootWindow(); 969 active_root_window_ = gained_active->GetRootWindow();
967 } 970 }
968 971
969 } // namespace ash 972 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.h ('k') | ash/wm/mru_window_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698