| OLD | NEW |
| (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 |
| OLD | NEW |