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

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

Issue 124533003: Add country combobox to change country and rebuild address inputs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 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/country_combobox_model.h
diff --git a/chrome/browser/ui/autofill/country_combobox_model.h b/chrome/browser/ui/autofill/country_combobox_model.h
index 74afeaee8a927b6a367c41197684dc2f8dcff032..cdeb954824a67219a2f31ea1e302a0658e31d1de 100644
--- a/chrome/browser/ui/autofill/country_combobox_model.h
+++ b/chrome/browser/ui/autofill/country_combobox_model.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_AUTOFILL_COUNTRY_COMBOBOX_MODEL_H_
#define CHROME_BROWSER_UI_AUTOFILL_COUNTRY_COMBOBOX_MODEL_H_
+#include <string>
#include <vector>
#include "base/compiler_specific.h"
@@ -32,11 +33,29 @@ class CountryComboboxModel : public ui::ComboboxModel {
return countries_.get();
}
+ // Changes |selected_index_| to |index| after checking that it's sane.
+ void SelectIndex(int index);
+
+ // Changes |selected_index_| to the default index of this model.
+ void SelectDefaultIndex();
+
+ // Changes |selected_index_| to the index of |country_code|.
+ void SelectCountry(const std::string& country_code);
+
+ // Returns the currently selected country code for this model.
+ std::string GetSelectedCountryCode() const;
+
+ // Whether the default index is currently selected.
+ bool IsDefaultIndexSelected() const;
+
private:
// The countries to show in the model, including NULL for entries that are
// not countries (the separator entry).
ScopedVector<AutofillCountry> countries_;
+ // The index of the currently selected country.
+ int selected_index_;
+
DISALLOW_COPY_AND_ASSIGN(CountryComboboxModel);
};

Powered by Google App Engine
This is Rietveld 408576698