Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_INPUT_H_ | |
| 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_INPUT_H_ | |
| 7 | |
| 8 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | |
| 9 | |
| 10 namespace autofill { | |
| 11 namespace common { | |
| 12 | |
| 13 // An object for building inputs for autofill sections. The object uses the | |
| 14 // browser locale to determine the country/region and language for the inputs. | |
| 15 // The object also allows specifying a country/region that is different from the | |
| 16 // application locale. | |
| 17 // | |
| 18 // Sample usage: | |
| 19 // DialogSection dialog_section = ...; | |
| 20 // DetailInputs detail_inputs; | |
| 21 // scoped_ptr<AutofillDialogInput> input( | |
| 22 // AutofillDialogInput::BuildInstance()); | |
| 23 // input->buildInputsForSection(dialog_section, &detail_inputs); | |
| 24 // Process(detail_inputs); | |
| 25 class AutofillDialogInput { | |
| 26 public: | |
| 27 // Returns a new instance of this class. The caller owns the result. | |
| 28 static AutofillDialogInput* BuildInstance(); | |
|
Evan Stade
2013/10/02 00:57:19
nit: factory function should be named Create()
| |
| 29 | |
| 30 // Constructs |inputs| for a given |dialog_section|. The |inputs| parameter | |
| 31 // 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
| |
| 32 virtual void BuildInputsForSection(DialogSection dialog_section, | |
| 33 DetailInputs* inputs) = 0; | |
| 34 | |
| 35 // Same as above, but uses the |selected_country_region| instead of the | |
| 36 // application locale for the country/region-specific inputs. The | |
| 37 // country/region selection does not affect the language settings. | |
| 38 virtual void BuildInputsForSection(DialogSection dialog_section, | |
| 39 const std::string& selected_country_region, | |
| 40 DetailInputs* inputs) = 0; | |
| 41 | |
| 42 virtual ~AutofillDialogInput() {} | |
| 43 }; | |
| 44 | |
| 45 } // namespace common | |
| 46 } // namespace autofill | |
| 47 | |
| 48 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_INPUT_H_ | |
| OLD | NEW |