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

Side by Side Diff: chrome/browser/ui/views/payments/payment_request_views_util.cc

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)
Patch Set: fix comments Created 3 years, 10 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 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 "chrome/browser/ui/views/payments/payment_request_views_util.h" 5 #include "chrome/browser/ui/views/payments/payment_request_views_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 84
85 std::unique_ptr<views::View> CreatePaymentView( 85 std::unique_ptr<views::View> CreatePaymentView(
86 std::unique_ptr<views::View> header_view, 86 std::unique_ptr<views::View> header_view,
87 std::unique_ptr<views::View> content_view) { 87 std::unique_ptr<views::View> content_view) {
88 std::unique_ptr<views::View> view = base::MakeUnique<views::View>(); 88 std::unique_ptr<views::View> view = base::MakeUnique<views::View>();
89 view->set_background(views::Background::CreateSolidBackground(SK_ColorWHITE)); 89 view->set_background(views::Background::CreateSolidBackground(SK_ColorWHITE));
90 90
91 // Paint the sheets to layers, otherwise the MD buttons (which do paint to a 91 // Paint the sheets to layers, otherwise the MD buttons (which do paint to a
92 // layer) won't do proper clipping. 92 // layer) won't do proper clipping.
93 view->SetPaintToLayer(true); 93 view->SetPaintToLayer();
94 94
95 views::GridLayout* layout = new views::GridLayout(view.get()); 95 views::GridLayout* layout = new views::GridLayout(view.get());
96 view->SetLayoutManager(layout); 96 view->SetLayoutManager(layout);
97 97
98 constexpr int kTopInsetSize = 9; 98 constexpr int kTopInsetSize = 9;
99 constexpr int kBottomInsetSize = 18; 99 constexpr int kBottomInsetSize = 18;
100 constexpr int kSideInsetSize = 14; 100 constexpr int kSideInsetSize = 14;
101 layout->SetInsets( 101 layout->SetInsets(
102 kTopInsetSize, kSideInsetSize, kBottomInsetSize, kSideInsetSize); 102 kTopInsetSize, kSideInsetSize, kBottomInsetSize, kSideInsetSize);
103 views::ColumnSet* columns = layout->AddColumnSet(0); 103 views::ColumnSet* columns = layout->AddColumnSet(0);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if (!phone_value.empty()) 175 if (!phone_value.empty())
176 values.push_back(phone_value); 176 values.push_back(phone_value);
177 if (!email_value.empty()) 177 if (!email_value.empty())
178 values.push_back(email_value); 178 values.push_back(email_value);
179 179
180 return base::MakeUnique<views::StyledLabel>( 180 return base::MakeUnique<views::StyledLabel>(
181 base::JoinString(values, base::ASCIIToUTF16("\n")), nullptr); 181 base::JoinString(values, base::ASCIIToUTF16("\n")), nullptr);
182 } 182 }
183 183
184 } // namespace payments 184 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698