OLD | NEW |
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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 maximize_mode_window_manager_.reset(new MaximizeModeWindowManager()); | 470 maximize_mode_window_manager_.reset(new MaximizeModeWindowManager()); |
471 } else if (!enable && maximize_mode_window_manager_.get()) { | 471 } else if (!enable && maximize_mode_window_manager_.get()) { |
472 maximize_mode_window_manager_.reset(); | 472 maximize_mode_window_manager_.reset(); |
473 } | 473 } |
474 } | 474 } |
475 | 475 |
476 bool Shell::IsMaximizeModeWindowManagerEnabled() { | 476 bool Shell::IsMaximizeModeWindowManagerEnabled() { |
477 return maximize_mode_window_manager_.get() != NULL; | 477 return maximize_mode_window_manager_.get() != NULL; |
478 } | 478 } |
479 | 479 |
| 480 #if defined(OS_CHROMEOS) |
| 481 bool Shell::ShouldSaveDisplaySettings() { |
| 482 return !((IsMaximizeModeWindowManagerEnabled() && |
| 483 maximize_mode_controller_->in_set_screen_rotation()) || |
| 484 resolution_notification_controller_->DoesNotificationTimeout()); |
| 485 } |
| 486 #endif |
| 487 |
480 void Shell::UpdateShelfVisibility() { | 488 void Shell::UpdateShelfVisibility() { |
481 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 489 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
482 for (RootWindowControllerList::iterator iter = controllers.begin(); | 490 for (RootWindowControllerList::iterator iter = controllers.begin(); |
483 iter != controllers.end(); ++iter) | 491 iter != controllers.end(); ++iter) |
484 if ((*iter)->shelf()) | 492 if ((*iter)->shelf()) |
485 (*iter)->UpdateShelfVisibility(); | 493 (*iter)->UpdateShelfVisibility(); |
486 } | 494 } |
487 | 495 |
488 void Shell::SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior, | 496 void Shell::SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior, |
489 aura::Window* root_window) { | 497 aura::Window* root_window) { |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 //////////////////////////////////////////////////////////////////////////////// | 1149 //////////////////////////////////////////////////////////////////////////////// |
1142 // Shell, aura::client::ActivationChangeObserver implementation: | 1150 // Shell, aura::client::ActivationChangeObserver implementation: |
1143 | 1151 |
1144 void Shell::OnWindowActivated(aura::Window* gained_active, | 1152 void Shell::OnWindowActivated(aura::Window* gained_active, |
1145 aura::Window* lost_active) { | 1153 aura::Window* lost_active) { |
1146 if (gained_active) | 1154 if (gained_active) |
1147 target_root_window_ = gained_active->GetRootWindow(); | 1155 target_root_window_ = gained_active->GetRootWindow(); |
1148 } | 1156 } |
1149 | 1157 |
1150 } // namespace ash | 1158 } // namespace ash |
OLD | NEW |