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

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

Issue 2649683002: [Payments] Improve the closing of the PR dialog. (Closed)
Patch Set: addressed comments from sky Created 3 years, 11 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_sheet_view_controller.h" 5 #include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/memory/ptr_util.h" 12 #include "base/memory/ptr_util.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "chrome/browser/browser_process.h" 15 #include "chrome/browser/browser_process.h"
16 #include "chrome/browser/ui/views/payments/payment_request_dialog.h" 16 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h"
17 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" 17 #include "chrome/browser/ui/views/payments/payment_request_views_util.h"
18 #include "chrome/grit/generated_resources.h" 18 #include "chrome/grit/generated_resources.h"
19 #include "components/autofill/core/browser/autofill_data_util.h" 19 #include "components/autofill/core/browser/autofill_data_util.h"
20 #include "components/autofill/core/browser/autofill_type.h" 20 #include "components/autofill/core/browser/autofill_type.h"
21 #include "components/autofill/core/browser/credit_card.h" 21 #include "components/autofill/core/browser/credit_card.h"
22 #include "components/autofill/core/browser/field_types.h" 22 #include "components/autofill/core/browser/field_types.h"
23 #include "components/autofill/core/browser/personal_data_manager.h" 23 #include "components/autofill/core/browser/personal_data_manager.h"
24 #include "components/payments/currency_formatter.h" 24 #include "components/payments/currency_formatter.h"
25 #include "components/payments/payment_request.h" 25 #include "components/payments/payment_request.h"
26 #include "components/strings/grit/components_strings.h" 26 #include "components/strings/grit/components_strings.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 widest_column_width); 161 widest_column_width);
162 } 162 }
163 163
164 return widest_column_width; 164 return widest_column_width;
165 } 165 }
166 166
167 } // namespace 167 } // namespace
168 168
169 PaymentSheetViewController::PaymentSheetViewController( 169 PaymentSheetViewController::PaymentSheetViewController(
170 PaymentRequest* request, 170 PaymentRequest* request,
171 PaymentRequestDialog* dialog) 171 PaymentRequestDialogView* dialog)
172 : PaymentRequestSheetController(request, dialog), 172 : PaymentRequestSheetController(request, dialog),
173 widest_name_column_view_width_(ComputeWidestNameColumnViewWidth()) {} 173 widest_name_column_view_width_(ComputeWidestNameColumnViewWidth()) {}
174 174
175 PaymentSheetViewController::~PaymentSheetViewController() {} 175 PaymentSheetViewController::~PaymentSheetViewController() {}
176 176
177 std::unique_ptr<views::View> PaymentSheetViewController::CreateView() { 177 std::unique_ptr<views::View> PaymentSheetViewController::CreateView() {
178 std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>(); 178 std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>();
179 179
180 views::GridLayout* layout = new views::GridLayout(content_view.get()); 180 views::GridLayout* layout = new views::GridLayout(content_view.get());
181 content_view->SetLayoutManager(layout); 181 content_view->SetLayoutManager(layout);
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 this, 372 this,
373 l10n_util::GetStringUTF16(IDS_PAYMENT_REQUEST_CONTACT_INFO_SECTION_NAME), 373 l10n_util::GetStringUTF16(IDS_PAYMENT_REQUEST_CONTACT_INFO_SECTION_NAME),
374 CreateContactInfoSectionContent(), std::unique_ptr<views::View>(nullptr), 374 CreateContactInfoSectionContent(), std::unique_ptr<views::View>(nullptr),
375 widest_name_column_view_width_); 375 widest_name_column_view_width_);
376 section->set_tag(static_cast<int>( 376 section->set_tag(static_cast<int>(
377 PaymentSheetViewControllerTags::SHOW_CONTACT_INFO_BUTTON)); 377 PaymentSheetViewControllerTags::SHOW_CONTACT_INFO_BUTTON));
378 return section; 378 return section;
379 } 379 }
380 380
381 } // namespace payments 381 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698