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

Side by Side Diff: chrome/browser/ui/views/autofill/save_card_bubble_views.cc

Issue 2844463004: Rename card 'type' into 'issuer network.' (Closed)
Patch Set: read -> use Created 3 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/autofill/save_card_bubble_views.h" 5 #include "chrome/browser/ui/views/autofill/save_card_bubble_views.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <memory>
8 9
9 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
10 #include "build/build_config.h" 11 #include "build/build_config.h"
11 #include "chrome/browser/ui/browser_dialogs.h" 12 #include "chrome/browser/ui/browser_dialogs.h"
12 #include "chrome/browser/ui/views/autofill/view_util.h" 13 #include "chrome/browser/ui/views/autofill/view_util.h"
13 #include "components/autofill/core/browser/credit_card.h" 14 #include "components/autofill/core/browser/credit_card.h"
14 #include "components/autofill/core/browser/legal_message_line.h" 15 #include "components/autofill/core/browser/legal_message_line.h"
15 #include "components/autofill/core/browser/ui/save_card_bubble_controller.h" 16 #include "components/autofill/core/browser/ui/save_card_bubble_controller.h"
16 #include "components/strings/grit/components_strings.h" 17 #include "components/strings/grit/components_strings.h"
17 #include "ui/base/l10n/l10n_util.h" 18 #include "ui/base/l10n/l10n_util.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // Add the card type icon, last four digits and expiration date. 189 // Add the card type icon, last four digits and expiration date.
189 views::View* description_view = new views::View(); 190 views::View* description_view = new views::View();
190 description_view->SetLayoutManager(new views::BoxLayout( 191 description_view->SetLayoutManager(new views::BoxLayout(
191 views::BoxLayout::kHorizontal, 0, 0, views::kRelatedButtonHSpacing)); 192 views::BoxLayout::kHorizontal, 0, 0, views::kRelatedButtonHSpacing));
192 view->AddChildView(description_view); 193 view->AddChildView(description_view);
193 194
194 const CreditCard& card = controller_->GetCard(); 195 const CreditCard& card = controller_->GetCard();
195 views::ImageView* card_type_icon = new views::ImageView(); 196 views::ImageView* card_type_icon = new views::ImageView();
196 card_type_icon->SetImage( 197 card_type_icon->SetImage(
197 ResourceBundle::GetSharedInstance() 198 ResourceBundle::GetSharedInstance()
198 .GetImageNamed(CreditCard::IconResourceId(card.type())) 199 .GetImageNamed(CreditCard::IconResourceId(card.network()))
199 .AsImageSkia()); 200 .AsImageSkia());
200 card_type_icon->SetTooltipText(card.TypeForDisplay()); 201 card_type_icon->SetTooltipText(card.NetworkForDisplay());
201 card_type_icon->SetBorder( 202 card_type_icon->SetBorder(
202 views::CreateSolidBorder(1, SkColorSetA(SK_ColorBLACK, 10))); 203 views::CreateSolidBorder(1, SkColorSetA(SK_ColorBLACK, 10)));
203 description_view->AddChildView(card_type_icon); 204 description_view->AddChildView(card_type_icon);
204 205
205 description_view->AddChildView(new views::Label( 206 description_view->AddChildView(new views::Label(
206 base::string16(kMidlineEllipsis) + card.LastFourDigits())); 207 base::string16(kMidlineEllipsis) + card.LastFourDigits()));
207 description_view->AddChildView( 208 description_view->AddChildView(
208 new views::Label(card.AbbreviatedExpirationDateForDisplay())); 209 new views::Label(card.AbbreviatedExpirationDateForDisplay()));
209 210
210 // Optionally add CVC request field if CVC was missing. 211 // Optionally add CVC request field if CVC was missing.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 DCHECK_EQ(cvc_textfield_, sender); 259 DCHECK_EQ(cvc_textfield_, sender);
259 GetDialogClientView()->UpdateDialogButtons(); 260 GetDialogClientView()->UpdateDialogButtons();
260 } 261 }
261 262
262 void SaveCardBubbleViews::Init() { 263 void SaveCardBubbleViews::Init() {
263 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); 264 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
264 AddChildView(CreateMainContentView().release()); 265 AddChildView(CreateMainContentView().release());
265 } 266 }
266 267
267 } // namespace autofill 268 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698