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

Side by Side Diff: ash/shell.cc

Issue 759063002: Move Screen Rotation from MaximizeModeController to ScreenOrientationController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change similarity to account for moved files Created 6 years 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
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/accelerator_controller.h" 10 #include "ash/accelerators/accelerator_controller.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 #include "ui/wm/core/visibility_controller.h" 114 #include "ui/wm/core/visibility_controller.h"
115 #include "ui/wm/core/window_modality_controller.h" 115 #include "ui/wm/core/window_modality_controller.h"
116 116
117 #if defined(OS_CHROMEOS) 117 #if defined(OS_CHROMEOS)
118 #if defined(USE_X11) 118 #if defined(USE_X11)
119 #include "ash/accelerators/magnifier_key_scroller.h" 119 #include "ash/accelerators/magnifier_key_scroller.h"
120 #include "ash/accelerators/spoken_feedback_toggler.h" 120 #include "ash/accelerators/spoken_feedback_toggler.h"
121 #include "ui/gfx/x/x11_types.h" 121 #include "ui/gfx/x/x11_types.h"
122 #endif // defined(USE_X11) 122 #endif // defined(USE_X11)
123 #include "ash/ash_constants.h" 123 #include "ash/ash_constants.h"
124 #include "ash/content/display/screen_orientation_delegate_chromeos.h" 124 #include "ash/content/display/screen_orientation_controller_chromeos.h"
125 #include "ash/display/display_change_observer_chromeos.h" 125 #include "ash/display/display_change_observer_chromeos.h"
126 #include "ash/display/display_configurator_animation.h" 126 #include "ash/display/display_configurator_animation.h"
127 #include "ash/display/display_error_observer_chromeos.h" 127 #include "ash/display/display_error_observer_chromeos.h"
128 #include "ash/display/projecting_observer_chromeos.h" 128 #include "ash/display/projecting_observer_chromeos.h"
129 #include "ash/display/resolution_notification_controller.h" 129 #include "ash/display/resolution_notification_controller.h"
130 #include "ash/sticky_keys/sticky_keys_controller.h" 130 #include "ash/sticky_keys/sticky_keys_controller.h"
131 #include "ash/system/chromeos/bluetooth/bluetooth_notification_controller.h" 131 #include "ash/system/chromeos/bluetooth/bluetooth_notification_controller.h"
132 #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h" 132 #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h"
133 #include "ash/system/chromeos/power/power_event_observer.h" 133 #include "ash/system/chromeos/power/power_event_observer.h"
134 #include "ash/system/chromeos/power/power_status.h" 134 #include "ash/system/chromeos/power/power_status.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 void Shell::AddShellObserver(ShellObserver* observer) { 478 void Shell::AddShellObserver(ShellObserver* observer) {
479 observers_.AddObserver(observer); 479 observers_.AddObserver(observer);
480 } 480 }
481 481
482 void Shell::RemoveShellObserver(ShellObserver* observer) { 482 void Shell::RemoveShellObserver(ShellObserver* observer) {
483 observers_.RemoveObserver(observer); 483 observers_.RemoveObserver(observer);
484 } 484 }
485 485
486 #if defined(OS_CHROMEOS) 486 #if defined(OS_CHROMEOS)
487 bool Shell::ShouldSaveDisplaySettings() { 487 bool Shell::ShouldSaveDisplaySettings() {
488 return !((maximize_mode_controller_->IsMaximizeModeWindowManagerEnabled() && 488 return !(screen_orientation_controller_
489 maximize_mode_controller_-> 489 ->ignore_display_configuration_updates() ||
490 ignore_display_configuration_updates()) ||
491 resolution_notification_controller_->DoesNotificationTimeout()); 490 resolution_notification_controller_->DoesNotificationTimeout());
492 } 491 }
493 #endif 492 #endif
494 493
495 void Shell::UpdateShelfVisibility() { 494 void Shell::UpdateShelfVisibility() {
496 RootWindowControllerList controllers = GetAllRootWindowControllers(); 495 RootWindowControllerList controllers = GetAllRootWindowControllers();
497 for (RootWindowControllerList::iterator iter = controllers.begin(); 496 for (RootWindowControllerList::iterator iter = controllers.begin();
498 iter != controllers.end(); ++iter) 497 iter != controllers.end(); ++iter)
499 if ((*iter)->shelf()) 498 if ((*iter)->shelf())
500 (*iter)->UpdateShelfVisibility(); 499 (*iter)->UpdateShelfVisibility();
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 RemovePreTargetHandler(event_transformation_handler_.get()); 688 RemovePreTargetHandler(event_transformation_handler_.get());
690 RemovePreTargetHandler(toplevel_window_event_handler_.get()); 689 RemovePreTargetHandler(toplevel_window_event_handler_.get());
691 RemovePostTargetHandler(toplevel_window_event_handler_.get()); 690 RemovePostTargetHandler(toplevel_window_event_handler_.get());
692 RemovePreTargetHandler(system_gesture_filter_.get()); 691 RemovePreTargetHandler(system_gesture_filter_.get());
693 RemovePreTargetHandler(keyboard_metrics_filter_.get()); 692 RemovePreTargetHandler(keyboard_metrics_filter_.get());
694 RemovePreTargetHandler(mouse_cursor_filter_.get()); 693 RemovePreTargetHandler(mouse_cursor_filter_.get());
695 694
696 // TooltipController is deleted with the Shell so removing its references. 695 // TooltipController is deleted with the Shell so removing its references.
697 RemovePreTargetHandler(tooltip_controller_.get()); 696 RemovePreTargetHandler(tooltip_controller_.get());
698 697
698 #if defined(OS_CHROMEOS)
699 screen_orientation_controller_.reset();
700 #endif
701
699 // Destroy maximize mode controller early on since it has some observers which 702 // Destroy maximize mode controller early on since it has some observers which
700 // need to be removed. 703 // need to be removed.
701 maximize_mode_controller_->Shutdown();
702 maximize_mode_controller_.reset(); 704 maximize_mode_controller_.reset();
703 705
704 // AppList needs to be released before shelf layout manager, which is 706 // AppList needs to be released before shelf layout manager, which is
705 // destroyed with shelf container in the loop below. However, app list 707 // destroyed with shelf container in the loop below. However, app list
706 // container is now on top of shelf container and released after it. 708 // container is now on top of shelf container and released after it.
707 // TODO(xiyuan): Move it back when app list container is no longer needed. 709 // TODO(xiyuan): Move it back when app list container is no longer needed.
708 app_list_controller_.reset(); 710 app_list_controller_.reset();
709 711
710 #if defined(OS_CHROMEOS) 712 #if defined(OS_CHROMEOS)
711 // Destroy the LastWindowClosedLogoutReminder before the 713 // Destroy the LastWindowClosedLogoutReminder before the
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 scoped_ptr<ash::BrightnessControlDelegate>( 1057 scoped_ptr<ash::BrightnessControlDelegate>(
1056 new ash::system::BrightnessControllerChromeos).Pass()); 1058 new ash::system::BrightnessControllerChromeos).Pass());
1057 1059
1058 power_event_observer_.reset(new PowerEventObserver()); 1060 power_event_observer_.reset(new PowerEventObserver());
1059 user_activity_notifier_.reset( 1061 user_activity_notifier_.reset(
1060 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get())); 1062 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get()));
1061 video_activity_notifier_.reset( 1063 video_activity_notifier_.reset(
1062 new VideoActivityNotifier(video_detector_.get())); 1064 new VideoActivityNotifier(video_detector_.get()));
1063 bluetooth_notification_controller_.reset(new BluetoothNotificationController); 1065 bluetooth_notification_controller_.reset(new BluetoothNotificationController);
1064 last_window_closed_logout_reminder_.reset(new LastWindowClosedLogoutReminder); 1066 last_window_closed_logout_reminder_.reset(new LastWindowClosedLogoutReminder);
1065 screen_orientation_delegate_.reset(new ScreenOrientationDelegate()); 1067 screen_orientation_controller_.reset(new ScreenOrientationController());
1066 #endif 1068 #endif
1067 // The compositor thread and main message loop have to be running in 1069 // The compositor thread and main message loop have to be running in
1068 // order to create mirror window. Run it after the main message loop 1070 // order to create mirror window. Run it after the main message loop
1069 // is started. 1071 // is started.
1070 display_manager_->CreateMirrorWindowAsyncIfAny(); 1072 display_manager_->CreateMirrorWindowAsyncIfAny();
1071 } 1073 }
1072 1074
1073 void Shell::InitKeyboard() { 1075 void Shell::InitKeyboard() {
1074 if (keyboard::IsKeyboardEnabled()) { 1076 if (keyboard::IsKeyboardEnabled()) {
1075 if (keyboard::KeyboardController::GetInstance()) { 1077 if (keyboard::KeyboardController::GetInstance()) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 //////////////////////////////////////////////////////////////////////////////// 1162 ////////////////////////////////////////////////////////////////////////////////
1161 // Shell, aura::client::ActivationChangeObserver implementation: 1163 // Shell, aura::client::ActivationChangeObserver implementation:
1162 1164
1163 void Shell::OnWindowActivated(aura::Window* gained_active, 1165 void Shell::OnWindowActivated(aura::Window* gained_active,
1164 aura::Window* lost_active) { 1166 aura::Window* lost_active) {
1165 if (gained_active) 1167 if (gained_active)
1166 target_root_window_ = gained_active->GetRootWindow(); 1168 target_root_window_ = gained_active->GetRootWindow();
1167 } 1169 }
1168 1170
1169 } // namespace ash 1171 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698