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