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

Unified Diff: chrome/browser/ui/views/payments/payment_sheet_view_controller.cc

Issue 2698353002: [Payments] Add the "Cards accepted" row at the top of CC editor. (Closed)
Patch Set: addressed 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
diff --git a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
index 9c7db2129b5c0841b47b034ff74b9981ea05413e..421c8dd232012c1cee58d84fddfa0e68d103ede7 100644
--- a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
@@ -29,12 +29,10 @@
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/font.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/range/range.h"
-#include "ui/views/border.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/controls/image_view.h"
@@ -326,18 +324,8 @@ PaymentSheetViewController::CreatePaymentMethodRow() {
autofill::AutofillType(autofill::CREDIT_CARD_NAME_FULL),
g_browser_process->GetApplicationLocale())));
- card_icon_view = base::MakeUnique<views::ImageView>();
- card_icon_view->set_interactive(false);
- card_icon_view->SetImage(
- ResourceBundle::GetSharedInstance()
- .GetImageNamed(autofill::data_util::GetPaymentRequestData(
- selected_card->type()).icon_resource_id)
- .AsImageSkia());
- card_icon_view->SetBorder(
- views::CreateRoundedRectBorder(1, 3, SK_ColorLTGRAY));
-
- constexpr gfx::Size kCardIconSize = gfx::Size(32, 20);
- card_icon_view->SetImageSize(kCardIconSize);
+ card_icon_view = CreateCardIconView(selected_card->type());
+ card_icon_view->SetImageSize(gfx::Size(32, 20));
}
std::unique_ptr<views::Button> section = CreatePaymentSheetRow(

Powered by Google App Engine
This is Rietveld 408576698