Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(564)

Side by Side Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.h

Issue 178263004: rAc - Only show countries we're able to fill in. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 500s begone Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 // Allows tests to inspect the state of the account chooser. 319 // Allows tests to inspect the state of the account chooser.
320 AccountChooserModel* AccountChooserModelForTesting(); 320 AccountChooserModel* AccountChooserModelForTesting();
321 321
322 // Returns whether |url| matches the sign in continue URL. If so, also fills 322 // Returns whether |url| matches the sign in continue URL. If so, also fills
323 // in |user_index| with the index of the user account that just signed in. 323 // in |user_index| with the index of the user account that just signed in.
324 virtual bool IsSignInContinueUrl(const GURL& url, size_t* user_index) const; 324 virtual bool IsSignInContinueUrl(const GURL& url, size_t* user_index) const;
325 325
326 // Whether the user is known to be signed in. 326 // Whether the user is known to be signed in.
327 DialogSignedInState SignedInState() const; 327 DialogSignedInState SignedInState() const;
328 328
329 // Gets the CountryComboboxModel for |section|.
330 CountryComboboxModel* CountryComboboxModelForSection(DialogSection section);
Dan Beam 2014/03/05 00:40:03 revert
Evan Stade 2014/03/05 03:28:23 Done.
331
329 private: 332 private:
330 FRIEND_TEST_ALL_PREFIXES(AutofillDialogControllerI18nTest, 333 FRIEND_TEST_ALL_PREFIXES(AutofillDialogControllerI18nTest,
331 CorrectCountryFromInputs); 334 CorrectCountryFromInputs);
332 335
333 // Initializes or updates |suggested_cc_| et al. 336 // Initializes or updates |suggested_cc_| et al.
334 void SuggestionsUpdated(); 337 void SuggestionsUpdated();
335 338
336 // Starts fetching the wallet items from Online Wallet. 339 // Starts fetching the wallet items from Online Wallet.
337 void GetWalletItems(); 340 void GetWalletItems();
338 341
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 bool FormStructureCaresAboutSection(DialogSection section) const; 423 bool FormStructureCaresAboutSection(DialogSection section) const;
421 424
422 // Finds all fields of the given |type| in |form_structure_|, if any, and sets 425 // Finds all fields of the given |type| in |form_structure_|, if any, and sets
423 // each field's value to |output|. 426 // each field's value to |output|.
424 void SetOutputForFieldsOfType(ServerFieldType type, 427 void SetOutputForFieldsOfType(ServerFieldType type,
425 const base::string16& output); 428 const base::string16& output);
426 429
427 // Gets the value for |type| in |section|, whether it comes from manual user 430 // Gets the value for |type| in |section|, whether it comes from manual user
428 // input or the active suggestion. 431 // input or the active suggestion.
429 base::string16 GetValueFromSection(DialogSection section, 432 base::string16 GetValueFromSection(DialogSection section,
430 ServerFieldType type); 433 ServerFieldType type);
434
435 // Returns whether the given section can accept an address with the given
436 // country code.
437 bool CanAcceptCountry(DialogSection section, const std::string& country_code);
431 438
432 // Gets the SuggestionsMenuModel for |section|. 439 // Gets the SuggestionsMenuModel for |section|.
433 SuggestionsMenuModel* SuggestionsMenuModelForSection(DialogSection section); 440 SuggestionsMenuModel* SuggestionsMenuModelForSection(DialogSection section);
434 const SuggestionsMenuModel* SuggestionsMenuModelForSection( 441 const SuggestionsMenuModel* SuggestionsMenuModelForSection(
435 DialogSection section) const; 442 DialogSection section) const;
436 // And the reverse. 443 // And the reverse.
437 DialogSection SectionForSuggestionsMenuModel( 444 DialogSection SectionForSuggestionsMenuModel(
438 const SuggestionsMenuModel& model); 445 const SuggestionsMenuModel& model);
439 446
440 // Gets the CountryComboboxModel for |section|.
441 CountryComboboxModel* CountryComboboxModelForSection(DialogSection section);
442
443 // Clears and builds the inputs in |section| for |country_name|. 447 // Clears and builds the inputs in |section| for |country_name|.
444 // When |should_clobber| is false, and the view's country value matches 448 // When |should_clobber| is false, and the view's country value matches
445 // |country_name|, the inputs won't be rebuilt. 449 // |country_name|, the inputs won't be rebuilt.
446 bool RebuildInputsForCountry(DialogSection section, 450 bool RebuildInputsForCountry(DialogSection section,
447 const base::string16& country_name, 451 const base::string16& country_name,
448 bool should_clobber); 452 bool should_clobber);
449 453
450 // Suggested text and icons for sections. Suggestion text is used to show an 454 // Suggested text and icons for sections. Suggestion text is used to show an
451 // abridged overview of the currently used suggestion. Extra text is used when 455 // abridged overview of the currently used suggestion. Extra text is used when
452 // part of a section is suggested but part must be manually input (e.g. during 456 // part of a section is suggested but part must be manually input (e.g. during
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 DetailInputs requested_cc_fields_; 693 DetailInputs requested_cc_fields_;
690 DetailInputs requested_billing_fields_; 694 DetailInputs requested_billing_fields_;
691 DetailInputs requested_cc_billing_fields_; 695 DetailInputs requested_cc_billing_fields_;
692 DetailInputs requested_shipping_fields_; 696 DetailInputs requested_shipping_fields_;
693 697
694 // Models for the credit card expiration inputs. 698 // Models for the credit card expiration inputs.
695 MonthComboboxModel cc_exp_month_combobox_model_; 699 MonthComboboxModel cc_exp_month_combobox_model_;
696 YearComboboxModel cc_exp_year_combobox_model_; 700 YearComboboxModel cc_exp_year_combobox_model_;
697 701
698 // Models for country input. 702 // Models for country input.
699 CountryComboboxModel billing_country_combobox_model_; 703 scoped_ptr<CountryComboboxModel> billing_country_combobox_model_;
700 CountryComboboxModel shipping_country_combobox_model_; 704 scoped_ptr<CountryComboboxModel> shipping_country_combobox_model_;
701 705
702 // Models for the suggestion views. 706 // Models for the suggestion views.
703 SuggestionsMenuModel suggested_cc_; 707 SuggestionsMenuModel suggested_cc_;
704 SuggestionsMenuModel suggested_billing_; 708 SuggestionsMenuModel suggested_billing_;
705 SuggestionsMenuModel suggested_cc_billing_; 709 SuggestionsMenuModel suggested_cc_billing_;
706 SuggestionsMenuModel suggested_shipping_; 710 SuggestionsMenuModel suggested_shipping_;
707 711
708 // |DialogSection|s that are in edit mode that are based on existing data. 712 // |DialogSection|s that are in edit mode that are based on existing data.
709 std::set<DialogSection> section_editing_state_; 713 std::set<DialogSection> section_editing_state_;
710 714
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 base::string16 submitted_cardholder_name_; 811 base::string16 submitted_cardholder_name_;
808 812
809 base::WeakPtrFactory<AutofillDialogControllerImpl> weak_ptr_factory_; 813 base::WeakPtrFactory<AutofillDialogControllerImpl> weak_ptr_factory_;
810 814
811 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); 815 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl);
812 }; 816 };
813 817
814 } // namespace autofill 818 } // namespace autofill
815 819
816 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ 820 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698