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

Side by Side Diff: ui/display/chromeos/x11/display_util.cc

Issue 187073002: Refactoring display configuration state to allow generic state objects (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium 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 "ui/display/chromeos/x11/display_util.h" 5 #include "ui/display/chromeos/x11/display_util.h"
6 6
7 #include <X11/extensions/Xrandr.h> 7 #include <X11/extensions/Xrandr.h>
8 #include <X11/Xatom.h> 8 #include <X11/Xatom.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 OutputType GetOutputTypeFromName(const std::string& name) { 55 OutputType GetOutputTypeFromName(const std::string& name) {
56 for (unsigned int i = 0; i < arraysize(kOutputTypeMapping); ++i) { 56 for (unsigned int i = 0; i < arraysize(kOutputTypeMapping); ++i) {
57 if (name.find(kOutputTypeMapping[i].name) == 0) { 57 if (name.find(kOutputTypeMapping[i].name) == 0) {
58 return kOutputTypeMapping[i].type; 58 return kOutputTypeMapping[i].type;
59 } 59 }
60 } 60 }
61 61
62 return OUTPUT_TYPE_UNKNOWN; 62 return OUTPUT_TYPE_UNKNOWN;
63 } 63 }
64 64
65 std::string GetDisplayName(const OutputConfigurator::OutputSnapshot& output) { 65 std::string GetDisplayName(RROutput output) {
66 std::string display_name; 66 std::string display_name;
67 GetOutputDeviceData(output.output, NULL, &display_name); 67 GetOutputDeviceData(output, NULL, &display_name);
68 return display_name; 68 return display_name;
69 } 69 }
70 70
71 bool GetOutputOverscanFlag(const OutputConfigurator::OutputSnapshot& output, 71 bool GetOutputOverscanFlag(RROutput output, bool* flag) {
72 bool* flag) {
73 unsigned long nitems = 0; 72 unsigned long nitems = 0;
74 unsigned char* prop = NULL; 73 unsigned char* prop = NULL;
75 if (!base::GetEDIDProperty(output.output, &nitems, &prop)) 74 if (!base::GetEDIDProperty(output, &nitems, &prop))
76 return false; 75 return false;
77 76
78 bool found = ParseOutputOverscanFlag(prop, nitems, flag); 77 bool found = ParseOutputOverscanFlag(prop, nitems, flag);
79 XFree(prop); 78 XFree(prop);
80 return found; 79 return found;
81 } 80 }
82 81
83 bool ParseOutputOverscanFlag(const unsigned char* prop, 82 bool ParseOutputOverscanFlag(const unsigned char* prop,
84 unsigned long nitems, 83 unsigned long nitems,
85 bool* flag) { 84 bool* flag) {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 *flag = false; 152 *flag = false;
154 } 153 }
155 return true; 154 return true;
156 } 155 }
157 } 156 }
158 157
159 return false; 158 return false;
160 } 159 }
161 160
162 } // namespace ui 161 } // namespace ui
OLDNEW
« no previous file with comments | « ui/display/chromeos/x11/display_util.h ('k') | ui/display/chromeos/x11/native_display_delegate_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698