| Index: ui/display/chromeos/display_util.cc
 | 
| diff --git a/ui/display/chromeos/display_util.cc b/ui/display/chromeos/display_util.cc
 | 
| new file mode 100644
 | 
| index 0000000000000000000000000000000000000000..a481d0c52570d7fee15204eede6a84252e24ff44
 | 
| --- /dev/null
 | 
| +++ b/ui/display/chromeos/display_util.cc
 | 
| @@ -0,0 +1,40 @@
 | 
| +// Copyright 2014 The Chromium Authors. All rights reserved.
 | 
| +// Use of this source code is governed by a BSD-style license that can be
 | 
| +// found in the LICENSE file.
 | 
| +
 | 
| +#include "ui/display/chromeos/display_util.h"
 | 
| +
 | 
| +#include "base/macros.h"
 | 
| +
 | 
| +namespace ui {
 | 
| +
 | 
| +namespace {
 | 
| +
 | 
| +struct OutputTypeMapping {
 | 
| +  // Prefix of output name.
 | 
| +  std::string name;
 | 
| +  OutputType type;
 | 
| +};
 | 
| +
 | 
| +const OutputTypeMapping kOutputTypeMapping[] = {
 | 
| +    {"LVDS", OUTPUT_TYPE_INTERNAL},
 | 
| +    {"eDP", OUTPUT_TYPE_INTERNAL},
 | 
| +    {"DSI", OUTPUT_TYPE_INTERNAL},
 | 
| +    {"VGA", OUTPUT_TYPE_VGA},
 | 
| +    {"HDMI", OUTPUT_TYPE_HDMI},
 | 
| +    {"DVI", OUTPUT_TYPE_DVI},
 | 
| +    {"DP", OUTPUT_TYPE_DISPLAYPORT}};
 | 
| +
 | 
| +}  // namespace
 | 
| +
 | 
| +OutputType GetOutputTypeFromName(const std::string& name) {
 | 
| +  for (unsigned int i = 0; i < arraysize(kOutputTypeMapping); ++i) {
 | 
| +    if (name.find(kOutputTypeMapping[i].name) == 0) {
 | 
| +      return kOutputTypeMapping[i].type;
 | 
| +    }
 | 
| +  }
 | 
| +
 | 
| +  return OUTPUT_TYPE_UNKNOWN;
 | 
| +}
 | 
| +
 | 
| +}  // namespace ui
 | 
| 
 |