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

Side by Side Diff: resolution_selector.cc

Issue 3709001: monitor_reconfig: Disable LCD when using external monitor. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222//monitor_reconfig.git
Patch Set: Created 10 years, 2 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 | « monitor_reconfigure_main.cc ('k') | resolution_selector_test.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) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS 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 "monitor_reconfig/resolution_selector.h" 5 #include "monitor_reconfig/resolution_selector.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace monitor_reconfig { 9 namespace monitor_reconfig {
10 10
(...skipping 28 matching lines...) Expand all
39 return FindNearestResolutions( 39 return FindNearestResolutions(
40 lcd_modes, external_modes, 40 lcd_modes, external_modes,
41 lcd_resolution, external_resolution, screen_resolution); 41 lcd_resolution, external_resolution, screen_resolution);
42 } else { 42 } else {
43 // If the external output is large enough that we think it's a monitor 43 // If the external output is large enough that we think it's a monitor
44 // (as opposed to a projector), then we just use its max resolution and 44 // (as opposed to a projector), then we just use its max resolution and
45 // forget about trying to choose a screen size that'll fit on the 45 // forget about trying to choose a screen size that'll fit on the
46 // built-in display. 46 // built-in display.
47 if (max_external_size > kMaxProjectorPixels) { 47 if (max_external_size > kMaxProjectorPixels) {
48 *external_resolution = *screen_resolution = external_modes[0].name; 48 *external_resolution = *screen_resolution = external_modes[0].name;
49 *lcd_resolution = lcd_modes[0].name; 49 lcd_resolution->clear();
50 return true; 50 return true;
51 } 51 }
52 return FindNearestResolutions( 52 return FindNearestResolutions(
53 external_modes, lcd_modes, 53 external_modes, lcd_modes,
54 external_resolution, lcd_resolution, screen_resolution); 54 external_resolution, lcd_resolution, screen_resolution);
55 } 55 }
56 } 56 }
57 57
58 bool ResolutionSelector::FindNearestResolutions( 58 bool ResolutionSelector::FindNearestResolutions(
59 const vector<Mode>& larger_device_modes, 59 const vector<Mode>& larger_device_modes,
(...skipping 22 matching lines...) Expand all
82 } 82 }
83 } 83 }
84 84
85 LOG(WARNING) << "Failed to find a resolution from larger device " 85 LOG(WARNING) << "Failed to find a resolution from larger device "
86 << "exceeding chosen resolution from smaller device (" 86 << "exceeding chosen resolution from smaller device ("
87 << *smaller_resolution << ")"; 87 << *smaller_resolution << ")";
88 return false; 88 return false;
89 } 89 }
90 90
91 } // namespace monitor_reconfig 91 } // namespace monitor_reconfig
OLDNEW
« no previous file with comments | « monitor_reconfigure_main.cc ('k') | resolution_selector_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698