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

Unified Diff: monitor_reconfigure_main.h

Issue 3304011: monitor_reconfig: Handle external monitors and add tests. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222//monitor_reconfig.git
Patch Set: apply review feedback Created 10 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Makefile ('k') | monitor_reconfigure_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: monitor_reconfigure_main.h
diff --git a/monitor_reconfigure_main.h b/monitor_reconfigure_main.h
index 3aa17d0a1be923c8d80797c44904d28413ee0a3f..aeac10f90afad7094fd3ef082284b845d9f38db5 100644
--- a/monitor_reconfigure_main.h
+++ b/monitor_reconfigure_main.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -12,6 +12,8 @@
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
+#include "monitor_reconfig/resolution_selector.h"
+
namespace monitor_reconfig {
// MonitorReconfigureMain is the class responsible for setting the external
@@ -32,38 +34,10 @@ class MonitorReconfigureMain {
// Returns whether an external monitor is connected
bool IsExternalMonitorConnected();
- // Comparator used by SortModeByResolution().
- // Returns true if |mode_a| has more pixels than |mode_b| and false otherwise.
- class ModeResolutionComparator {
- public:
- bool operator()(XRRModeInfo* mode_a, XRRModeInfo* mode_b) const {
- return mode_a->width * mode_a->height > mode_b->width * mode_b->height;
- }
- };
-
// Sorts |output_info|'s modes by decreasing number of pixels, storing the
// results in |modes_out|.
void SortModesByResolution(const XRROutputInfo& output_info,
- std::vector<XRRModeInfo*>* modes_out);
-
- // Find resolutions to use.
- bool FindBestResolutions(
- std::string* lcd_resolution,
- std::string* external_resolution,
- std::string* screen_resolution);
-
- // Find resolutions to use that are reasonably close together.
- // |larger_device_modes| and |smaller_device_modes| should be sorted by
- // descending resolution. We choose the highest resolution from
- // |smaller_device_modes| and the lowest resolution from |larger_device_modes|
- // that's at least as high as the resolution from the smaller device.
- // |screen_resolution| gets set to |smaller_resolution| to avoid clipping.
- bool FindNearestResolutions(
- const std::vector<XRRModeInfo*>& larger_device_modes,
- const std::vector<XRRModeInfo*>& smaller_device_modes,
- std::string* larger_resolution,
- std::string* smaller_resolution,
- std::string* screen_resolution);
+ std::vector<ResolutionSelector::Mode>* modes_out);
// Set the resolution for a particular display or for the screen.
bool SetDeviceResolution(const std::string& device_name,
« no previous file with comments | « Makefile ('k') | monitor_reconfigure_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698