| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/autofill/new_credit_card_bubble_controller.h" | 5 #include "chrome/browser/ui/autofill/new_credit_card_bubble_controller.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 billing_profile_ = billing_profile.Pass(); | 105 billing_profile_ = billing_profile.Pass(); |
| 106 | 106 |
| 107 const base::string16 card_number = | 107 const base::string16 card_number = |
| 108 new_card_->GetRawInfo(CREDIT_CARD_NUMBER); | 108 new_card_->GetRawInfo(CREDIT_CARD_NUMBER); |
| 109 ui::ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 109 ui::ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 110 card_desc_.icon = rb.GetImageNamed( | 110 card_desc_.icon = rb.GetImageNamed( |
| 111 CreditCard::IconResourceId(CreditCard::GetCreditCardType(card_number))); | 111 CreditCard::IconResourceId(CreditCard::GetCreditCardType(card_number))); |
| 112 card_desc_.name = new_card_->TypeAndLastFourDigits(); | 112 card_desc_.name = new_card_->TypeAndLastFourDigits(); |
| 113 | 113 |
| 114 AutofillProfileWrapper wrapper(billing_profile_.get(), 0); | 114 AutofillProfileWrapper wrapper(billing_profile_.get(), 0); |
| 115 card_desc_.description = wrapper.GetDisplayText(); | 115 base::string16 unused; |
| 116 wrapper.GetDisplayText(&card_desc_.description, &unused); |
| 116 | 117 |
| 117 bubble_ = CreateBubble(); | 118 bubble_ = CreateBubble(); |
| 118 if (!bubble_) { | 119 if (!bubble_) { |
| 119 // TODO(dbeam): Make a bubble on all applicable platforms. | 120 // TODO(dbeam): Make a bubble on all applicable platforms. |
| 120 delete this; | 121 delete this; |
| 121 return; | 122 return; |
| 122 } | 123 } |
| 123 | 124 |
| 124 bubble_->Show(); | 125 bubble_->Show(); |
| 125 } | 126 } |
| 126 | 127 |
| 127 void NewCreditCardBubbleController::Hide() { | 128 void NewCreditCardBubbleController::Hide() { |
| 128 if (bubble_) | 129 if (bubble_) |
| 129 bubble_->Hide(); | 130 bubble_->Hide(); |
| 130 } | 131 } |
| 131 | 132 |
| 132 } // namespace autofill | 133 } // namespace autofill |
| OLD | NEW |