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

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

Issue 1177863002: ash: Restore user selected rotation on startup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 6 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
« no previous file with comments | « no previous file | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698