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

Side by Side 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: Initial 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_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>
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 autofill::AutofillType(autofill::CREDIT_CARD_NAME_FULL), 326 autofill::AutofillType(autofill::CREDIT_CARD_NAME_FULL),
327 g_browser_process->GetApplicationLocale()))); 327 g_browser_process->GetApplicationLocale())));
328 328
329 card_icon_view = base::MakeUnique<views::ImageView>(); 329 card_icon_view = base::MakeUnique<views::ImageView>();
330 card_icon_view->set_interactive(false); 330 card_icon_view->set_interactive(false);
331 card_icon_view->SetImage( 331 card_icon_view->SetImage(
332 ResourceBundle::GetSharedInstance() 332 ResourceBundle::GetSharedInstance()
333 .GetImageNamed(autofill::data_util::GetPaymentRequestData( 333 .GetImageNamed(autofill::data_util::GetPaymentRequestData(
334 selected_card->type()).icon_resource_id) 334 selected_card->type()).icon_resource_id)
335 .AsImageSkia()); 335 .AsImageSkia());
336 card_icon_view->SetTooltipText(
337 autofill::CreditCard::TypeForDisplay(selected_card->type()));
336 card_icon_view->SetBorder( 338 card_icon_view->SetBorder(
337 views::CreateRoundedRectBorder(1, 3, SK_ColorLTGRAY)); 339 views::CreateRoundedRectBorder(1, 3, SK_ColorLTGRAY));
338 340
339 constexpr gfx::Size kCardIconSize = gfx::Size(32, 20); 341 constexpr gfx::Size kCardIconSize = gfx::Size(32, 20);
340 card_icon_view->SetImageSize(kCardIconSize); 342 card_icon_view->SetImageSize(kCardIconSize);
341 } 343 }
342 344
343 std::unique_ptr<views::Button> section = CreatePaymentSheetRow( 345 std::unique_ptr<views::Button> section = CreatePaymentSheetRow(
344 this, 346 this,
345 l10n_util::GetStringUTF16( 347 l10n_util::GetStringUTF16(
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 CreateContactInfoSectionContent(), std::unique_ptr<views::View>(nullptr), 381 CreateContactInfoSectionContent(), std::unique_ptr<views::View>(nullptr),
380 widest_name_column_view_width_); 382 widest_name_column_view_width_);
381 section->set_tag(static_cast<int>( 383 section->set_tag(static_cast<int>(
382 PaymentSheetViewControllerTags::SHOW_CONTACT_INFO_BUTTON)); 384 PaymentSheetViewControllerTags::SHOW_CONTACT_INFO_BUTTON));
383 section->set_id( 385 section->set_id(
384 static_cast<int>(DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION)); 386 static_cast<int>(DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION));
385 return section; 387 return section;
386 } 388 }
387 389
388 } // namespace payments 390 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698