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

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

Issue 2668063003: [Web Payments] Add Cancel button to all sheets (Closed)
Patch Set: Rebase 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/order_summary_view_controller.h" 5 #include "chrome/browser/ui/views/payments/order_summary_view_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 IDS_PAYMENT_REQUEST_ORDER_SUMMARY_SHEET_TOTAL_FORMAT, 124 IDS_PAYMENT_REQUEST_ORDER_SUMMARY_SHEET_TOTAL_FORMAT,
125 base::UTF8ToUTF16(request()->details()->total->amount->currency), 125 base::UTF8ToUTF16(request()->details()->total->amount->currency),
126 formatter->Format(request()->details()->total->amount->value)); 126 formatter->Format(request()->details()->total->amount->value));
127 127
128 content_view->AddChildView( 128 content_view->AddChildView(
129 CreateLineItemView(base::UTF8ToUTF16(request()->details()->total->label), 129 CreateLineItemView(base::UTF8ToUTF16(request()->details()->total->label),
130 total_label_value, true, 130 total_label_value, true,
131 DialogViewID::ORDER_SUMMARY_TOTAL_AMOUNT_LABEL) 131 DialogViewID::ORDER_SUMMARY_TOTAL_AMOUNT_LABEL)
132 .release()); 132 .release());
133 133
134 return payments::CreatePaymentView( 134 return CreatePaymentView(
135 CreateSheetHeaderView( 135 CreateSheetHeaderView(
136 true, 136 true,
137 l10n_util::GetStringUTF16(IDS_PAYMENT_REQUEST_ORDER_SUMMARY_TITLE), 137 l10n_util::GetStringUTF16(IDS_PAYMENT_REQUEST_ORDER_SUMMARY_TITLE),
138 this), 138 this),
139 std::move(content_view)); 139 std::move(content_view));
140 } 140 }
141 141
142 void OrderSummaryViewController::ButtonPressed(
143 views::Button* sender, const ui::Event& event) {
144 switch (sender->tag()) {
145 case static_cast<int>(PaymentRequestCommonTags::CLOSE_BUTTON_TAG):
146 dialog()->CloseDialog();
147 break;
148 case static_cast<int>(PaymentRequestCommonTags::BACK_BUTTON_TAG):
149 dialog()->GoBack();
150 break;
151 default:
152 NOTREACHED();
153 }
154 }
155
156 } // namespace payments 142 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698