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

Side by Side Diff: ui/display/chromeos/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: Fix ordering 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
(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/chromeos/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 } // namespace
29
30 OutputType GetOutputTypeFromName(const std::string& name) {
31 for (unsigned int i = 0; i < arraysize(kOutputTypeMapping); ++i) {
32 if (name.find(kOutputTypeMapping[i].name) == 0) {
33 return kOutputTypeMapping[i].type;
34 }
35 }
36
37 return OUTPUT_TYPE_UNKNOWN;
38 }
39
40 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698