| 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 case wallet::WalletItems::MaskedInstrument::BILLING_INCOMPLETE: | 294 case wallet::WalletItems::MaskedInstrument::BILLING_INCOMPLETE: |
| 295 return true; | 295 return true; |
| 296 default: | 296 default: |
| 297 return false; | 297 return false; |
| 298 } | 298 } |
| 299 } | 299 } |
| 300 | 300 |
| 301 // Signals that the user has opted in to geolocation services. Factored out | 301 // Signals that the user has opted in to geolocation services. Factored out |
| 302 // into a separate method because all interaction with the geolocation provider | 302 // into a separate method because all interaction with the geolocation provider |
| 303 // needs to happen on the IO thread, which is not the thread | 303 // needs to happen on the IO thread, which is not the thread |
| 304 // AutofillDialogController lives on. | 304 // AutofillDialogViewDelegate lives on. |
| 305 void UserDidOptIntoLocationServices() { | 305 void UserDidOptIntoLocationServices() { |
| 306 content::GeolocationProvider::GetInstance()->UserDidOptIntoLocationServices(); | 306 content::GeolocationProvider::GetInstance()->UserDidOptIntoLocationServices(); |
| 307 } | 307 } |
| 308 | 308 |
| 309 // Returns whether |data_model| is complete, i.e. can fill out all the | 309 // Returns whether |data_model| is complete, i.e. can fill out all the |
| 310 // |requested_fields|, and verified, i.e. not just automatically aggregated. | 310 // |requested_fields|, and verified, i.e. not just automatically aggregated. |
| 311 // Incomplete or unverifed data will not be displayed in the dropdown menu. | 311 // Incomplete or unverifed data will not be displayed in the dropdown menu. |
| 312 bool HasCompleteAndVerifiedData(const AutofillDataModel& data_model, | 312 bool HasCompleteAndVerifiedData(const AutofillDataModel& data_model, |
| 313 const DetailInputs& requested_fields) { | 313 const DetailInputs& requested_fields) { |
| 314 if (!data_model.IsVerified()) | 314 if (!data_model.IsVerified()) |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 SK_ColorWHITE, | 441 SK_ColorWHITE, |
| 442 display_rect, 0, 0, shadows); | 442 display_rect, 0, 0, shadows); |
| 443 #endif | 443 #endif |
| 444 | 444 |
| 445 gfx::ImageSkia skia(canvas.ExtractImageRep()); | 445 gfx::ImageSkia skia(canvas.ExtractImageRep()); |
| 446 return gfx::Image(skia); | 446 return gfx::Image(skia); |
| 447 } | 447 } |
| 448 | 448 |
| 449 } // namespace | 449 } // namespace |
| 450 | 450 |
| 451 AutofillDialogController::~AutofillDialogController() {} | 451 AutofillDialogViewDelegate::~AutofillDialogViewDelegate() {} |
| 452 | 452 |
| 453 AutofillDialogControllerImpl::~AutofillDialogControllerImpl() { | 453 AutofillDialogControllerImpl::~AutofillDialogControllerImpl() { |
| 454 if (popup_controller_) | 454 if (popup_controller_) |
| 455 popup_controller_->Hide(); | 455 popup_controller_->Hide(); |
| 456 | 456 |
| 457 GetMetricLogger().LogDialogInitialUserState( | 457 GetMetricLogger().LogDialogInitialUserState( |
| 458 GetDialogType(), initial_user_state_); | 458 GetDialogType(), initial_user_state_); |
| 459 | 459 |
| 460 if (deemphasized_render_view_) { | 460 if (deemphasized_render_view_) { |
| 461 web_contents()->GetRenderViewHost()->Send( | 461 web_contents()->GetRenderViewHost()->Send( |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 std::vector<DialogAutocheckoutStep> | 710 std::vector<DialogAutocheckoutStep> |
| 711 AutofillDialogControllerImpl::CurrentAutocheckoutSteps() const { | 711 AutofillDialogControllerImpl::CurrentAutocheckoutSteps() const { |
| 712 if (autocheckout_state_ != AUTOCHECKOUT_NOT_STARTED) | 712 if (autocheckout_state_ != AUTOCHECKOUT_NOT_STARTED) |
| 713 return steps_; | 713 return steps_; |
| 714 | 714 |
| 715 std::vector<DialogAutocheckoutStep> empty_steps; | 715 std::vector<DialogAutocheckoutStep> empty_steps; |
| 716 return empty_steps; | 716 return empty_steps; |
| 717 } | 717 } |
| 718 | 718 |
| 719 //////////////////////////////////////////////////////////////////////////////// | 719 //////////////////////////////////////////////////////////////////////////////// |
| 720 // AutofillDialogController implementation. | 720 // AutofillDialogViewDelegate implementation. |
| 721 | 721 |
| 722 string16 AutofillDialogControllerImpl::DialogTitle() const { | 722 string16 AutofillDialogControllerImpl::DialogTitle() const { |
| 723 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_TITLE); | 723 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_TITLE); |
| 724 } | 724 } |
| 725 | 725 |
| 726 string16 AutofillDialogControllerImpl::EditSuggestionText() const { | 726 string16 AutofillDialogControllerImpl::EditSuggestionText() const { |
| 727 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_EDIT); | 727 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_EDIT); |
| 728 } | 728 } |
| 729 | 729 |
| 730 string16 AutofillDialogControllerImpl::CancelButtonText() const { | 730 string16 AutofillDialogControllerImpl::CancelButtonText() const { |
| (...skipping 2738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3469 view_->GetUserInput(SECTION_CC_BILLING, &output); | 3469 view_->GetUserInput(SECTION_CC_BILLING, &output); |
| 3470 CreditCard card; | 3470 CreditCard card; |
| 3471 GetBillingInfoFromOutputs(output, &card, NULL, NULL); | 3471 GetBillingInfoFromOutputs(output, &card, NULL, NULL); |
| 3472 backing_last_four = card.TypeAndLastFourDigits(); | 3472 backing_last_four = card.TypeAndLastFourDigits(); |
| 3473 } | 3473 } |
| 3474 AutofillCreditCardBubbleController::ShowGeneratedCardUI( | 3474 AutofillCreditCardBubbleController::ShowGeneratedCardUI( |
| 3475 web_contents(), backing_last_four, full_wallet_->TypeAndLastFourDigits()); | 3475 web_contents(), backing_last_four, full_wallet_->TypeAndLastFourDigits()); |
| 3476 } | 3476 } |
| 3477 | 3477 |
| 3478 } // namespace autofill | 3478 } // namespace autofill |
| OLD | NEW |