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

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: Update Helper code Created 5 years, 11 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
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 #include "ui/wm/core/visibility_controller.h" 113 #include "ui/wm/core/visibility_controller.h"
114 #include "ui/wm/core/window_modality_controller.h" 114 #include "ui/wm/core/window_modality_controller.h"
115 115
116 #if defined(OS_CHROMEOS) 116 #if defined(OS_CHROMEOS)
117 #if defined(USE_X11) 117 #if defined(USE_X11)
118 #include "ui/gfx/x/x11_types.h" 118 #include "ui/gfx/x/x11_types.h"
119 #endif // defined(USE_X11) 119 #endif // defined(USE_X11)
120 #include "ash/accelerators/magnifier_key_scroller.h" 120 #include "ash/accelerators/magnifier_key_scroller.h"
121 #include "ash/accelerators/spoken_feedback_toggler.h" 121 #include "ash/accelerators/spoken_feedback_toggler.h"
122 #include "ash/ash_constants.h" 122 #include "ash/ash_constants.h"
123 #include "ash/content/display/screen_orientation_delegate_chromeos.h" 123 #include "ash/content/display/screen_orientation_controller_chromeos.h"
124 #include "ash/display/display_change_observer_chromeos.h" 124 #include "ash/display/display_change_observer_chromeos.h"
125 #include "ash/display/display_configurator_animation.h" 125 #include "ash/display/display_configurator_animation.h"
126 #include "ash/display/display_error_observer_chromeos.h" 126 #include "ash/display/display_error_observer_chromeos.h"
127 #include "ash/display/projecting_observer_chromeos.h" 127 #include "ash/display/projecting_observer_chromeos.h"
128 #include "ash/display/resolution_notification_controller.h" 128 #include "ash/display/resolution_notification_controller.h"
129 #include "ash/sticky_keys/sticky_keys_controller.h" 129 #include "ash/sticky_keys/sticky_keys_controller.h"
130 #include "ash/system/chromeos/bluetooth/bluetooth_notification_controller.h" 130 #include "ash/system/chromeos/bluetooth/bluetooth_notification_controller.h"
131 #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h" 131 #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h"
132 #include "ash/system/chromeos/power/power_event_observer.h" 132 #include "ash/system/chromeos/power/power_event_observer.h"
133 #include "ash/system/chromeos/power/power_status.h" 133 #include "ash/system/chromeos/power/power_status.h"
(...skipping 344 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 RemovePreTargetHandler(event_transformation_handler_.get()); 686 RemovePreTargetHandler(event_transformation_handler_.get());
688 RemovePreTargetHandler(toplevel_window_event_handler_.get()); 687 RemovePreTargetHandler(toplevel_window_event_handler_.get());
689 RemovePostTargetHandler(toplevel_window_event_handler_.get()); 688 RemovePostTargetHandler(toplevel_window_event_handler_.get());
690 RemovePreTargetHandler(system_gesture_filter_.get()); 689 RemovePreTargetHandler(system_gesture_filter_.get());
691 RemovePreTargetHandler(keyboard_metrics_filter_.get()); 690 RemovePreTargetHandler(keyboard_metrics_filter_.get());
692 RemovePreTargetHandler(mouse_cursor_filter_.get()); 691 RemovePreTargetHandler(mouse_cursor_filter_.get());
693 692
694 // TooltipController is deleted with the Shell so removing its references. 693 // TooltipController is deleted with the Shell so removing its references.
695 RemovePreTargetHandler(tooltip_controller_.get()); 694 RemovePreTargetHandler(tooltip_controller_.get());
696 695
696 #if defined(OS_CHROMEOS)
697 screen_orientation_controller_.reset();
698 #endif
699
697 // Destroy maximize mode controller early on since it has some observers which 700 // Destroy maximize mode controller early on since it has some observers which
698 // need to be removed. 701 // need to be removed.
699 maximize_mode_controller_->Shutdown();
700 maximize_mode_controller_.reset(); 702 maximize_mode_controller_.reset();
oshima 2015/01/09 21:23:55 I believe this is cros specific too right? not in
jonross 2015/01/12 14:46:49 It only performs any actions on cros. I can updat
701 703
702 // AppList needs to be released before shelf layout manager, which is 704 // AppList needs to be released before shelf layout manager, which is
703 // destroyed with shelf container in the loop below. However, app list 705 // destroyed with shelf container in the loop below. However, app list
704 // container is now on top of shelf container and released after it. 706 // container is now on top of shelf container and released after it.
705 // TODO(xiyuan): Move it back when app list container is no longer needed. 707 // TODO(xiyuan): Move it back when app list container is no longer needed.
706 app_list_controller_.reset(); 708 app_list_controller_.reset();
707 709
708 #if defined(OS_CHROMEOS) 710 #if defined(OS_CHROMEOS)
709 // Destroy the LastWindowClosedLogoutReminder before the 711 // Destroy the LastWindowClosedLogoutReminder before the
710 // LogoutConfirmationController. 712 // LogoutConfirmationController.
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 scoped_ptr<ash::BrightnessControlDelegate>( 1055 scoped_ptr<ash::BrightnessControlDelegate>(
1054 new ash::system::BrightnessControllerChromeos).Pass()); 1056 new ash::system::BrightnessControllerChromeos).Pass());
1055 1057
1056 power_event_observer_.reset(new PowerEventObserver()); 1058 power_event_observer_.reset(new PowerEventObserver());
1057 user_activity_notifier_.reset( 1059 user_activity_notifier_.reset(
1058 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get())); 1060 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get()));
1059 video_activity_notifier_.reset( 1061 video_activity_notifier_.reset(
1060 new VideoActivityNotifier(video_detector_.get())); 1062 new VideoActivityNotifier(video_detector_.get()));
1061 bluetooth_notification_controller_.reset(new BluetoothNotificationController); 1063 bluetooth_notification_controller_.reset(new BluetoothNotificationController);
1062 last_window_closed_logout_reminder_.reset(new LastWindowClosedLogoutReminder); 1064 last_window_closed_logout_reminder_.reset(new LastWindowClosedLogoutReminder);
1063 screen_orientation_delegate_.reset(new ScreenOrientationDelegate()); 1065 screen_orientation_controller_.reset(new ScreenOrientationController());
1064 #endif 1066 #endif
1065 // The compositor thread and main message loop have to be running in 1067 // The compositor thread and main message loop have to be running in
1066 // order to create mirror window. Run it after the main message loop 1068 // order to create mirror window. Run it after the main message loop
1067 // is started. 1069 // is started.
1068 display_manager_->CreateMirrorWindowAsyncIfAny(); 1070 display_manager_->CreateMirrorWindowAsyncIfAny();
1069 } 1071 }
1070 1072
1071 void Shell::InitKeyboard() { 1073 void Shell::InitKeyboard() {
1072 if (keyboard::IsKeyboardEnabled()) { 1074 if (keyboard::IsKeyboardEnabled()) {
1073 if (keyboard::KeyboardController::GetInstance()) { 1075 if (keyboard::KeyboardController::GetInstance()) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 //////////////////////////////////////////////////////////////////////////////// 1160 ////////////////////////////////////////////////////////////////////////////////
1159 // Shell, aura::client::ActivationChangeObserver implementation: 1161 // Shell, aura::client::ActivationChangeObserver implementation:
1160 1162
1161 void Shell::OnWindowActivated(aura::Window* gained_active, 1163 void Shell::OnWindowActivated(aura::Window* gained_active,
1162 aura::Window* lost_active) { 1164 aura::Window* lost_active) {
1163 if (gained_active) 1165 if (gained_active)
1164 target_root_window_ = gained_active->GetRootWindow(); 1166 target_root_window_ = gained_active->GetRootWindow();
1165 } 1167 }
1166 1168
1167 } // namespace ash 1169 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698