| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_ |
| 6 #define CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 10 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 | 30 |
| 31 // A glue class that allows uniform interactions with autocomplete data sources, | 31 // A glue class that allows uniform interactions with autocomplete data sources, |
| 32 // regardless of their type. Implementations are intended to be lightweight and | 32 // regardless of their type. Implementations are intended to be lightweight and |
| 33 // copyable, only holding weak references to their backing model. | 33 // copyable, only holding weak references to their backing model. |
| 34 class DataModelWrapper { | 34 class DataModelWrapper { |
| 35 public: | 35 public: |
| 36 virtual ~DataModelWrapper(); | 36 virtual ~DataModelWrapper(); |
| 37 | 37 |
| 38 // Fills in |inputs| with the data that this model contains (|inputs| is an | 38 // Fills in |inputs| with the data that this model contains (|inputs| is an |
| 39 // out-param). | 39 // out-param). |country_code| is the country used for |inputs|' section. |
| 40 void FillInputs(DetailInputs* inputs); | 40 void FillInputs(DetailInputs* inputs, const std::string& country_code); |
| 41 | 41 |
| 42 // Returns the data for a specific autocomplete type in a format for filling | 42 // Returns the data for a specific autocomplete type in a format for filling |
| 43 // into a web form. | 43 // into a web form. |
| 44 virtual base::string16 GetInfo(const AutofillType& type) const = 0; | 44 virtual base::string16 GetInfo(const AutofillType& type) const = 0; |
| 45 | 45 |
| 46 // Returns the data for a specified type in a format optimized for displaying | 46 // Returns the data for a specified type in a format optimized for displaying |
| 47 // to the user. | 47 // to the user. |
| 48 virtual base::string16 GetInfoForDisplay(const AutofillType& type) const; | 48 virtual base::string16 GetInfoForDisplay(const AutofillType& type) const; |
| 49 | 49 |
| 50 // Returns the icon, if any, that represents this model. | 50 // Returns the icon, if any, that represents this model. |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 virtual ~FullWalletShippingWrapper(); | 212 virtual ~FullWalletShippingWrapper(); |
| 213 | 213 |
| 214 virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE; | 214 virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE; |
| 215 | 215 |
| 216 private: | 216 private: |
| 217 wallet::FullWallet* full_wallet_; | 217 wallet::FullWallet* full_wallet_; |
| 218 | 218 |
| 219 DISALLOW_COPY_AND_ASSIGN(FullWalletShippingWrapper); | 219 DISALLOW_COPY_AND_ASSIGN(FullWalletShippingWrapper); |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 // A DataModelWrapper to copy the output of one section to the input of another. | 222 // A DataModelWrapper to copy the preserved input of a section to a newly |
| 223 class DetailOutputWrapper : public DataModelWrapper { | 223 // created one. |
| 224 class SnapshotWrapper : public DataModelWrapper { |
| 224 public: | 225 public: |
| 225 explicit DetailOutputWrapper(const DetailOutputMap& outputs); | 226 explicit SnapshotWrapper(const UserInputSnapshot& snapshot); |
| 226 virtual ~DetailOutputWrapper(); | 227 virtual ~SnapshotWrapper(); |
| 227 | 228 |
| 228 virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE; | 229 virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE; |
| 229 | 230 |
| 230 private: | 231 private: |
| 231 const DetailOutputMap& outputs_; | 232 const UserInputSnapshot& snapshot_; |
| 232 | 233 |
| 233 DISALLOW_COPY_AND_ASSIGN(DetailOutputWrapper); | 234 DISALLOW_COPY_AND_ASSIGN(SnapshotWrapper); |
| 234 }; | 235 }; |
| 235 | 236 |
| 236 } // namespace autofill | 237 } // namespace autofill |
| 237 | 238 |
| 238 #endif // CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_ | 239 #endif // CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_ |
| OLD | NEW |