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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.h

Issue 63053003: Ask libaddressinput for address components to use in requestAutocomplete(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: base:: Created 6 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/autofill/autofill_dialog_controller_impl.h
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h
index ab279d154b6466fb31eb0fe2eb6d97bfe42c921f..4ecb6088f5f709aad4bc7beb780df4bc83a1d430 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h
@@ -36,6 +36,7 @@
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/ssl_status.h"
#include "third_party/skia/include/core/SkColor.h"
+#include "ui/base/models/combobox_model_observer.h"
#include "ui/base/models/simple_menu_model.h"
#include "ui/base/ui_base_types.h"
#include "ui/gfx/animation/animation_delegate.h"
@@ -76,7 +77,8 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate,
public wallet::WalletSigninHelperDelegate,
public PersonalDataManagerObserver,
public AccountChooserModelDelegate,
- public gfx::AnimationDelegate {
+ public gfx::AnimationDelegate,
+ public ui::ComboboxModelObserver {
public:
virtual ~AutofillDialogControllerImpl();
@@ -147,6 +149,7 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate,
bool was_edit) OVERRIDE;
virtual bool HandleKeyPressEventInInput(
const content::NativeWebKeyboardEvent& event) OVERRIDE;
+ virtual void ComboboxItemSelected(ServerFieldType type, int index) OVERRIDE;
virtual void FocusMoved() OVERRIDE;
virtual bool ShouldShowErrorBubble() const OVERRIDE;
virtual void ViewClosed() OVERRIDE;
@@ -221,6 +224,9 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate,
virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE;
virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
+ // ui::ComboboxModelObserver:
+ virtual void OnComboboxModelChanged(ui::ComboboxModel* model) OVERRIDE;
+
protected:
enum DialogSignedInState {
NOT_CHECKED,
@@ -315,6 +321,9 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate,
// Whether the user is known to be signed in.
DialogSignedInState SignedInState() const;
+ // Whether |model| is a combobox for a country.
+ bool IsCountryComboboxModel(const ui::ComboboxModel* model) const;
Evan Stade 2014/01/02 22:59:26 why is this protected instead of private? I can't
+
private:
// Initializes or updates |suggested_cc_| et al.
void SuggestionsUpdated();
@@ -449,6 +458,14 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate,
// Like RequestedFieldsForSection, but returns a pointer.
DetailInputs* MutableRequestedFieldsForSection(DialogSection section);
+ // Gets the country code (e.g. "US") that should be used for |section|.
+ std::string GetCountryCodeForSection(DialogSection section) const;
+
+ // Sets the country code that should be used for |section| and rebuilds this
+ // section's inputs.
+ void SetCountryCodeForSection(DialogSection section,
+ const std::string& country_code);
+
// Hides |popup_controller_|'s popup view, if it exists.
void HidePopup();
@@ -649,8 +666,9 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate,
MonthComboboxModel cc_exp_month_combobox_model_;
YearComboboxModel cc_exp_year_combobox_model_;
- // Model for the country input.
- CountryComboboxModel country_combobox_model_;
+ // Models for country input.
+ CountryComboboxModel billing_country_combobox_model_;
+ CountryComboboxModel shipping_country_combobox_model_;
// Models for the suggestion views.
SuggestionsMenuModel suggested_cc_;

Powered by Google App Engine
This is Rietveld 408576698