| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 std::vector<DialogAutocheckoutStep> | 712 std::vector<DialogAutocheckoutStep> |
| 713 AutofillDialogControllerImpl::CurrentAutocheckoutSteps() const { | 713 AutofillDialogControllerImpl::CurrentAutocheckoutSteps() const { |
| 714 if (autocheckout_state_ != AUTOCHECKOUT_NOT_STARTED) | 714 if (autocheckout_state_ != AUTOCHECKOUT_NOT_STARTED) |
| 715 return steps_; | 715 return steps_; |
| 716 | 716 |
| 717 std::vector<DialogAutocheckoutStep> empty_steps; | 717 std::vector<DialogAutocheckoutStep> empty_steps; |
| 718 return empty_steps; | 718 return empty_steps; |
| 719 } | 719 } |
| 720 | 720 |
| 721 //////////////////////////////////////////////////////////////////////////////// | 721 //////////////////////////////////////////////////////////////////////////////// |
| 722 // AutofillDialogController implementation. | 722 // AutofillDialogViewDelegate implementation. |
| 723 | 723 |
| 724 string16 AutofillDialogControllerImpl::DialogTitle() const { | 724 string16 AutofillDialogControllerImpl::DialogTitle() const { |
| 725 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_TITLE); | 725 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_TITLE); |
| 726 } | 726 } |
| 727 | 727 |
| 728 string16 AutofillDialogControllerImpl::EditSuggestionText() const { | 728 string16 AutofillDialogControllerImpl::EditSuggestionText() const { |
| 729 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_EDIT); | 729 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_EDIT); |
| 730 } | 730 } |
| 731 | 731 |
| 732 string16 AutofillDialogControllerImpl::CancelButtonText() const { | 732 string16 AutofillDialogControllerImpl::CancelButtonText() const { |
| (...skipping 2735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3468 view_->GetUserInput(SECTION_CC_BILLING, &output); | 3468 view_->GetUserInput(SECTION_CC_BILLING, &output); |
| 3469 CreditCard card; | 3469 CreditCard card; |
| 3470 GetBillingInfoFromOutputs(output, &card, NULL, NULL); | 3470 GetBillingInfoFromOutputs(output, &card, NULL, NULL); |
| 3471 backing_last_four = card.TypeAndLastFourDigits(); | 3471 backing_last_four = card.TypeAndLastFourDigits(); |
| 3472 } | 3472 } |
| 3473 AutofillCreditCardBubbleController::ShowGeneratedCardUI( | 3473 AutofillCreditCardBubbleController::ShowGeneratedCardUI( |
| 3474 web_contents(), backing_last_four, full_wallet_->TypeAndLastFourDigits()); | 3474 web_contents(), backing_last_four, full_wallet_->TypeAndLastFourDigits()); |
| 3475 } | 3475 } |
| 3476 | 3476 |
| 3477 } // namespace autofill | 3477 } // namespace autofill |
| OLD | NEW |