| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/display/display_layout.h" | 5 #include "ui/display/manager/display_layout.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "ash/ash_switches.h" | |
| 11 #include "ash/display/display_pref_util.h" | |
| 12 #include "ash/shell.h" | |
| 13 #include "base/logging.h" | 10 #include "base/logging.h" |
| 14 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 16 #include "base/values.h" | 13 #include "base/values.h" |
| 17 #include "ui/gfx/display.h" | 14 #include "ui/gfx/display.h" |
| 18 | 15 |
| 19 namespace ash { | 16 namespace display { |
| 20 namespace { | 17 namespace { |
| 21 | 18 |
| 22 // DisplayPlacement Positions | 19 // DisplayPlacement Positions |
| 23 const char kTop[] = "top"; | 20 const char kTop[] = "top"; |
| 24 const char kRight[] = "right"; | 21 const char kRight[] = "right"; |
| 25 const char kBottom[] = "bottom"; | 22 const char kBottom[] = "bottom"; |
| 26 const char kLeft[] = "left"; | 23 const char kLeft[] = "left"; |
| 27 const char kUnknown[] = "unknown"; | 24 const char kUnknown[] = "unknown"; |
| 28 | 25 |
| 29 // The maximum value for 'offset' in DisplayLayout in case of outliers. Need | 26 // The maximum value for 'offset' in DisplayLayout in case of outliers. Need |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 DisplayPlacement DisplayLayout::FindPlacementById(int64_t display_id) const { | 246 DisplayPlacement DisplayLayout::FindPlacementById(int64_t display_id) const { |
| 250 const auto iter = | 247 const auto iter = |
| 251 std::find_if(placement_list.begin(), placement_list.end(), | 248 std::find_if(placement_list.begin(), placement_list.end(), |
| 252 [display_id](const DisplayPlacement& placement) { | 249 [display_id](const DisplayPlacement& placement) { |
| 253 return placement.display_id == display_id; | 250 return placement.display_id == display_id; |
| 254 }); | 251 }); |
| 255 return (iter == placement_list.end()) ? DisplayPlacement() | 252 return (iter == placement_list.end()) ? DisplayPlacement() |
| 256 : DisplayPlacement(*iter); | 253 : DisplayPlacement(*iter); |
| 257 } | 254 } |
| 258 | 255 |
| 259 } // namespace ash | 256 } // namespace display |
| OLD | NEW |