| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/browser/autofill/autofill_country.h" | 13 #include "chrome/browser/autofill/autofill_country.h" |
| 14 #include "chrome/browser/autofill/autofill_manager.h" | 14 #include "chrome/browser/autofill/autofill_manager.h" |
| 15 #include "chrome/browser/autofill/autofill_type.h" | 15 #include "chrome/browser/autofill/autofill_type.h" |
| 16 #include "chrome/browser/autofill/personal_data_manager.h" | 16 #include "chrome/browser/autofill/personal_data_manager.h" |
| 17 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 17 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 18 #include "chrome/browser/autofill/validation.h" | 18 #include "chrome/browser/autofill/validation.h" |
| 19 #include "chrome/browser/autofill/wallet/full_wallet.h" | 19 #include "chrome/browser/autofill/wallet/full_wallet.h" |
| 20 #include "chrome/browser/autofill/wallet/wallet_items.h" | 20 #include "chrome/browser/autofill/wallet/wallet_items.h" |
| 21 #include "chrome/browser/autofill/wallet/wallet_service_url.h" | 21 #include "chrome/browser/autofill/wallet/wallet_service_url.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" | 23 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" |
| 24 #include "chrome/browser/ui/browser_finder.h" |
| 25 #include "chrome/browser/ui/browser_navigator.h" |
| 24 #include "chrome/common/form_data.h" | 26 #include "chrome/common/form_data.h" |
| 25 #include "content/public/browser/navigation_controller.h" | 27 #include "content/public/browser/navigation_controller.h" |
| 26 #include "content/public/browser/navigation_details.h" | 28 #include "content/public/browser/navigation_details.h" |
| 27 #include "content/public/browser/navigation_entry.h" | 29 #include "content/public/browser/navigation_entry.h" |
| 28 #include "content/public/browser/notification_service.h" | 30 #include "content/public/browser/notification_service.h" |
| 29 #include "content/public/browser/notification_types.h" | 31 #include "content/public/browser/notification_types.h" |
| 30 #include "content/public/browser/web_contents.h" | 32 #include "content/public/browser/web_contents.h" |
| 31 #include "content/public/common/url_constants.h" | 33 #include "content/public/common/url_constants.h" |
| 32 #include "grit/chromium_strings.h" | 34 #include "grit/chromium_strings.h" |
| 33 #include "grit/generated_resources.h" | 35 #include "grit/generated_resources.h" |
| 34 #include "net/base/cert_status_flags.h" | 36 #include "net/base/cert_status_flags.h" |
| 35 #include "ui/base/l10n/l10n_util.h" | 37 #include "ui/base/l10n/l10n_util.h" |
| 36 #include "ui/base/resource/resource_bundle.h" | 38 #include "ui/base/resource/resource_bundle.h" |
| 39 #include "ui/base/window_open_disposition.h" |
| 37 | 40 |
| 38 namespace autofill { | 41 namespace autofill { |
| 39 | 42 |
| 40 namespace { | 43 namespace { |
| 41 | 44 |
| 42 // Returns true if |input| should be shown when |field| has been requested. | 45 // Returns true if |input| should be shown when |field| has been requested. |
| 43 bool InputTypeMatchesFieldType(const DetailInput& input, | 46 bool InputTypeMatchesFieldType(const DetailInput& input, |
| 44 const AutofillField& field) { | 47 const AutofillField& field) { |
| 45 // If any credit card expiration info is asked for, show both month and year | 48 // If any credit card expiration info is asked for, show both month and year |
| 46 // inputs. | 49 // inputs. |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 } | 231 } |
| 229 | 232 |
| 230 void AutofillDialogControllerImpl::Hide() { | 233 void AutofillDialogControllerImpl::Hide() { |
| 231 if (view_) | 234 if (view_) |
| 232 view_->Hide(); | 235 view_->Hide(); |
| 233 } | 236 } |
| 234 | 237 |
| 235 //////////////////////////////////////////////////////////////////////////////// | 238 //////////////////////////////////////////////////////////////////////////////// |
| 236 // AutofillDialogController implementation. | 239 // AutofillDialogController implementation. |
| 237 | 240 |
| 241 // Strings --------------------------------------------------------------------- |
| 242 |
| 238 string16 AutofillDialogControllerImpl::DialogTitle() const { | 243 string16 AutofillDialogControllerImpl::DialogTitle() const { |
| 239 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_TITLE); | 244 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_TITLE); |
| 240 } | 245 } |
| 241 | 246 |
| 242 string16 AutofillDialogControllerImpl::EditSuggestionText() const { | 247 string16 AutofillDialogControllerImpl::EditSuggestionText() const { |
| 243 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_EDIT); | 248 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_EDIT); |
| 244 } | 249 } |
| 245 | 250 |
| 246 string16 AutofillDialogControllerImpl::UseBillingForShippingText() const { | 251 string16 AutofillDialogControllerImpl::UseBillingForShippingText() const { |
| 247 return l10n_util::GetStringUTF16( | 252 return l10n_util::GetStringUTF16( |
| (...skipping 20 matching lines...) Expand all Loading... |
| 268 | 273 |
| 269 string16 AutofillDialogControllerImpl::SaveLocallyText() const { | 274 string16 AutofillDialogControllerImpl::SaveLocallyText() const { |
| 270 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SAVE_LOCALLY_CHECKBOX); | 275 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SAVE_LOCALLY_CHECKBOX); |
| 271 } | 276 } |
| 272 | 277 |
| 273 string16 AutofillDialogControllerImpl::ProgressBarText() const { | 278 string16 AutofillDialogControllerImpl::ProgressBarText() const { |
| 274 return l10n_util::GetStringUTF16( | 279 return l10n_util::GetStringUTF16( |
| 275 IDS_AUTOFILL_DIALOG_AUTOCHECKOUT_PROGRESS_BAR); | 280 IDS_AUTOFILL_DIALOG_AUTOCHECKOUT_PROGRESS_BAR); |
| 276 } | 281 } |
| 277 | 282 |
| 278 DialogSignedInState AutofillDialogControllerImpl::SignedInState() const { | 283 std::vector<string16> AutofillDialogControllerImpl::FootnoteLinkParts() const { |
| 279 if (!wallet_items_) | 284 if (!wallet_items_ || wallet_items_->legal_documents().empty()) |
| 280 return REQUIRES_RESPONSE; | 285 return std::vector<string16>(); |
| 281 | 286 |
| 282 if (HasRequiredAction(wallet::GAIA_AUTH)) | 287 const std::vector<wallet::WalletItems::LegalDocument*>& documents = |
| 283 return REQUIRES_SIGN_IN; | 288 wallet_items_->legal_documents(); |
| 289 DCHECK_LE(documents.size(), 2U); |
| 284 | 290 |
| 285 if (HasRequiredAction(wallet::PASSIVE_GAIA_AUTH)) | 291 const bool new_user = HasRequiredAction(wallet::SETUP_WALLET); |
| 286 return REQUIRES_PASSIVE_SIGN_IN; | |
| 287 | 292 |
| 288 return SIGNED_IN; | 293 string16 text; |
| 294 switch (documents.size()) { |
| 295 case 1U: |
| 296 text = l10n_util::GetStringFUTF16( |
| 297 new_user ? IDS_AUTOFILL_DIALOG_LEGAL_LINKS_NEW_2 : |
| 298 IDS_AUTOFILL_DIALOG_LEGAL_LINKS_UPDATED_2, |
| 299 documents[0]->display_name(), |
| 300 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_PRIVACY_NOTICE)); |
| 301 break; |
| 302 case 2U: |
| 303 text = l10n_util::GetStringFUTF16( |
| 304 new_user ? IDS_AUTOFILL_DIALOG_LEGAL_LINKS_NEW_3 : |
| 305 IDS_AUTOFILL_DIALOG_LEGAL_LINKS_UPDATED_3, |
| 306 documents[0]->display_name(), |
| 307 documents[1]->display_name(), |
| 308 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_PRIVACY_NOTICE)); |
| 309 break; |
| 310 } |
| 311 TrimWhitespace(text, TRIM_ALL, &text); |
| 312 |
| 313 std::vector<string16> parts; |
| 314 base::SplitStringDontTrim(text, '|', &parts); |
| 315 DCHECK_EQ(1U, parts.size() % 2); |
| 316 |
| 317 return parts; |
| 289 } | 318 } |
| 290 | 319 |
| 291 bool AutofillDialogControllerImpl::CanPayWithWallet() const { | 320 string16 AutofillDialogControllerImpl::AcceptFootnoteLinksText() const { |
| 292 return !had_wallet_error_; | 321 return l10n_util::GetStringUTF16(HasRequiredAction(wallet::SETUP_WALLET) ? |
| 322 IDS_AUTOFILL_DIALOG_ACCEPT_NEW : IDS_AUTOFILL_DIALOG_ACCEPT_UPDATE); |
| 293 } | 323 } |
| 294 | 324 |
| 295 string16 AutofillDialogControllerImpl::AccountChooserText() const { | 325 string16 AutofillDialogControllerImpl::AccountChooserText() const { |
| 296 if (!CanPayWithWallet()) | 326 if (!CanPayWithWallet()) |
| 297 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_PAY_WITHOUT_WALLET); | 327 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_PAY_WITHOUT_WALLET); |
| 298 | 328 |
| 299 // TODO(dbeam): real strings and l10n. | 329 // TODO(dbeam): real strings and l10n. |
| 300 DialogSignedInState state = SignedInState(); | 330 DialogSignedInState state = SignedInState(); |
| 301 return state != SIGNED_IN ? ASCIIToUTF16("Sign in to use Google Wallet") : | 331 return state != SIGNED_IN ? ASCIIToUTF16("Sign in to use Google Wallet") : |
| 302 ASCIIToUTF16("user@example.com"); | 332 ASCIIToUTF16("user@example.com"); |
| 303 } | 333 } |
| 304 | 334 |
| 335 // State ----------------------------------------------------------------------- |
| 336 |
| 305 bool AutofillDialogControllerImpl::AccountChooserEnabled() const { | 337 bool AutofillDialogControllerImpl::AccountChooserEnabled() const { |
| 306 if (!CanPayWithWallet()) | 338 if (!CanPayWithWallet()) |
| 307 return false; | 339 return false; |
| 308 | 340 |
| 309 DialogSignedInState state = SignedInState(); | 341 DialogSignedInState state = SignedInState(); |
| 310 return state != REQUIRES_RESPONSE && state != SIGNED_IN; | 342 return state != REQUIRES_RESPONSE && state != SIGNED_IN; |
| 311 } | 343 } |
| 312 | 344 |
| 345 bool AutofillDialogControllerImpl::CanPayWithWallet() const { |
| 346 return !had_wallet_error_; |
| 347 } |
| 348 |
| 349 DialogNotification AutofillDialogControllerImpl::CurrentNotification() const { |
| 350 if (HasRequiredAction(wallet::VERIFY_CVV)) { |
| 351 return DialogNotification( |
| 352 DialogNotification::REQUIRED_ACTION, |
| 353 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_VERIFY_CVV)); |
| 354 } |
| 355 |
| 356 if (RequestingCreditCardInfo() && !TransmissionWillBeSecure()) { |
| 357 return DialogNotification( |
| 358 DialogNotification::SECURITY_WARNING, |
| 359 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SECURITY_WARNING)); |
| 360 } |
| 361 |
| 362 if (!invoked_from_same_origin_) { |
| 363 return DialogNotification( |
| 364 DialogNotification::SECURITY_WARNING, |
| 365 l10n_util::GetStringFUTF16( |
| 366 IDS_AUTOFILL_DIALOG_SITE_WARNING, UTF8ToUTF16(source_url_.host()))); |
| 367 } |
| 368 |
| 369 if (!CanPayWithWallet()) { |
| 370 // TODO(dbeam): pass along the Wallet error or remove from the translation. |
| 371 return DialogNotification( |
| 372 DialogNotification::WALLET_ERROR, |
| 373 l10n_util::GetStringFUTF16( |
| 374 IDS_AUTOFILL_DIALOG_COMPLETE_WITHOUT_WALLET, |
| 375 ASCIIToUTF16("Oops, [Wallet-Error]."))); |
| 376 } |
| 377 |
| 378 return DialogNotification(); |
| 379 } |
| 380 |
| 381 DialogSignedInState AutofillDialogControllerImpl::SignedInState() const { |
| 382 if (!wallet_items_) |
| 383 return REQUIRES_RESPONSE; |
| 384 |
| 385 if (HasRequiredAction(wallet::GAIA_AUTH)) |
| 386 return REQUIRES_SIGN_IN; |
| 387 |
| 388 if (HasRequiredAction(wallet::PASSIVE_GAIA_AUTH)) |
| 389 return REQUIRES_PASSIVE_SIGN_IN; |
| 390 |
| 391 return SIGNED_IN; |
| 392 } |
| 393 |
| 394 // Detail inputs --------------------------------------------------------------- |
| 395 |
| 313 const DetailInputs& AutofillDialogControllerImpl::RequestedFieldsForSection( | 396 const DetailInputs& AutofillDialogControllerImpl::RequestedFieldsForSection( |
| 314 DialogSection section) const { | 397 DialogSection section) const { |
| 315 switch (section) { | 398 switch (section) { |
| 316 case SECTION_EMAIL: | 399 case SECTION_EMAIL: |
| 317 return requested_email_fields_; | 400 return requested_email_fields_; |
| 318 case SECTION_CC: | 401 case SECTION_CC: |
| 319 return requested_cc_fields_; | 402 return requested_cc_fields_; |
| 320 case SECTION_BILLING: | 403 case SECTION_BILLING: |
| 321 return requested_billing_fields_; | 404 return requested_billing_fields_; |
| 322 case SECTION_SHIPPING: | 405 case SECTION_SHIPPING: |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 popup_labels, | 630 popup_labels, |
| 548 popup_icons, | 631 popup_icons, |
| 549 popup_ids); | 632 popup_ids); |
| 550 section_showing_popup_ = section; | 633 section_showing_popup_ = section; |
| 551 } | 634 } |
| 552 | 635 |
| 553 void AutofillDialogControllerImpl::FocusMoved() { | 636 void AutofillDialogControllerImpl::FocusMoved() { |
| 554 HidePopup(); | 637 HidePopup(); |
| 555 } | 638 } |
| 556 | 639 |
| 640 // Actions --------------------------------------------------------------------- |
| 641 |
| 642 void AutofillDialogControllerImpl::StartSignInFlow() { |
| 643 DCHECK(registrar_.IsEmpty()); |
| 644 |
| 645 content::Source<content::NavigationController> source( |
| 646 &view_->ShowSignIn()); |
| 647 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, source); |
| 648 } |
| 649 |
| 650 void AutofillDialogControllerImpl::EndSignInFlow() { |
| 651 DCHECK(!registrar_.IsEmpty()); |
| 652 registrar_.RemoveAll(); |
| 653 view_->HideSignIn(); |
| 654 } |
| 655 |
| 656 // Accessors ------------------------------------------------------------------- |
| 657 |
| 658 Profile* AutofillDialogControllerImpl::profile() { |
| 659 return profile_; |
| 660 } |
| 661 |
| 662 content::WebContents* AutofillDialogControllerImpl::web_contents() { |
| 663 return contents_; |
| 664 } |
| 665 |
| 666 // Event handlers -------------------------------------------------------------- |
| 667 |
| 668 void AutofillDialogControllerImpl::LegalDocumentLinkClicked(int index) { |
| 669 DCHECK(wallet_items_); |
| 670 DCHECK_GE(index, 0); |
| 671 DCHECK_LE(index, static_cast<int>(wallet_items_->legal_documents().size())); |
| 672 |
| 673 #if defined(OS_ANDROID) |
| 674 // TODO(dbeam): make this work on Android, right now it's not compiling. |
| 675 #else |
| 676 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); |
| 677 GURL url(index == static_cast<int>(wallet_items_->legal_documents().size()) ? |
| 678 GURL(wallet::kPrivacyNoticeUrl) : |
| 679 wallet_items_->legal_documents()[index]->GetUrl()); |
| 680 chrome::NavigateParams params(browser, url, content::PAGE_TRANSITION_LINK); |
| 681 params.disposition = NEW_FOREGROUND_TAB; |
| 682 chrome::Navigate(¶ms); |
| 683 #endif |
| 684 } |
| 685 |
| 557 void AutofillDialogControllerImpl::ViewClosed(DialogAction action) { | 686 void AutofillDialogControllerImpl::ViewClosed(DialogAction action) { |
| 558 if (action == ACTION_SUBMIT) { | 687 if (action == ACTION_SUBMIT) { |
| 559 FillOutputForSection(SECTION_EMAIL); | 688 FillOutputForSection(SECTION_EMAIL); |
| 560 FillOutputForSection(SECTION_CC); | 689 FillOutputForSection(SECTION_CC); |
| 561 FillOutputForSection(SECTION_BILLING); | 690 FillOutputForSection(SECTION_BILLING); |
| 562 if (view_->UseBillingForShipping()) { | 691 if (view_->UseBillingForShipping()) { |
| 563 FillOutputForSectionWithComparator( | 692 FillOutputForSectionWithComparator( |
| 564 SECTION_BILLING, | 693 SECTION_BILLING, |
| 565 base::Bind(DetailInputMatchesShippingField)); | 694 base::Bind(DetailInputMatchesShippingField)); |
| 566 FillOutputForSectionWithComparator( | 695 FillOutputForSectionWithComparator( |
| 567 SECTION_CC, | 696 SECTION_CC, |
| 568 base::Bind(DetailInputMatchesShippingField)); | 697 base::Bind(DetailInputMatchesShippingField)); |
| 569 } else { | 698 } else { |
| 570 FillOutputForSection(SECTION_SHIPPING); | 699 FillOutputForSection(SECTION_SHIPPING); |
| 571 } | 700 } |
| 572 callback_.Run(&form_structure_); | 701 callback_.Run(&form_structure_); |
| 573 } else { | 702 } else { |
| 574 callback_.Run(NULL); | 703 callback_.Run(NULL); |
| 575 } | 704 } |
| 576 | 705 |
| 577 delete this; | 706 delete this; |
| 578 } | 707 } |
| 579 | 708 |
| 580 void AutofillDialogControllerImpl::UpdateProgressBar(double value) { | |
| 581 view_->UpdateProgressBar(value); | |
| 582 } | |
| 583 | |
| 584 DialogNotification AutofillDialogControllerImpl::CurrentNotification() const { | |
| 585 if (HasRequiredAction(wallet::VERIFY_CVV)) { | |
| 586 return DialogNotification( | |
| 587 DialogNotification::REQUIRED_ACTION, | |
| 588 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_VERIFY_CVV)); | |
| 589 } | |
| 590 | |
| 591 if (RequestingCreditCardInfo() && !TransmissionWillBeSecure()) { | |
| 592 return DialogNotification( | |
| 593 DialogNotification::SECURITY_WARNING, | |
| 594 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SECURITY_WARNING)); | |
| 595 } | |
| 596 | |
| 597 if (!invoked_from_same_origin_) { | |
| 598 return DialogNotification( | |
| 599 DialogNotification::SECURITY_WARNING, | |
| 600 l10n_util::GetStringFUTF16( | |
| 601 IDS_AUTOFILL_DIALOG_SITE_WARNING, UTF8ToUTF16(source_url_.host()))); | |
| 602 } | |
| 603 | |
| 604 if (!CanPayWithWallet()) { | |
| 605 // TODO(dbeam): pass along the Wallet error or remove from the translation. | |
| 606 return DialogNotification( | |
| 607 DialogNotification::WALLET_ERROR, | |
| 608 l10n_util::GetStringFUTF16( | |
| 609 IDS_AUTOFILL_DIALOG_COMPLETE_WITHOUT_WALLET, | |
| 610 ASCIIToUTF16("Oops, [Wallet-Error]."))); | |
| 611 } | |
| 612 | |
| 613 return DialogNotification(); | |
| 614 } | |
| 615 | |
| 616 void AutofillDialogControllerImpl::StartSignInFlow() { | |
| 617 DCHECK(registrar_.IsEmpty()); | |
| 618 | |
| 619 content::Source<content::NavigationController> source(&view_->ShowSignIn()); | |
| 620 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, source); | |
| 621 } | |
| 622 | |
| 623 void AutofillDialogControllerImpl::EndSignInFlow() { | |
| 624 DCHECK(!registrar_.IsEmpty()); | |
| 625 registrar_.RemoveAll(); | |
| 626 view_->HideSignIn(); | |
| 627 } | |
| 628 | |
| 629 Profile* AutofillDialogControllerImpl::profile() { | |
| 630 return profile_; | |
| 631 } | |
| 632 | |
| 633 content::WebContents* AutofillDialogControllerImpl::web_contents() { | |
| 634 return contents_; | |
| 635 } | |
| 636 | |
| 637 //////////////////////////////////////////////////////////////////////////////// | 709 //////////////////////////////////////////////////////////////////////////////// |
| 638 // AutofillPopupDelegate | 710 // AutofillPopupDelegate |
| 639 | 711 |
| 640 void AutofillDialogControllerImpl::OnPopupShown( | 712 void AutofillDialogControllerImpl::OnPopupShown( |
| 641 content::KeyboardListener* listener) {} | 713 content::KeyboardListener* listener) {} |
| 642 | 714 |
| 643 void AutofillDialogControllerImpl::OnPopupHidden( | 715 void AutofillDialogControllerImpl::OnPopupHidden( |
| 644 content::KeyboardListener* listener) {} | 716 content::KeyboardListener* listener) {} |
| 645 | 717 |
| 646 void AutofillDialogControllerImpl::DidSelectSuggestion(int identifier) { | 718 void AutofillDialogControllerImpl::DidSelectSuggestion(int identifier) { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 | 803 |
| 732 void AutofillDialogControllerImpl::OnDidGetWalletItems( | 804 void AutofillDialogControllerImpl::OnDidGetWalletItems( |
| 733 scoped_ptr<wallet::WalletItems> wallet_items) { | 805 scoped_ptr<wallet::WalletItems> wallet_items) { |
| 734 bool items_changed = !wallet_items_ || *wallet_items != *wallet_items_; | 806 bool items_changed = !wallet_items_ || *wallet_items != *wallet_items_; |
| 735 wallet_items_ = wallet_items.Pass(); | 807 wallet_items_ = wallet_items.Pass(); |
| 736 WalletRequestCompleted(true); | 808 WalletRequestCompleted(true); |
| 737 | 809 |
| 738 if (items_changed) { | 810 if (items_changed) { |
| 739 view_->UpdateAccountChooser(); | 811 view_->UpdateAccountChooser(); |
| 740 view_->UpdateNotificationArea(); | 812 view_->UpdateNotificationArea(); |
| 813 view_->UpdateFootnote(); |
| 741 } | 814 } |
| 742 } | 815 } |
| 743 | 816 |
| 744 void AutofillDialogControllerImpl::OnDidSaveAddress( | 817 void AutofillDialogControllerImpl::OnDidSaveAddress( |
| 745 const std::string& address_id) { | 818 const std::string& address_id) { |
| 746 NOTIMPLEMENTED() << " address_id=" << address_id; | 819 NOTIMPLEMENTED() << " address_id=" << address_id; |
| 747 WalletRequestCompleted(true); | 820 WalletRequestCompleted(true); |
| 748 } | 821 } |
| 749 | 822 |
| 750 void AutofillDialogControllerImpl::OnDidSaveInstrument( | 823 void AutofillDialogControllerImpl::OnDidSaveInstrument( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 777 void AutofillDialogControllerImpl::OnMalformedResponse() { | 850 void AutofillDialogControllerImpl::OnMalformedResponse() { |
| 778 WalletRequestCompleted(false); | 851 WalletRequestCompleted(false); |
| 779 } | 852 } |
| 780 | 853 |
| 781 void AutofillDialogControllerImpl::OnNetworkError(int response_code) { | 854 void AutofillDialogControllerImpl::OnNetworkError(int response_code) { |
| 782 WalletRequestCompleted(false); | 855 WalletRequestCompleted(false); |
| 783 } | 856 } |
| 784 | 857 |
| 785 //////////////////////////////////////////////////////////////////////////////// | 858 //////////////////////////////////////////////////////////////////////////////// |
| 786 | 859 |
| 860 void AutofillDialogControllerImpl::UpdateProgressBar(double value) { |
| 861 view_->UpdateProgressBar(value); |
| 862 } |
| 863 |
| 787 bool AutofillDialogControllerImpl::HandleKeyPressEventInInput( | 864 bool AutofillDialogControllerImpl::HandleKeyPressEventInInput( |
| 788 const content::NativeWebKeyboardEvent& event) { | 865 const content::NativeWebKeyboardEvent& event) { |
| 789 if (popup_controller_) | 866 if (popup_controller_) |
| 790 return popup_controller_->HandleKeyPressEvent(event); | 867 return popup_controller_->HandleKeyPressEvent(event); |
| 791 | 868 |
| 792 return false; | 869 return false; |
| 793 } | 870 } |
| 794 | 871 |
| 795 bool AutofillDialogControllerImpl::RequestingCreditCardInfo() const { | 872 bool AutofillDialogControllerImpl::RequestingCreditCardInfo() const { |
| 796 DCHECK_GT(form_structure_.field_count(), 0U); | 873 DCHECK_GT(form_structure_.field_count(), 0U); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1031 DialogSection section) { | 1108 DialogSection section) { |
| 1032 return const_cast<DetailInputs*>(&RequestedFieldsForSection(section)); | 1109 return const_cast<DetailInputs*>(&RequestedFieldsForSection(section)); |
| 1033 } | 1110 } |
| 1034 | 1111 |
| 1035 void AutofillDialogControllerImpl::HidePopup() { | 1112 void AutofillDialogControllerImpl::HidePopup() { |
| 1036 if (popup_controller_) | 1113 if (popup_controller_) |
| 1037 popup_controller_->Hide(); | 1114 popup_controller_->Hide(); |
| 1038 } | 1115 } |
| 1039 | 1116 |
| 1040 } // namespace autofill | 1117 } // namespace autofill |
| OLD | NEW |