| 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/display/display_controller.h" | 5 #include "ash/display/display_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 void DisplayController::PostDisplayConfigurationChange() { | 838 void DisplayController::PostDisplayConfigurationChange() { |
| 839 if (limiter_) | 839 if (limiter_) |
| 840 limiter_->SetThrottleTimeout(kAfterDisplayChangeThrottleTimeoutMs); | 840 limiter_->SetThrottleTimeout(kAfterDisplayChangeThrottleTimeoutMs); |
| 841 | 841 |
| 842 focus_activation_store_->Restore(); | 842 focus_activation_store_->Restore(); |
| 843 | 843 |
| 844 DisplayManager* display_manager = GetDisplayManager(); | 844 DisplayManager* display_manager = GetDisplayManager(); |
| 845 DisplayLayoutStore* layout_store = display_manager->layout_store(); | 845 DisplayLayoutStore* layout_store = display_manager->layout_store(); |
| 846 if (display_manager->num_connected_displays() > 1) { | 846 if (display_manager->num_connected_displays() > 1) { |
| 847 DisplayIdPair pair = display_manager->GetCurrentDisplayIdPair(); | 847 DisplayIdPair pair = display_manager->GetCurrentDisplayIdPair(); |
| 848 layout_store->UpdateMirrorStatus(pair, display_manager->IsInMirrorMode()); | 848 layout_store->UpdateMultiDisplayState( |
| 849 pair, display_manager->IsInMirrorMode(), |
| 850 display_manager->default_multi_display_mode()); |
| 849 | 851 |
| 850 if (Shell::GetScreen()->GetNumDisplays() > 1 ) { | 852 if (Shell::GetScreen()->GetNumDisplays() > 1 ) { |
| 851 DisplayLayout layout = layout_store->GetRegisteredDisplayLayout(pair); | 853 DisplayLayout layout = layout_store->GetRegisteredDisplayLayout(pair); |
| 852 int64 primary_id = layout.primary_id; | 854 int64 primary_id = layout.primary_id; |
| 853 SetPrimaryDisplayId( | 855 SetPrimaryDisplayId( |
| 854 primary_id == gfx::Display::kInvalidDisplayID ? | 856 primary_id == gfx::Display::kInvalidDisplayID ? |
| 855 pair.first : primary_id); | 857 pair.first : primary_id); |
| 856 // Update the primary_id in case the above call is | 858 // Update the primary_id in case the above call is |
| 857 // ignored. Happens when a) default layout's primary id | 859 // ignored. Happens when a) default layout's primary id |
| 858 // doesn't exist, or b) the primary_id has already been | 860 // doesn't exist, or b) the primary_id has already been |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 Shell::GetInstance()->display_configurator_animation() | 907 Shell::GetInstance()->display_configurator_animation() |
| 906 ->StartFadeInAnimation(); | 908 ->StartFadeInAnimation(); |
| 907 #endif | 909 #endif |
| 908 } | 910 } |
| 909 | 911 |
| 910 void DisplayController::SetMirrorModeAfterAnimation(bool mirror) { | 912 void DisplayController::SetMirrorModeAfterAnimation(bool mirror) { |
| 911 GetDisplayManager()->SetMirrorMode(mirror); | 913 GetDisplayManager()->SetMirrorMode(mirror); |
| 912 } | 914 } |
| 913 | 915 |
| 914 } // namespace ash | 916 } // namespace ash |
| OLD | NEW |