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

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

Issue 12328091: set a default country in the autofill dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove extra include Created 7 years, 10 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
new file mode 100644
index 0000000000000000000000000000000000000000..e6377d6c64156337104d39f3fe72c751209fe97c
--- /dev/null
+++ b/chrome/browser/ui/autofill/country_combobox_model.h
@@ -0,0 +1,43 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_AUTOFILL_COUNTRY_COMBOBOX_MODEL_H_
+#define CHROME_BROWSER_UI_AUTOFILL_COUNTRY_COMBOBOX_MODEL_H_
+
+#include <vector>
+
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_vector.h"
+#include "base/string16.h"
+#include "ui/base/models/combobox_model.h"
+
+class AutofillCountry;
+
+namespace autofill {
+
+// A model for countries to be used to enter addresses.
+class CountryComboboxModel : public ui::ComboboxModel {
+ public:
+ CountryComboboxModel();
+ virtual ~CountryComboboxModel();
+
+ // ui::Combobox implementation:
+ virtual int GetItemCount() const OVERRIDE;
+ virtual string16 GetItemAt(int index) OVERRIDE;
+
+ const std::vector<AutofillCountry*>& countries() const {
+ return countries_.get();
+ }
+
+ private:
+ // The countries to show in the model, including NULL for entries that are
+ // not countries (such as the blank entry or the separator entry).
+ ScopedVector<AutofillCountry> countries_;
+
+ DISALLOW_COPY_AND_ASSIGN(CountryComboboxModel);
+};
+
+} // namespace autofill
+
+#endif // CHROME_BROWSER_UI_AUTOFILL_COUNTRY_COMBOBOX_MODEL_H_

Powered by Google App Engine
This is Rietveld 408576698