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

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

Issue 25620002: [rac] Use i18n address inputs with --enable-autofill-address-i18n flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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_input.h
diff --git a/chrome/browser/ui/autofill/autofill_dialog_input.h b/chrome/browser/ui/autofill/autofill_dialog_input.h
new file mode 100644
index 0000000000000000000000000000000000000000..09f3a2825e197823fc845ed80048d6fea76dfda6
--- /dev/null
+++ b/chrome/browser/ui/autofill/autofill_dialog_input.h
@@ -0,0 +1,48 @@
+// Copyright 2013 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_AUTOFILL_DIALOG_INPUT_H_
+#define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_INPUT_H_
+
+#include "chrome/browser/ui/autofill/autofill_dialog_types.h"
+
+namespace autofill {
+namespace common {
+
+// An object for building inputs for autofill sections. The object uses the
+// browser locale to determine the country/region and language for the inputs.
+// The object also allows specifying a country/region that is different from the
+// application locale.
+//
+// Sample usage:
+// DialogSection dialog_section = ...;
+// DetailInputs detail_inputs;
+// scoped_ptr<AutofillDialogInput> input(
+// AutofillDialogInput::BuildInstance());
+// input->buildInputsForSection(dialog_section, &detail_inputs);
+// Process(detail_inputs);
+class AutofillDialogInput {
+ public:
+ // Returns a new instance of this class. The caller owns the result.
+ static AutofillDialogInput* BuildInstance();
Evan Stade 2013/10/02 00:57:19 nit: factory function should be named Create()
+
+ // Constructs |inputs| for a given |dialog_section|. The |inputs| parameter
+ // must be non-null. Does not take ownership of |inputs|.
Evan Stade 2013/10/02 00:57:19 nit: just mention that |inputs| is an out-param; n
+ virtual void BuildInputsForSection(DialogSection dialog_section,
+ DetailInputs* inputs) = 0;
+
+ // Same as above, but uses the |selected_country_region| instead of the
+ // application locale for the country/region-specific inputs. The
+ // country/region selection does not affect the language settings.
+ virtual void BuildInputsForSection(DialogSection dialog_section,
+ const std::string& selected_country_region,
+ DetailInputs* inputs) = 0;
+
+ virtual ~AutofillDialogInput() {}
+};
+
+} // namespace common
+} // namespace autofill
+
+#endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_INPUT_H_

Powered by Google App Engine
This is Rietveld 408576698