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

Unified Diff: ash/display/display_manager.cc

Issue 21297003: Add ability to set resolution on external display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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
Index: ash/display/display_manager.cc
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc
index 48fb914d0f9de50b1228b3a8467502d72539366a..3d62d89b7b84198ce195bcf84a9200702fa2447a 100644
--- a/ash/display/display_manager.cc
+++ b/ash/display/display_manager.cc
@@ -321,11 +321,24 @@ void DisplayManager::SetDisplayUIScale(int64 display_id,
UpdateDisplays(display_info_list);
}
+void DisplayManager::SetDisplayResolution(int64 display_id,
+ const gfx::Size& resolution) {
+ DCHECK_NE(gfx::Display::InternalDisplayId(), display_id);
+ if (gfx::Display::InternalDisplayId() == display_id)
+ return;
+ resolutions_[display_id] = resolution;
+#if defined(OS_CHROMEOS) && defined(USE_X11)
+ if (base::chromeos::IsRunningOnChromeOS())
+ Shell::GetInstance()->output_configurator()->ScheduleConfigureOutputs();
+#endif
+}
+
void DisplayManager::RegisterDisplayProperty(
int64 display_id,
gfx::Display::Rotation rotation,
float ui_scale,
- const gfx::Insets* overscan_insets) {
+ const gfx::Insets* overscan_insets,
+ const gfx::Size& resolution_in_pixel) {
Daniel Erat 2013/07/31 17:34:05 s/pixel/pixels/ (to match header)
oshima 2013/07/31 21:59:49 Done.
if (display_info_.find(display_id) == display_info_.end()) {
display_info_[display_id] =
DisplayInfo(display_id, std::string(""), false);
@@ -337,6 +350,19 @@ void DisplayManager::RegisterDisplayProperty(
display_info_[display_id].set_ui_scale(ui_scale);
if (overscan_insets)
display_info_[display_id].SetOverscanInsets(*overscan_insets);
+ if (!resolution_in_pixel.IsEmpty())
+ resolutions_[display_id] = resolution_in_pixel;
+}
+
+bool DisplayManager::GetSelectedResolutionForDisplayId(
+ int64 id,
+ gfx::Size* resolution_out) const {
+ std::map<int64, gfx::Size>::const_iterator iter =
+ resolutions_.find(id);
+ if (iter == resolutions_.end())
+ return false;
+ *resolution_out = iter->second;
+ return true;
}
bool DisplayManager::IsDisplayRotationEnabled() const {

Powered by Google App Engine
This is Rietveld 408576698