Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: components/autofill/core/browser/autofill_client.h

Issue 710453002: [Autofill] Componentize AutofillCCInfoBarDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_CLIENT_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
11 #include "base/i18n/rtl.h" 11 #include "base/i18n/rtl.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 14
15 namespace content { 15 namespace content {
16 class RenderFrameHost; 16 class RenderFrameHost;
17 } 17 }
18 18
19 namespace gfx { 19 namespace gfx {
20 class Rect; 20 class Rect;
21 class RectF; 21 class RectF;
22 } 22 }
23 23
24 namespace infobars {
25 class InfoBar;
26 }
27
28 class ConfirmInfoBarDelegate;
24 class GURL; 29 class GURL;
25 class PrefService; 30 class PrefService;
26 31
27 namespace autofill { 32 namespace autofill {
28 33
29 class AutofillMetrics; 34 class AutofillManager;
30 class AutofillPopupDelegate; 35 class AutofillPopupDelegate;
31 class AutofillWebDataService; 36 class AutofillWebDataService;
32 class CreditCard; 37 class CreditCard;
33 class FormStructure; 38 class FormStructure;
34 class PersonalDataManager; 39 class PersonalDataManager;
35 struct FormData; 40 struct FormData;
36 41
37 // A client interface that needs to be supplied to the Autofill component by the 42 // A client interface that needs to be supplied to the Autofill component by the
38 // embedder. 43 // embedder.
39 // 44 //
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 virtual void HideRequestAutocompleteDialog() = 0; 79 virtual void HideRequestAutocompleteDialog() = 0;
75 80
76 // Causes the Autofill settings UI to be shown. 81 // Causes the Autofill settings UI to be shown.
77 virtual void ShowAutofillSettings() = 0; 82 virtual void ShowAutofillSettings() = 0;
78 83
79 // A user has attempted to use a masked card. Prompt them for further 84 // A user has attempted to use a masked card. Prompt them for further
80 // information to proceed. 85 // information to proceed.
81 virtual void ShowUnmaskPrompt() = 0; 86 virtual void ShowUnmaskPrompt() = 0;
82 87
83 // Run |save_card_callback| if the credit card should be imported as personal 88 // Run |save_card_callback| if the credit card should be imported as personal
84 // data. |metric_logger| can be used to log user actions. 89 // data. |autofill_manager| is a container for AutofillDriver and
90 // AutofillClient. It lives till the associated web contents persists.
91 // AutofillClient abstracts the InfoBar creation and AutofillDriver is used to
92 // perform navigations to handle any link clicks performed on that InfoBar.
85 virtual void ConfirmSaveCreditCard( 93 virtual void ConfirmSaveCreditCard(
94 AutofillManager* autofill_manager,
86 const base::Closure& save_card_callback) = 0; 95 const base::Closure& save_card_callback) = 0;
87 96
88 // Returns true if both the platform and the device support scanning credit 97 // Returns true if both the platform and the device support scanning credit
89 // cards. Should be called before ScanCreditCard(). 98 // cards. Should be called before ScanCreditCard().
90 virtual bool HasCreditCardScanFeature() = 0; 99 virtual bool HasCreditCardScanFeature() = 0;
91 100
92 // Shows the user interface for scanning a credit card. Invokes the |callback| 101 // Shows the user interface for scanning a credit card. Invokes the |callback|
93 // when a credit card is scanned successfully. Should be called only if 102 // when a credit card is scanned successfully. Should be called only if
94 // HasCreditCardScanFeature() returns true. 103 // HasCreditCardScanFeature() returns true.
95 virtual void ScanCreditCard(const CreditCardScanCallback& callback) = 0; 104 virtual void ScanCreditCard(const CreditCardScanCallback& callback) = 0;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 content::RenderFrameHost* rfh, 138 content::RenderFrameHost* rfh,
130 const std::vector<autofill::FormStructure*>& forms) = 0; 139 const std::vector<autofill::FormStructure*>& forms) = 0;
131 140
132 // Inform the client that the field has been filled. 141 // Inform the client that the field has been filled.
133 virtual void DidFillOrPreviewField( 142 virtual void DidFillOrPreviewField(
134 const base::string16& autofilled_value, 143 const base::string16& autofilled_value,
135 const base::string16& profile_full_name) = 0; 144 const base::string16& profile_full_name) = 0;
136 145
137 // Informs the client that a user gesture has been observed. 146 // Informs the client that a user gesture has been observed.
138 virtual void OnFirstUserGestureObserved() = 0; 147 virtual void OnFirstUserGestureObserved() = 0;
148
149 // Returns the autofill infobar that owns |delegate|.
150 virtual scoped_ptr<infobars::InfoBar> CreateInfoBar(
blundell 2014/12/12 16:03:07 Can't you get rid of this now?
Pritam Nikam 2014/12/12 16:19:57 No. Still the same linker error if I revert this i
151 scoped_ptr<ConfirmInfoBarDelegate> delegate) = 0;
139 }; 152 };
140 153
141 } // namespace autofill 154 } // namespace autofill
142 155
143 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ 156 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698