Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Side by Side Diff: ui/display/manager/display_layout.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/display/manager/display_layout.h ('k') | ui/display/manager/display_layout_builder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.h" 5 #include "ui/display/manager/display_layout.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 << placement.ToString(); 224 << placement.ToString();
225 return false; 225 return false;
226 } 226 }
227 has_primary_as_parent |= layout.primary_id == placement.parent_display_id; 227 has_primary_as_parent |= layout.primary_id == placement.parent_display_id;
228 } 228 }
229 if (!has_primary_as_parent) 229 if (!has_primary_as_parent)
230 LOG(ERROR) << "At least, one placement must have the primary as a parent."; 230 LOG(ERROR) << "At least, one placement must have the primary as a parent.";
231 return has_primary_as_parent; 231 return has_primary_as_parent;
232 } 232 }
233 233
234 scoped_ptr<DisplayLayout> DisplayLayout::Copy() const { 234 std::unique_ptr<DisplayLayout> DisplayLayout::Copy() const {
235 scoped_ptr<DisplayLayout> copy(new DisplayLayout); 235 std::unique_ptr<DisplayLayout> copy(new DisplayLayout);
236 for (const auto& placement : placement_list) 236 for (const auto& placement : placement_list)
237 copy->placement_list.push_back(placement); 237 copy->placement_list.push_back(placement);
238 copy->mirrored = mirrored; 238 copy->mirrored = mirrored;
239 copy->default_unified = default_unified; 239 copy->default_unified = default_unified;
240 copy->primary_id = primary_id; 240 copy->primary_id = primary_id;
241 return copy; 241 return copy;
242 } 242 }
243 243
244 bool DisplayLayout::HasSamePlacementList(const DisplayLayout& layout) const { 244 bool DisplayLayout::HasSamePlacementList(const DisplayLayout& layout) const {
245 if (placement_list.size() != layout.placement_list.size()) 245 if (placement_list.size() != layout.placement_list.size())
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 335
336 gfx::Insets insets = target_display->GetWorkAreaInsets(); 336 gfx::Insets insets = target_display->GetWorkAreaInsets();
337 target_display->set_bounds( 337 target_display->set_bounds(
338 gfx::Rect(new_target_origin, target_bounds.size())); 338 gfx::Rect(new_target_origin, target_bounds.size()));
339 target_display->UpdateWorkAreaFromInsets(insets); 339 target_display->UpdateWorkAreaFromInsets(insets);
340 340
341 return old_bounds != target_display->bounds(); 341 return old_bounds != target_display->bounds();
342 } 342 }
343 343
344 } // namespace display 344 } // namespace display
OLDNEW
« no previous file with comments | « ui/display/manager/display_layout.h ('k') | ui/display/manager/display_layout_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698