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

Unified Diff: chromeos/display/output_configurator.cc

Issue 15067012: Move chromeos specific utility functions for display to chromeos/display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | « chromeos/display/output_configurator.h ('k') | chromeos/display/output_configurator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/display/output_configurator.cc
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc
index cca82e7062be224dd560cf2b5a4432f4e57a1aed..fab354ee5440d01b5eb494438d1ae8a85ce977e1 100644
--- a/chromeos/display/output_configurator.cc
+++ b/chromeos/display/output_configurator.cc
@@ -12,16 +12,13 @@
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/time.h"
+#include "chromeos/display/output_util.h"
#include "chromeos/display/real_output_configurator_delegate.h"
namespace chromeos {
namespace {
-// Prefixes for the built-in displays.
-const char kInternal_LVDS[] = "LVDS";
-const char kInternal_eDP[] = "eDP";
-
// The delay to perform configuration after RRNotify. See the comment
// in |Dispatch()|.
const int64 kConfigureDelayMs = 500;
@@ -93,7 +90,8 @@ OutputConfigurator::OutputSnapshot::OutputSnapshot()
is_internal(false),
is_aspect_preserving_scaling(false),
touch_device_id(0),
- index(0) {}
+ display_id(0),
Jun Mukai 2013/05/14 17:29:33 why did you change to 0?
oshima 2013/05/15 00:59:17 I want this to be consistent with other fields (wh
+ has_display_id(false) {}
OutputConfigurator::CoordinateTransformation::CoordinateTransformation()
: x_scale(1.0),
@@ -142,11 +140,6 @@ bool OutputConfigurator::TestApi::SendOutputChangeEvents(bool connected) {
return true;
}
-// static
-bool OutputConfigurator::IsInternalOutputName(const std::string& name) {
- return name.find(kInternal_LVDS) == 0 || name.find(kInternal_eDP) == 0;
-}
-
OutputConfigurator::OutputConfigurator()
: state_controller_(NULL),
configure_display_(base::chromeos::IsRunningOnChromeOS()),
@@ -512,7 +505,14 @@ OutputState OutputConfigurator::GetOutputState(
} else {
// With either both outputs on or both outputs off, use one of the
// dual modes.
- return state_controller_->GetStateForOutputs(outputs);
+ std::vector<int64> display_ids;
+ for (size_t i = 0; i < outputs.size(); ++i) {
+ // If display id isn't available, switch to extended mode.
+ if (!outputs[i].has_display_id)
+ return STATE_DUAL_EXTENDED;
+ display_ids.push_back(outputs[i].display_id);
+ }
+ return state_controller_->GetStateForDisplayIds(display_ids);
}
}
default:
« no previous file with comments | « chromeos/display/output_configurator.h ('k') | chromeos/display/output_configurator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698