OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_ASSISTANT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_ASSISTANT_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_ASSISTANT_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_ASSISTANT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 public: | 25 public: |
26 explicit AutofillAssistant(AutofillManager* autofill_manager); | 26 explicit AutofillAssistant(AutofillManager* autofill_manager); |
27 ~AutofillAssistant(); | 27 ~AutofillAssistant(); |
28 | 28 |
29 // Should be called at every page navigation to clear state. | 29 // Should be called at every page navigation to clear state. |
30 void Reset(); | 30 void Reset(); |
31 | 31 |
32 // Returns whether a credit card assist can be shown. Will go through the | 32 // Returns whether a credit card assist can be shown. Will go through the |
33 // forms in |form_structures| and extract the credit card form. | 33 // forms in |form_structures| and extract the credit card form. |
34 bool CanShowCreditCardAssist( | 34 bool CanShowCreditCardAssist( |
35 const std::vector<FormStructure*>& form_structures); | 35 const std::vector<std::unique_ptr<FormStructure>>& form_structures); |
36 | 36 |
37 // Will show an assist infobar for the previously extracted form proposing to | 37 // Will show an assist infobar for the previously extracted form proposing to |
38 // autofill it. Should only be called if CanShowCreditCardAssist() returned | 38 // autofill it. Should only be called if CanShowCreditCardAssist() returned |
39 // true. | 39 // true. |
40 void ShowAssistForCreditCard(const CreditCard& card); | 40 void ShowAssistForCreditCard(const CreditCard& card); |
41 | 41 |
42 private: | 42 private: |
43 // Called by the infobar delegate when the user accepts the infobar. | 43 // Called by the infobar delegate when the user accepts the infobar. |
44 void OnUserDidAcceptCreditCardFill(const CreditCard& card); | 44 void OnUserDidAcceptCreditCardFill(const CreditCard& card); |
45 | 45 |
(...skipping 10 matching lines...) Expand all Loading... |
56 AutofillManager* autofill_manager_; | 56 AutofillManager* autofill_manager_; |
57 | 57 |
58 base::WeakPtrFactory<AutofillAssistant> weak_ptr_factory_; | 58 base::WeakPtrFactory<AutofillAssistant> weak_ptr_factory_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(AutofillAssistant); | 60 DISALLOW_COPY_AND_ASSIGN(AutofillAssistant); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace autofill | 63 } // namespace autofill |
64 | 64 |
65 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_ASSISTANT_H_ | 65 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_ASSISTANT_H_ |
OLD | NEW |