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