| OLD | NEW |
| 1 // Copyright 2016 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_builder.h" | 5 #include "ui/display/manager/display_layout_builder.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 namespace ash { | 9 namespace display { |
| 10 | 10 |
| 11 DisplayLayoutBuilder::DisplayLayoutBuilder(const DisplayLayout& layout) | 11 DisplayLayoutBuilder::DisplayLayoutBuilder(const DisplayLayout& layout) |
| 12 : layout_(layout.Copy()) {} | 12 : layout_(layout.Copy()) {} |
| 13 | 13 |
| 14 DisplayLayoutBuilder::DisplayLayoutBuilder(int64_t primary_id) | 14 DisplayLayoutBuilder::DisplayLayoutBuilder(int64_t primary_id) |
| 15 : layout_(new DisplayLayout) { | 15 : layout_(new DisplayLayout) { |
| 16 layout_->primary_id = primary_id; | 16 layout_->primary_id = primary_id; |
| 17 } | 17 } |
| 18 | 18 |
| 19 DisplayLayoutBuilder::~DisplayLayoutBuilder() {} | 19 DisplayLayoutBuilder::~DisplayLayoutBuilder() {} |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 | 59 |
| 60 scoped_ptr<DisplayLayout> DisplayLayoutBuilder::Build() { | 60 scoped_ptr<DisplayLayout> DisplayLayoutBuilder::Build() { |
| 61 std::sort(layout_->placement_list.begin(), layout_->placement_list.end(), | 61 std::sort(layout_->placement_list.begin(), layout_->placement_list.end(), |
| 62 [](const DisplayPlacement& a, const DisplayPlacement& b) { | 62 [](const DisplayPlacement& a, const DisplayPlacement& b) { |
| 63 return a.display_id < b.display_id; | 63 return a.display_id < b.display_id; |
| 64 }); | 64 }); |
| 65 return std::move(layout_); | 65 return std::move(layout_); |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace ash | 68 } // namespace display |
| OLD | NEW |