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

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

Issue 12505005: Store rotation/ui scale to local state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « ash/display/display_controller.cc ('k') | ash/shell.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 <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 internal_display_info_->SetBounds(gfx::Rect(0, 0, 800, 600)); 331 internal_display_info_->SetBounds(gfx::Rect(0, 0, 800, 600));
332 } 332 }
333 new_display_info_list.push_back(*internal_display_info_.get()); 333 new_display_info_list.push_back(*internal_display_info_.get());
334 // An internal display is always considered *connected*. 334 // An internal display is always considered *connected*.
335 num_connected_displays_++; 335 num_connected_displays_++;
336 } 336 }
337 UpdateDisplays(new_display_info_list); 337 UpdateDisplays(new_display_info_list);
338 } 338 }
339 339
340 void DisplayManager::UpdateDisplays() { 340 void DisplayManager::UpdateDisplays() {
341 #if defined(OS_CHROMEOS)
342 if (displays_.size() > 0 && base::chromeos::IsRunningOnChromeOS()) {
343 const DisplayLayout& layout = Shell::GetInstance()->
344 display_controller()->GetCurrentDisplayLayout();
345 if (layout.mirrored) {
346 Shell::GetInstance()->output_configurator()->
347 SetDisplayMode(chromeos::STATE_DUAL_MIRROR);
348 }
349 return;
350 }
351 #endif
341 DisplayInfoList display_info_list; 352 DisplayInfoList display_info_list;
342 for (DisplayList::const_iterator iter = displays_.begin(); 353 for (DisplayList::const_iterator iter = displays_.begin();
343 iter != displays_.end(); ++iter) { 354 iter != displays_.end(); ++iter) {
344 display_info_list.push_back(GetDisplayInfo(iter->id())); 355 display_info_list.push_back(GetDisplayInfo(iter->id()));
345 } 356 }
346 UpdateDisplays(display_info_list); 357 UpdateDisplays(display_info_list);
347 } 358 }
348 359
349 void DisplayManager::UpdateDisplays( 360 void DisplayManager::UpdateDisplays(
350 const std::vector<DisplayInfo>& updated_display_info_list) { 361 const std::vector<DisplayInfo>& updated_display_info_list) {
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 // always (0,0) and the secondary display's bounds will be updated 731 // always (0,0) and the secondary display's bounds will be updated
721 // by |DisplayController::UpdateDisplayBoundsForLayout|. 732 // by |DisplayController::UpdateDisplayBoundsForLayout|.
722 new_display.SetScaleAndBounds( 733 new_display.SetScaleAndBounds(
723 display_info.device_scale_factor(), gfx::Rect(bounds_in_pixel.size())); 734 display_info.device_scale_factor(), gfx::Rect(bounds_in_pixel.size()));
724 new_display.set_rotation(display_info.rotation()); 735 new_display.set_rotation(display_info.rotation());
725 return new_display; 736 return new_display;
726 } 737 }
727 738
728 } // namespace internal 739 } // namespace internal
729 } // namespace ash 740 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_controller.cc ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698