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

Side by Side Diff: ash/system/tray/tray_details_view.cc

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/system/tray/tray_details_view.h" 5 #include "ash/system/tray/tray_details_view.h"
6 6
7 #include "ash/system/tray/fixed_sized_scroll_view.h" 7 #include "ash/system/tray/fixed_sized_scroll_view.h"
8 #include "ash/system/tray/system_tray.h" 8 #include "ash/system/tray/system_tray.h"
9 #include "ash/system/tray/system_tray_item.h" 9 #include "ash/system/tray/system_tray_item.h"
10 #include "ash/system/tray/tray_constants.h" 10 #include "ash/system/tray/tray_constants.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 void TrayDetailsView::CreateScrollableList() { 84 void TrayDetailsView::CreateScrollableList() {
85 DCHECK(!scroller_); 85 DCHECK(!scroller_);
86 scroll_content_ = new views::View; 86 scroll_content_ = new views::View;
87 scroll_content_->SetLayoutManager(new views::BoxLayout( 87 scroll_content_->SetLayoutManager(new views::BoxLayout(
88 views::BoxLayout::kVertical, 0, 0, 1)); 88 views::BoxLayout::kVertical, 0, 0, 1));
89 scroller_ = new FixedSizedScrollView; 89 scroller_ = new FixedSizedScrollView;
90 scroller_->SetContentsView(scroll_content_); 90 scroller_->SetContentsView(scroll_content_);
91 91
92 // Note: |scroller_| takes ownership of |scroll_border_|. 92 // Note: |scroller_| takes ownership of |scroll_border_|.
93 scroll_border_ = new ScrollBorder; 93 scroll_border_ = new ScrollBorder;
94 scroller_->SetBorder(scoped_ptr<views::Border>(scroll_border_)); 94 scroller_->SetBorder(std::unique_ptr<views::Border>(scroll_border_));
95 95
96 AddChildView(scroller_); 96 AddChildView(scroller_);
97 } 97 }
98 98
99 void TrayDetailsView::AddScrollSeparator() { 99 void TrayDetailsView::AddScrollSeparator() {
100 DCHECK(scroll_content_); 100 DCHECK(scroll_content_);
101 // Do not draw the separator if it is the very first item 101 // Do not draw the separator if it is the very first item
102 // in the scrollable list. 102 // in the scrollable list.
103 if (scroll_content_->has_children()) 103 if (scroll_content_->has_children())
104 scroll_content_->AddChildView(new ScrollSeparator); 104 scroll_content_->AddChildView(new ScrollSeparator);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 if (index < child_count() - 1 && child_at(index + 1) != footer_) 155 if (index < child_count() - 1 && child_at(index + 1) != footer_)
156 scroll_border_->set_visible(true); 156 scroll_border_->set_visible(true);
157 else 157 else
158 scroll_border_->set_visible(false); 158 scroll_border_->set_visible(false);
159 } 159 }
160 160
161 views::View::OnPaintBorder(canvas); 161 views::View::OnPaintBorder(canvas);
162 } 162 }
163 163
164 } // namespace ash 164 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698