| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |