| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_AUTOFILL_AUTOFILL_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "chrome/browser/autofill/autofill_profile.h" | 10 #include "chrome/browser/autofill/autofill_profile.h" |
| 11 #include "chrome/browser/autofill/credit_card.h" | 11 #include "chrome/browser/autofill/credit_card.h" |
| 12 | 12 |
| 13 class Profile; |
| 14 |
| 13 // An interface the AutoFill dialog uses to notify its clients (observers) when | 15 // An interface the AutoFill dialog uses to notify its clients (observers) when |
| 14 // the user has applied changes to the AutoFill profile data. | 16 // the user has applied changes to the AutoFill profile data. |
| 15 class AutoFillDialogObserver { | 17 class AutoFillDialogObserver { |
| 16 public: | 18 public: |
| 17 // The user has confirmed changes by clicking "Apply" or "OK". Any of the | 19 // The user has confirmed changes by clicking "Apply" or "OK". Any of the |
| 18 // parameters may be NULL. | 20 // parameters may be NULL. |
| 19 virtual void OnAutoFillDialogApply( | 21 virtual void OnAutoFillDialogApply( |
| 20 std::vector<AutoFillProfile>* profiles, | 22 std::vector<AutoFillProfile>* profiles, |
| 21 std::vector<CreditCard>* credit_cards) = 0; | 23 std::vector<CreditCard>* credit_cards) = 0; |
| 22 | 24 |
| 23 protected: | 25 protected: |
| 24 virtual ~AutoFillDialogObserver() {} | 26 virtual ~AutoFillDialogObserver() {} |
| 25 }; | 27 }; |
| 26 | 28 |
| 27 // Shows the AutoFill dialog, which allows the user to edit profile information. | 29 // Shows the AutoFill dialog, which allows the user to edit profile information. |
| 28 // |profiles| is a vector of autofill profiles that contains the current profile | 30 // |profiles| is a vector of autofill profiles that contains the current profile |
| 29 // information. The dialog fills out the profile fields using this data. Any | 31 // information. The dialog fills out the profile fields using this data. Any |
| 30 // changes made to the profile information through the dialog should be | 32 // changes made to the profile information through the dialog should be |
| 31 // transferred back into |profiles| and |credit_cards|. |observer| will be | 33 // transferred back into |profiles| and |credit_cards|. |observer| will be |
| 32 // notified by OnAutoFillDialogAccept when the user has applied changes. | 34 // notified by OnAutoFillDialogAccept when the user has applied changes. |
| 33 // | 35 // |
| 34 // The PersonalDataManager owns the contents of these vectors. The lifetime of | 36 // The PersonalDataManager owns the contents of these vectors. The lifetime of |
| 35 // the contents is until the PersonalDataManager replaces them with new data | 37 // the contents is until the PersonalDataManager replaces them with new data |
| 36 // whenever the web database is updated. | 38 // whenever the web database is updated. |
| 37 void ShowAutoFillDialog(AutoFillDialogObserver* observer, | 39 void ShowAutoFillDialog(AutoFillDialogObserver* observer, |
| 38 const std::vector<AutoFillProfile*>& profiles, | 40 const std::vector<AutoFillProfile*>& profiles, |
| 39 const std::vector<CreditCard*>& credit_cards); | 41 const std::vector<CreditCard*>& credit_cards, |
| 42 Profile* profile); |
| 40 | 43 |
| 41 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_ | 44 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_ |
| OLD | NEW |