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

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: Return nullptr for CreateInfoBar() in test_autofill_client.cc. 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/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
13 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
14 15
15 namespace gfx { 16 namespace gfx {
16 class Rect; 17 class Rect;
17 class RectF; 18 class RectF;
18 } 19 }
19 20
21 namespace infobars {
22 class InfoBar;
23 }
24
25 class ConfirmInfoBarDelegate;
20 class GURL; 26 class GURL;
21 class PrefService; 27 class PrefService;
22 28
23 namespace autofill { 29 namespace autofill {
24 30
31 class AutofillManager;
25 class AutofillMetrics; 32 class AutofillMetrics;
26 class AutofillPopupDelegate; 33 class AutofillPopupDelegate;
27 class AutofillWebDataService; 34 class AutofillWebDataService;
28 class CreditCard; 35 class CreditCard;
29 class FormStructure; 36 class FormStructure;
30 class PersonalDataManager; 37 class PersonalDataManager;
31 struct FormData; 38 struct FormData;
32 39
33 // A client interface that needs to be supplied to the Autofill component by the 40 // A client interface that needs to be supplied to the Autofill component by the
34 // embedder. 41 // embedder.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // Gets the preferences associated with the client. 73 // Gets the preferences associated with the client.
67 virtual PrefService* GetPrefs() = 0; 74 virtual PrefService* GetPrefs() = 0;
68 75
69 // Hides the associated request autocomplete dialog (if it exists). 76 // Hides the associated request autocomplete dialog (if it exists).
70 virtual void HideRequestAutocompleteDialog() = 0; 77 virtual void HideRequestAutocompleteDialog() = 0;
71 78
72 // Causes the Autofill settings UI to be shown. 79 // Causes the Autofill settings UI to be shown.
73 virtual void ShowAutofillSettings() = 0; 80 virtual void ShowAutofillSettings() = 0;
74 81
75 // Run |save_card_callback| if the credit card should be imported as personal 82 // Run |save_card_callback| if the credit card should be imported as personal
76 // data. |metric_logger| can be used to log user actions. 83 // data. |metric_logger| can be used to log user actions. |autofill_manager|
84 // is a container for AutofillDriver and AutofillClient. It lives till the
85 // associated web contents persists.
86 // AutofillClient abstracts the InfoBar creation and AutofillDriver is used
87 // to perform navigations to handle any link clicks performed on that InfoBar.
77 virtual void ConfirmSaveCreditCard( 88 virtual void ConfirmSaveCreditCard(
89 AutofillManager* autofill_manager,
78 const AutofillMetrics& metric_logger, 90 const AutofillMetrics& metric_logger,
79 const base::Closure& save_card_callback) = 0; 91 const base::Closure& save_card_callback) = 0;
80 92
81 // Returns true if both the platform and the device support scanning credit 93 // Returns true if both the platform and the device support scanning credit
82 // cards. Should be called before ScanCreditCard(). 94 // cards. Should be called before ScanCreditCard().
83 virtual bool HasCreditCardScanFeature() = 0; 95 virtual bool HasCreditCardScanFeature() = 0;
84 96
85 // Shows the user interface for scanning a credit card. Invokes the |callback| 97 // Shows the user interface for scanning a credit card. Invokes the |callback|
86 // when a credit card is scanned successfully. Should be called only if 98 // when a credit card is scanned successfully. Should be called only if
87 // HasCreditCardScanFeature() returns true. 99 // HasCreditCardScanFeature() returns true.
(...skipping 30 matching lines...) Expand all
118 130
119 // Pass the form structures to the password generation manager to detect 131 // Pass the form structures to the password generation manager to detect
120 // account creation forms. 132 // account creation forms.
121 virtual void DetectAccountCreationForms( 133 virtual void DetectAccountCreationForms(
122 const std::vector<autofill::FormStructure*>& forms) = 0; 134 const std::vector<autofill::FormStructure*>& forms) = 0;
123 135
124 // Inform the client that the field has been filled. 136 // Inform the client that the field has been filled.
125 virtual void DidFillOrPreviewField( 137 virtual void DidFillOrPreviewField(
126 const base::string16& autofilled_value, 138 const base::string16& autofilled_value,
127 const base::string16& profile_full_name) = 0; 139 const base::string16& profile_full_name) = 0;
140
141 // Returns a translate infobar that owns |delegate|.
Ilya Sherman 2014/12/03 20:00:21 Why a translate infobar?
Pritam Nikam 2014/12/04 15:37:30 Done.
142 virtual scoped_ptr<infobars::InfoBar> CreateInfoBar(
143 scoped_ptr<ConfirmInfoBarDelegate> delegate) = 0;
Ilya Sherman 2014/12/03 20:00:21 I suspect that this method is not appropriate, but
128 }; 144 };
129 145
130 } // namespace autofill 146 } // namespace autofill
131 147
132 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ 148 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698