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 "ui/display/manager/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 display { | 9 namespace display { |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 DisplayLayoutBuilder& DisplayLayoutBuilder::SetSecondaryPlacement( | 51 DisplayLayoutBuilder& DisplayLayoutBuilder::SetSecondaryPlacement( |
52 int64_t secondary_id, | 52 int64_t secondary_id, |
53 DisplayPlacement::Position position, | 53 DisplayPlacement::Position position, |
54 int offset) { | 54 int offset) { |
55 layout_->placement_list.clear(); | 55 layout_->placement_list.clear(); |
56 AddDisplayPlacement(secondary_id, layout_->primary_id, position, offset); | 56 AddDisplayPlacement(secondary_id, layout_->primary_id, position, offset); |
57 return *this; | 57 return *this; |
58 } | 58 } |
59 | 59 |
60 scoped_ptr<DisplayLayout> DisplayLayoutBuilder::Build() { | 60 std::unique_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 display | 68 } // namespace display |
OLD | NEW |