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_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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 gfx::Display::Rotation rotation, | 461 gfx::Display::Rotation rotation, |
462 float ui_scale, | 462 float ui_scale, |
463 const gfx::Insets* overscan_insets, | 463 const gfx::Insets* overscan_insets, |
464 const gfx::Size& resolution_in_pixels, | 464 const gfx::Size& resolution_in_pixels, |
465 float device_scale_factor, | 465 float device_scale_factor, |
466 ui::ColorCalibrationProfile color_profile) { | 466 ui::ColorCalibrationProfile color_profile) { |
467 if (display_info_.find(display_id) == display_info_.end()) | 467 if (display_info_.find(display_id) == display_info_.end()) |
468 display_info_[display_id] = DisplayInfo(display_id, std::string(), false); | 468 display_info_[display_id] = DisplayInfo(display_id, std::string(), false); |
469 | 469 |
470 display_info_[display_id].SetRotation(rotation, | 470 display_info_[display_id].SetRotation(rotation, |
| 471 gfx::Display::ROTATION_SOURCE_USER); |
| 472 display_info_[display_id].SetRotation(rotation, |
471 gfx::Display::ROTATION_SOURCE_ACTIVE); | 473 gfx::Display::ROTATION_SOURCE_ACTIVE); |
472 display_info_[display_id].SetColorProfile(color_profile); | 474 display_info_[display_id].SetColorProfile(color_profile); |
473 // Just in case the preference file was corrupted. | 475 // Just in case the preference file was corrupted. |
474 // TODO(mukai): register |display_modes_| here as well, so the lookup for the | 476 // TODO(mukai): register |display_modes_| here as well, so the lookup for the |
475 // default mode in GetActiveModeForDisplayId() gets much simpler. | 477 // default mode in GetActiveModeForDisplayId() gets much simpler. |
476 if (0.5f <= ui_scale && ui_scale <= 2.0f) | 478 if (0.5f <= ui_scale && ui_scale <= 2.0f) |
477 display_info_[display_id].set_configured_ui_scale(ui_scale); | 479 display_info_[display_id].set_configured_ui_scale(ui_scale); |
478 if (overscan_insets) | 480 if (overscan_insets) |
479 display_info_[display_id].SetOverscanInsets(*overscan_insets); | 481 display_info_[display_id].SetOverscanInsets(*overscan_insets); |
480 if (!resolution_in_pixels.IsEmpty()) { | 482 if (!resolution_in_pixels.IsEmpty()) { |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1368 gfx::Rect(new_secondary_origin, secondary_bounds.size())); | 1370 gfx::Rect(new_secondary_origin, secondary_bounds.size())); |
1369 secondary_display->UpdateWorkAreaFromInsets(insets); | 1371 secondary_display->UpdateWorkAreaFromInsets(insets); |
1370 } | 1372 } |
1371 | 1373 |
1372 void DisplayManager::RunPendingTasksForTest() { | 1374 void DisplayManager::RunPendingTasksForTest() { |
1373 if (!software_mirroring_display_list_.empty()) | 1375 if (!software_mirroring_display_list_.empty()) |
1374 base::RunLoop().RunUntilIdle(); | 1376 base::RunLoop().RunUntilIdle(); |
1375 } | 1377 } |
1376 | 1378 |
1377 } // namespace ash | 1379 } // namespace ash |
OLD | NEW |