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

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

Issue 2540313002: Split //ui/display and create //ui/display/manager. (Closed)
Patch Set: Cleanup export header. Created 4 years 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
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/x11/display_util_x11.h"
6
7 #include "base/macros.h"
8 #include "base/strings/string_util.h"
9
10 namespace ui {
11
12 namespace {
13
14 struct DisplayConnectionTypeMapping {
15 // Prefix of output name.
16 const char* name;
17 DisplayConnectionType type;
18 };
19
20 const DisplayConnectionTypeMapping kDisplayConnectionTypeMapping[] = {
21 {"LVDS", DISPLAY_CONNECTION_TYPE_INTERNAL},
22 {"eDP", DISPLAY_CONNECTION_TYPE_INTERNAL},
23 {"DSI", DISPLAY_CONNECTION_TYPE_INTERNAL},
24 {"VGA", DISPLAY_CONNECTION_TYPE_VGA},
25 {"HDMI", DISPLAY_CONNECTION_TYPE_HDMI},
26 {"DVI", DISPLAY_CONNECTION_TYPE_DVI},
27 {"DP", DISPLAY_CONNECTION_TYPE_DISPLAYPORT}};
28
29 } // namespace
30
31 DisplayConnectionType GetDisplayConnectionTypeFromName(
32 const std::string& name) {
33 for (unsigned int i = 0; i < arraysize(kDisplayConnectionTypeMapping); ++i) {
34 if (base::StartsWith(name, kDisplayConnectionTypeMapping[i].name,
35 base::CompareCase::SENSITIVE)) {
36 return kDisplayConnectionTypeMapping[i].type;
37 }
38 }
39
40 return DISPLAY_CONNECTION_TYPE_UNKNOWN;
41 }
42
43 } // namespace ui
OLDNEW
« no previous file with comments | « ui/display/chromeos/x11/display_util_x11.h ('k') | ui/display/chromeos/x11/display_util_x11_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698