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

Side by Side Diff: ash/display/display_manager.cc

Issue 1119953002: Enable display rotation, magnifier in unified desktop mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/display/display_manager.h" 5 #include "ash/display/display_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 return software_mirroring_enabled(); 1010 return software_mirroring_enabled();
1011 } 1011 }
1012 #endif 1012 #endif
1013 1013
1014 void DisplayManager::SetMultiDisplayMode(MultiDisplayMode mode) { 1014 void DisplayManager::SetMultiDisplayMode(MultiDisplayMode mode) {
1015 multi_display_mode_ = mode; 1015 multi_display_mode_ = mode;
1016 mirroring_display_id_ = gfx::Display::kInvalidDisplayID; 1016 mirroring_display_id_ = gfx::Display::kInvalidDisplayID;
1017 software_mirroring_display_list_.clear(); 1017 software_mirroring_display_list_.clear();
1018 } 1018 }
1019 1019
1020 void DisplayManager::SetDefaultMultiDisplayMode(MultiDisplayMode mode) {
1021 // TODO(oshima): Remove this constrain.
1022 DCHECK_EQ(default_multi_display_mode_, EXTENDED);
1023 DCHECK_EQ(mode, UNIFIED);
1024 default_multi_display_mode_ = mode;
1025 }
1026
1020 bool DisplayManager::UpdateDisplayBounds(int64 display_id, 1027 bool DisplayManager::UpdateDisplayBounds(int64 display_id,
1021 const gfx::Rect& new_bounds) { 1028 const gfx::Rect& new_bounds) {
1022 if (change_display_upon_host_resize_) { 1029 if (change_display_upon_host_resize_) {
1023 display_info_[display_id].SetBounds(new_bounds); 1030 display_info_[display_id].SetBounds(new_bounds);
1024 // Don't notify observers if the mirrored window has changed. 1031 // Don't notify observers if the mirrored window has changed.
1025 if (software_mirroring_enabled() && mirroring_display_id_ == display_id) 1032 if (software_mirroring_enabled() && mirroring_display_id_ == display_id)
1026 return false; 1033 return false;
1027 gfx::Display* display = FindDisplayForId(display_id); 1034 gfx::Display* display = FindDisplayForId(display_id);
1028 display->SetSize(display_info_[display_id].size_in_pixel()); 1035 display->SetSize(display_info_[display_id].size_in_pixel());
1029 screen_->NotifyMetricsChanged(*display, 1036 screen_->NotifyMetricsChanged(*display,
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 gfx::Rect(new_secondary_origin, secondary_bounds.size())); 1314 gfx::Rect(new_secondary_origin, secondary_bounds.size()));
1308 secondary_display->UpdateWorkAreaFromInsets(insets); 1315 secondary_display->UpdateWorkAreaFromInsets(insets);
1309 } 1316 }
1310 1317
1311 void DisplayManager::RunPendingTasksForTest() { 1318 void DisplayManager::RunPendingTasksForTest() {
1312 if (!software_mirroring_display_list_.empty()) 1319 if (!software_mirroring_display_list_.empty())
1313 base::RunLoop().RunUntilIdle(); 1320 base::RunLoop().RunUntilIdle();
1314 } 1321 }
1315 1322
1316 } // namespace ash 1323 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698