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

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

Issue 106673003: Update the selected resolution to the resolution that is actually selected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update test Created 6 years, 11 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_manager.h ('k') | 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 <cmath> 7 #include <cmath>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 internal_display_connected = IsInternalDisplayId(iter->id()); 544 internal_display_connected = IsInternalDisplayId(iter->id());
545 // Mirrored monitors have the same origins. 545 // Mirrored monitors have the same origins.
546 gfx::Point origin = iter->bounds_in_native().origin(); 546 gfx::Point origin = iter->bounds_in_native().origin();
547 if (origins.find(origin) != origins.end()) { 547 if (origins.find(origin) != origins.end()) {
548 InsertAndUpdateDisplayInfo(*iter); 548 InsertAndUpdateDisplayInfo(*iter);
549 mirrored_display_id_ = iter->id(); 549 mirrored_display_id_ = iter->id();
550 } else { 550 } else {
551 origins.insert(origin); 551 origins.insert(origin);
552 new_display_info_list.push_back(*iter); 552 new_display_info_list.push_back(*iter);
553 } 553 }
554
555 const gfx::Size& resolution = iter->bounds_in_native().size();
556 const std::vector<Resolution>& resolutions = iter->resolutions();
557 // This is empty the displays are initialized from InitFromCommandLine.
558 if (!resolutions.size())
559 continue;
560 std::vector<Resolution>::const_iterator resolution_iter =
561 std::find_if(resolutions.begin(),
562 resolutions.end(),
563 ResolutionMatcher(resolution));
564 // Update the actual resolution selected as the resolution request may fail.
565 if (resolution_iter == resolutions.begin())
566 resolutions_.erase(iter->id());
567 else if (resolutions_.find(iter->id()) != resolutions_.end())
568 resolutions_[iter->id()] = resolution;
554 } 569 }
555 if (HasInternalDisplay() && 570 if (HasInternalDisplay() &&
556 !internal_display_connected && 571 !internal_display_connected &&
557 display_info_.find(gfx::Display::InternalDisplayId()) == 572 display_info_.find(gfx::Display::InternalDisplayId()) ==
558 display_info_.end()) { 573 display_info_.end()) {
559 DisplayInfo internal_display_info( 574 DisplayInfo internal_display_info(
560 gfx::Display::InternalDisplayId(), 575 gfx::Display::InternalDisplayId(),
561 l10n_util::GetStringUTF8(IDS_ASH_INTERNAL_DISPLAY_NAME), 576 l10n_util::GetStringUTF8(IDS_ASH_INTERNAL_DISPLAY_NAME),
562 false /*Internal display must not have overscan */); 577 false /*Internal display must not have overscan */);
563 internal_display_info.SetBounds(gfx::Rect(0, 0, 800, 600)); 578 internal_display_info.SetBounds(gfx::Rect(0, 0, 800, 600));
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 break; 1054 break;
1040 } 1055 }
1041 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); 1056 gfx::Insets insets = secondary_display->GetWorkAreaInsets();
1042 secondary_display->set_bounds( 1057 secondary_display->set_bounds(
1043 gfx::Rect(new_secondary_origin, secondary_bounds.size())); 1058 gfx::Rect(new_secondary_origin, secondary_bounds.size()));
1044 secondary_display->UpdateWorkAreaFromInsets(insets); 1059 secondary_display->UpdateWorkAreaFromInsets(insets);
1045 } 1060 }
1046 1061
1047 } // namespace internal 1062 } // namespace internal
1048 } // namespace ash 1063 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_manager.h ('k') | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698