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