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

Side by Side Diff: ui/display/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: 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
« ui/display/display_util.h ('K') | « ui/display/display_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/display/display_util.h"
6
7 #include "base/macros.h"
8
9 namespace ui {
10
11 namespace {
12
13 struct OutputTypeMapping {
14 // Prefix of output name.
15 std::string name;
16 OutputType type;
17 };
18
19 const OutputTypeMapping kOutputTypeMapping[] = {
20 {"LVDS", OUTPUT_TYPE_INTERNAL},
21 {"eDP", OUTPUT_TYPE_INTERNAL},
22 {"DSI", OUTPUT_TYPE_INTERNAL},
23 {"VGA", OUTPUT_TYPE_VGA},
24 {"HDMI", OUTPUT_TYPE_HDMI},
25 {"DVI", OUTPUT_TYPE_DVI},
26 {"DP", OUTPUT_TYPE_DISPLAYPORT}
27 };
28
29 } // namespace
30
31 OutputType GetOutputTypeFromName(const std::string& name) {
32 for (unsigned int i = 0; i < arraysize(kOutputTypeMapping); ++i) {
33 if (name.find(kOutputTypeMapping[i].name) == 0) {
34 return kOutputTypeMapping[i].type;
35 }
36 }
37
38 return OUTPUT_TYPE_UNKNOWN;
39 }
40
41 } // namespace ui
OLDNEW
« ui/display/display_util.h ('K') | « ui/display/display_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698