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

Side by Side Diff: chrome/browser/ui/views/autofill/save_card_bubble_views.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/ui/views/autofill/save_card_bubble_views.h" 5 #include "chrome/browser/ui/views/autofill/save_card_bubble_views.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 14 matching lines...) Expand all
25 #include "ui/views/layout/box_layout.h" 25 #include "ui/views/layout/box_layout.h"
26 #include "ui/views/layout/layout_constants.h" 26 #include "ui/views/layout/layout_constants.h"
27 27
28 namespace autofill { 28 namespace autofill {
29 29
30 namespace { 30 namespace {
31 31
32 // Fixed width of the bubble. 32 // Fixed width of the bubble.
33 const int kBubbleWidth = 395; 33 const int kBubbleWidth = 395;
34 34
35 scoped_ptr<views::StyledLabel> CreateLegalMessageLineLabel( 35 std::unique_ptr<views::StyledLabel> CreateLegalMessageLineLabel(
36 const LegalMessageLine& line, 36 const LegalMessageLine& line,
37 views::StyledLabelListener* listener) { 37 views::StyledLabelListener* listener) {
38 scoped_ptr<views::StyledLabel> label( 38 std::unique_ptr<views::StyledLabel> label(
39 new views::StyledLabel(line.text(), listener)); 39 new views::StyledLabel(line.text(), listener));
40 for (const LegalMessageLine::Link& link : line.links()) { 40 for (const LegalMessageLine::Link& link : line.links()) {
41 label->AddStyleRange(link.range, 41 label->AddStyleRange(link.range,
42 views::StyledLabel::RangeStyleInfo::CreateForLink()); 42 views::StyledLabel::RangeStyleInfo::CreateForLink());
43 } 43 }
44 return label; 44 return label;
45 } 45 }
46 46
47 } // namespace 47 } // namespace
48 48
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 controller_->OnLegalMessageLinkClicked(link.url); 160 controller_->OnLegalMessageLinkClicked(link.url);
161 return; 161 return;
162 } 162 }
163 } 163 }
164 164
165 // |range| was not found. 165 // |range| was not found.
166 NOTREACHED(); 166 NOTREACHED();
167 } 167 }
168 168
169 // Create view containing everything except for the footnote. 169 // Create view containing everything except for the footnote.
170 scoped_ptr<views::View> SaveCardBubbleViews::CreateMainContentView() { 170 std::unique_ptr<views::View> SaveCardBubbleViews::CreateMainContentView() {
171 scoped_ptr<View> view(new View()); 171 std::unique_ptr<View> view(new View());
172 view->SetLayoutManager( 172 view->SetLayoutManager(
173 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 173 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0,
174 views::kUnrelatedControlVerticalSpacing)); 174 views::kUnrelatedControlVerticalSpacing));
175 175
176 // Add the card type icon, last four digits and expiration date. 176 // Add the card type icon, last four digits and expiration date.
177 views::View* description_view = new views::View(); 177 views::View* description_view = new views::View();
178 description_view->SetLayoutManager(new views::BoxLayout( 178 description_view->SetLayoutManager(new views::BoxLayout(
179 views::BoxLayout::kHorizontal, 0, 0, views::kRelatedButtonHSpacing)); 179 views::BoxLayout::kHorizontal, 0, 0, views::kRelatedButtonHSpacing));
180 view->AddChildView(description_view); 180 view->AddChildView(description_view);
181 181
(...skipping 24 matching lines...) Expand all
206 206
207 return view; 207 return view;
208 } 208 }
209 209
210 void SaveCardBubbleViews::Init() { 210 void SaveCardBubbleViews::Init() {
211 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); 211 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
212 AddChildView(CreateMainContentView().release()); 212 AddChildView(CreateMainContentView().release());
213 } 213 }
214 214
215 } // namespace autofill 215 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/autofill/save_card_bubble_views.h ('k') | chrome/browser/ui/views/autofill/tooltip_icon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698