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/window_tree_host_manager.h" | 5 #include "ash/display/window_tree_host_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 void WindowTreeHostManager::PostDisplayConfigurationChange() { | 834 void WindowTreeHostManager::PostDisplayConfigurationChange() { |
835 if (limiter_) | 835 if (limiter_) |
836 limiter_->SetThrottleTimeout(kAfterDisplayChangeThrottleTimeoutMs); | 836 limiter_->SetThrottleTimeout(kAfterDisplayChangeThrottleTimeoutMs); |
837 | 837 |
838 focus_activation_store_->Restore(); | 838 focus_activation_store_->Restore(); |
839 | 839 |
840 DisplayManager* display_manager = GetDisplayManager(); | 840 DisplayManager* display_manager = GetDisplayManager(); |
841 DisplayLayoutStore* layout_store = display_manager->layout_store(); | 841 DisplayLayoutStore* layout_store = display_manager->layout_store(); |
842 if (display_manager->num_connected_displays() > 1) { | 842 if (display_manager->num_connected_displays() > 1) { |
843 DisplayIdPair pair = display_manager->GetCurrentDisplayIdPair(); | 843 DisplayIdPair pair = display_manager->GetCurrentDisplayIdPair(); |
| 844 DisplayLayout layout = layout_store->GetRegisteredDisplayLayout(pair); |
844 layout_store->UpdateMultiDisplayState( | 845 layout_store->UpdateMultiDisplayState( |
845 pair, display_manager->IsInMirrorMode(), | 846 pair, display_manager->IsInMirrorMode(), layout.default_unified); |
846 display_manager->default_multi_display_mode() == | |
847 DisplayManager::UNIFIED); | |
848 | 847 |
849 if (Shell::GetScreen()->GetNumDisplays() > 1) { | 848 if (Shell::GetScreen()->GetNumDisplays() > 1) { |
850 DisplayLayout layout = layout_store->GetRegisteredDisplayLayout(pair); | |
851 int64 primary_id = layout.primary_id; | 849 int64 primary_id = layout.primary_id; |
852 SetPrimaryDisplayId(primary_id == gfx::Display::kInvalidDisplayID | 850 SetPrimaryDisplayId(primary_id == gfx::Display::kInvalidDisplayID |
853 ? pair.first | 851 ? pair.first |
854 : primary_id); | 852 : primary_id); |
855 // Update the primary_id in case the above call is | 853 // Update the primary_id in case the above call is |
856 // ignored. Happens when a) default layout's primary id | 854 // ignored. Happens when a) default layout's primary id |
857 // doesn't exist, or b) the primary_id has already been | 855 // doesn't exist, or b) the primary_id has already been |
858 // set to the same and didn't update it. | 856 // set to the same and didn't update it. |
859 layout_store->UpdatePrimaryDisplayId( | 857 layout_store->UpdatePrimaryDisplayId( |
860 pair, Shell::GetScreen()->GetPrimaryDisplay().id()); | 858 pair, Shell::GetScreen()->GetPrimaryDisplay().id()); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 ->display_configurator_animation() | 924 ->display_configurator_animation() |
927 ->StartFadeInAnimation(); | 925 ->StartFadeInAnimation(); |
928 #endif | 926 #endif |
929 } | 927 } |
930 | 928 |
931 void WindowTreeHostManager::SetMirrorModeAfterAnimation(bool mirror) { | 929 void WindowTreeHostManager::SetMirrorModeAfterAnimation(bool mirror) { |
932 GetDisplayManager()->SetMirrorMode(mirror); | 930 GetDisplayManager()->SetMirrorMode(mirror); |
933 } | 931 } |
934 | 932 |
935 } // namespace ash | 933 } // namespace ash |
OLD | NEW |