| 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/autofill_dialog_controller_impl.h" | 5 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1270 // there's nothing they can do after an error but cancel). | 1270 // there's nothing they can do after an error but cancel). |
| 1271 return autocheckout_state_ == AUTOCHECKOUT_NOT_STARTED; | 1271 return autocheckout_state_ == AUTOCHECKOUT_NOT_STARTED; |
| 1272 } | 1272 } |
| 1273 | 1273 |
| 1274 bool AutofillDialogControllerImpl::ShouldShowProgressBar() const { | 1274 bool AutofillDialogControllerImpl::ShouldShowProgressBar() const { |
| 1275 // Show the progress bar while Autocheckout is running but hide it on errors, | 1275 // Show the progress bar while Autocheckout is running but hide it on errors, |
| 1276 // as there's no use leaving it up if the flow has failed. | 1276 // as there's no use leaving it up if the flow has failed. |
| 1277 return autocheckout_state_ == AUTOCHECKOUT_IN_PROGRESS; | 1277 return autocheckout_state_ == AUTOCHECKOUT_IN_PROGRESS; |
| 1278 } | 1278 } |
| 1279 | 1279 |
| 1280 gfx::Image AutofillDialogControllerImpl::ButtonStripImage() const { |
| 1281 if (ShouldShowDetailArea() && IsPayingWithWallet()) { |
| 1282 return ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
| 1283 IDR_WALLET_LOGO); |
| 1284 } |
| 1285 |
| 1286 return gfx::Image(); |
| 1287 } |
| 1288 |
| 1280 string16 AutofillDialogControllerImpl::LabelForSection(DialogSection section) | 1289 string16 AutofillDialogControllerImpl::LabelForSection(DialogSection section) |
| 1281 const { | 1290 const { |
| 1282 switch (section) { | 1291 switch (section) { |
| 1283 case SECTION_EMAIL: | 1292 case SECTION_EMAIL: |
| 1284 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SECTION_EMAIL); | 1293 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SECTION_EMAIL); |
| 1285 case SECTION_CC: | 1294 case SECTION_CC: |
| 1286 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SECTION_CC); | 1295 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SECTION_CC); |
| 1287 case SECTION_BILLING: | 1296 case SECTION_BILLING: |
| 1288 case SECTION_CC_BILLING: | 1297 case SECTION_CC_BILLING: |
| 1289 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SECTION_BILLING); | 1298 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SECTION_BILLING); |
| (...skipping 2179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3469 view_->GetUserInput(SECTION_CC_BILLING, &output); | 3478 view_->GetUserInput(SECTION_CC_BILLING, &output); |
| 3470 CreditCard card; | 3479 CreditCard card; |
| 3471 GetBillingInfoFromOutputs(output, &card, NULL, NULL); | 3480 GetBillingInfoFromOutputs(output, &card, NULL, NULL); |
| 3472 backing_last_four = card.TypeAndLastFourDigits(); | 3481 backing_last_four = card.TypeAndLastFourDigits(); |
| 3473 } | 3482 } |
| 3474 AutofillCreditCardBubbleController::ShowGeneratedCardUI( | 3483 AutofillCreditCardBubbleController::ShowGeneratedCardUI( |
| 3475 web_contents(), backing_last_four, full_wallet_->TypeAndLastFourDigits()); | 3484 web_contents(), backing_last_four, full_wallet_->TypeAndLastFourDigits()); |
| 3476 } | 3485 } |
| 3477 | 3486 |
| 3478 } // namespace autofill | 3487 } // namespace autofill |
| OLD | NEW |