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

Side by Side Diff: ash/shell.cc

Issue 2127263002: Keep the SystemModalContainerEventHandler added (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keep the SystemModalContainerEventHandler added Created 4 years, 5 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/system_modal_container_event_filter.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
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 OnShelfAutoHideBehaviorChanged(root_window)); 494 OnShelfAutoHideBehaviorChanged(root_window));
495 } 495 }
496 496
497 void Shell::NotifyFullscreenStateChange(bool is_fullscreen, 497 void Shell::NotifyFullscreenStateChange(bool is_fullscreen,
498 WmWindow* root_window) { 498 WmWindow* root_window) {
499 FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), 499 FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(),
500 OnFullscreenStateChanged(is_fullscreen, root_window)); 500 OnFullscreenStateChanged(is_fullscreen, root_window));
501 } 501 }
502 502
503 void Shell::CreateModalBackground(aura::Window* window) { 503 void Shell::CreateModalBackground(aura::Window* window) {
504 if (!modality_filter_) {
505 modality_filter_.reset(new SystemModalContainerEventFilter(this));
506 AddPreTargetHandler(modality_filter_.get());
507 }
508 RootWindowControllerList controllers = GetAllRootWindowControllers(); 504 RootWindowControllerList controllers = GetAllRootWindowControllers();
509 for (RootWindowControllerList::iterator iter = controllers.begin(); 505 for (RootWindowControllerList::iterator iter = controllers.begin();
510 iter != controllers.end(); ++iter) 506 iter != controllers.end(); ++iter)
511 (*iter)->GetSystemModalLayoutManager(window)->CreateModalBackground(); 507 (*iter)->GetSystemModalLayoutManager(window)->CreateModalBackground();
512 } 508 }
513 509
514 void Shell::OnModalWindowRemoved(aura::Window* removed) { 510 void Shell::OnModalWindowRemoved(aura::Window* removed) {
515 RootWindowControllerList controllers = GetAllRootWindowControllers(); 511 RootWindowControllerList controllers = GetAllRootWindowControllers();
516 bool activated = false; 512 bool activated = false;
517 for (RootWindowControllerList::iterator iter = controllers.begin(); 513 for (RootWindowControllerList::iterator iter = controllers.begin();
518 iter != controllers.end() && !activated; ++iter) { 514 iter != controllers.end() && !activated; ++iter) {
519 activated = (*iter) 515 activated = (*iter)
520 ->GetSystemModalLayoutManager(removed) 516 ->GetSystemModalLayoutManager(removed)
521 ->ActivateNextModalWindow(); 517 ->ActivateNextModalWindow();
522 } 518 }
523 if (!activated) { 519 if (!activated) {
524 RemovePreTargetHandler(modality_filter_.get());
525 modality_filter_.reset();
526 for (RootWindowControllerList::iterator iter = controllers.begin(); 520 for (RootWindowControllerList::iterator iter = controllers.begin();
527 iter != controllers.end(); ++iter) 521 iter != controllers.end(); ++iter)
528 (*iter)->GetSystemModalLayoutManager(removed)->DestroyModalBackground(); 522 (*iter)->GetSystemModalLayoutManager(removed)->DestroyModalBackground();
529 } 523 }
530 } 524 }
531 525
532 WebNotificationTray* Shell::GetWebNotificationTray() { 526 WebNotificationTray* Shell::GetWebNotificationTray() {
533 return GetPrimaryRootWindowController() 527 return GetPrimaryRootWindowController()
534 ->shelf_widget() 528 ->shelf_widget()
535 ->status_area_widget() 529 ->status_area_widget()
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 speech_feedback_handler_.reset(); 645 speech_feedback_handler_.reset();
652 #endif 646 #endif
653 RemovePreTargetHandler(overlay_filter_.get()); 647 RemovePreTargetHandler(overlay_filter_.get());
654 RemovePreTargetHandler(accelerator_filter_.get()); 648 RemovePreTargetHandler(accelerator_filter_.get());
655 RemovePreTargetHandler(event_transformation_handler_.get()); 649 RemovePreTargetHandler(event_transformation_handler_.get());
656 RemovePreTargetHandler(toplevel_window_event_handler_.get()); 650 RemovePreTargetHandler(toplevel_window_event_handler_.get());
657 RemovePostTargetHandler(toplevel_window_event_handler_.get()); 651 RemovePostTargetHandler(toplevel_window_event_handler_.get());
658 RemovePreTargetHandler(system_gesture_filter_.get()); 652 RemovePreTargetHandler(system_gesture_filter_.get());
659 RemovePreTargetHandler(keyboard_metrics_filter_.get()); 653 RemovePreTargetHandler(keyboard_metrics_filter_.get());
660 RemovePreTargetHandler(mouse_cursor_filter_.get()); 654 RemovePreTargetHandler(mouse_cursor_filter_.get());
655 RemovePreTargetHandler(modality_filter_.get());
661 656
662 // TooltipController is deleted with the Shell so removing its references. 657 // TooltipController is deleted with the Shell so removing its references.
663 RemovePreTargetHandler(tooltip_controller_.get()); 658 RemovePreTargetHandler(tooltip_controller_.get());
664 659
665 #if defined(OS_CHROMEOS) 660 #if defined(OS_CHROMEOS)
666 screen_orientation_controller_.reset(); 661 screen_orientation_controller_.reset();
667 #endif 662 #endif
668 663
669 // Destroy the virtual keyboard controller before the maximize mode controller 664 // Destroy the virtual keyboard controller before the maximize mode controller
670 // since the latters destructor triggers events that the former is listening 665 // since the latters destructor triggers events that the former is listening
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 lock_state_controller_.reset(); 740 lock_state_controller_.reset();
746 741
747 screen_pinning_controller_.reset(); 742 screen_pinning_controller_.reset();
748 743
749 #if defined(OS_CHROMEOS) 744 #if defined(OS_CHROMEOS)
750 resolution_notification_controller_.reset(); 745 resolution_notification_controller_.reset();
751 #endif 746 #endif
752 desktop_background_controller_.reset(); 747 desktop_background_controller_.reset();
753 screenshot_controller_.reset(); 748 screenshot_controller_.reset();
754 mouse_cursor_filter_.reset(); 749 mouse_cursor_filter_.reset();
750 modality_filter_.reset();
755 751
756 #if defined(OS_CHROMEOS) 752 #if defined(OS_CHROMEOS)
757 touch_transformer_controller_.reset(); 753 touch_transformer_controller_.reset();
758 #endif // defined(OS_CHROMEOS) 754 #endif // defined(OS_CHROMEOS)
759 755
760 #if defined(OS_CHROMEOS) 756 #if defined(OS_CHROMEOS)
761 audio_a11y_controller_.reset(); 757 audio_a11y_controller_.reset();
762 #endif // defined(OS_CHROMEOS) 758 #endif // defined(OS_CHROMEOS)
763 759
764 // This also deletes all RootWindows. Note that we invoke Shutdown() on 760 // This also deletes all RootWindows. Note that we invoke Shutdown() on
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 autoclick_controller_.reset(AutoclickController::CreateInstance()); 993 autoclick_controller_.reset(AutoclickController::CreateInstance());
998 994
999 high_contrast_controller_.reset(new HighContrastController); 995 high_contrast_controller_.reset(new HighContrastController);
1000 video_detector_.reset(new VideoDetector); 996 video_detector_.reset(new VideoDetector);
1001 window_cycle_controller_.reset(new WindowCycleController()); 997 window_cycle_controller_.reset(new WindowCycleController());
1002 998
1003 tooltip_controller_.reset(new views::corewm::TooltipController( 999 tooltip_controller_.reset(new views::corewm::TooltipController(
1004 std::unique_ptr<views::corewm::Tooltip>(new views::corewm::TooltipAura))); 1000 std::unique_ptr<views::corewm::Tooltip>(new views::corewm::TooltipAura)));
1005 AddPreTargetHandler(tooltip_controller_.get()); 1001 AddPreTargetHandler(tooltip_controller_.get());
1006 1002
1003 modality_filter_.reset(new SystemModalContainerEventFilter(this));
1004 AddPreTargetHandler(modality_filter_.get());
1005
1007 event_client_.reset(new EventClientImpl); 1006 event_client_.reset(new EventClientImpl);
1008 1007
1009 // This controller needs to be set before SetupManagedWindowMode. 1008 // This controller needs to be set before SetupManagedWindowMode.
1010 desktop_background_controller_.reset( 1009 desktop_background_controller_.reset(
1011 new DesktopBackgroundController(blocking_pool_)); 1010 new DesktopBackgroundController(blocking_pool_));
1012 user_wallpaper_delegate_.reset( 1011 user_wallpaper_delegate_.reset(
1013 wm_shell_->delegate()->CreateUserWallpaperDelegate()); 1012 wm_shell_->delegate()->CreateUserWallpaperDelegate());
1014 1013
1015 session_state_delegate_.reset( 1014 session_state_delegate_.reset(
1016 wm_shell_->delegate()->CreateSessionStateDelegate()); 1015 wm_shell_->delegate()->CreateSessionStateDelegate());
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 1167
1169 void Shell::OnWindowActivated( 1168 void Shell::OnWindowActivated(
1170 aura::client::ActivationChangeObserver::ActivationReason reason, 1169 aura::client::ActivationChangeObserver::ActivationReason reason,
1171 aura::Window* gained_active, 1170 aura::Window* gained_active,
1172 aura::Window* lost_active) { 1171 aura::Window* lost_active) {
1173 if (gained_active) 1172 if (gained_active)
1174 target_root_window_ = gained_active->GetRootWindow(); 1173 target_root_window_ = gained_active->GetRootWindow();
1175 } 1174 }
1176 1175
1177 } // namespace ash 1176 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.h ('k') | ash/wm/system_modal_container_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698