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

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

Issue 229723002: Better error reasons for rAc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android Created 6 years, 8 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_MANAGER_DELEGATE_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_DELEGATE_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_DELEGATE_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_DELEGATE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 25 matching lines...) Expand all
36 // A delegate interface that needs to be supplied to AutofillManager 36 // A delegate interface that needs to be supplied to AutofillManager
37 // by the embedder. 37 // by the embedder.
38 // 38 //
39 // Each delegate instance is associated with a given context within 39 // Each delegate instance is associated with a given context within
40 // which an AutofillManager is used (e.g. a single tab), so when we 40 // which an AutofillManager is used (e.g. a single tab), so when we
41 // say "for the delegate" below, we mean "in the execution context the 41 // say "for the delegate" below, we mean "in the execution context the
42 // delegate is associated with" (e.g. for the tab the AutofillManager is 42 // delegate is associated with" (e.g. for the tab the AutofillManager is
43 // attached to). 43 // attached to).
44 class AutofillManagerDelegate { 44 class AutofillManagerDelegate {
45 public: 45 public:
46 // Copy of blink::WebFormElement::AutocompleteResult.
47 enum RequestAutocompleteResult {
48 AutocompleteResultSuccess,
49 AutocompleteResultErrorDisabled,
50 AutocompleteResultErrorCancel,
51 AutocompleteResultErrorInvalid,
52 // TODO(estade): add this one to WebFormElement::AutocompleteResult.
53 AutocompleteResultErrorUnsupported,
54 };
55
56 typedef base::Callback<
57 void(RequestAutocompleteResult, const FormStructure*)> ResultCallback;
58
46 virtual ~AutofillManagerDelegate() {} 59 virtual ~AutofillManagerDelegate() {}
47 60
48 // Gets the PersonalDataManager instance associated with the delegate. 61 // Gets the PersonalDataManager instance associated with the delegate.
49 virtual PersonalDataManager* GetPersonalDataManager() = 0; 62 virtual PersonalDataManager* GetPersonalDataManager() = 0;
50 63
51 // Gets the AutofillWebDataService instance associated with the delegate. 64 // Gets the AutofillWebDataService instance associated with the delegate.
52 virtual scoped_refptr<AutofillWebDataService> GetDatabase() = 0; 65 virtual scoped_refptr<AutofillWebDataService> GetDatabase() = 0;
53 66
54 // Gets the preferences associated with the delegate. 67 // Gets the preferences associated with the delegate.
55 virtual PrefService* GetPrefs() = 0; 68 virtual PrefService* GetPrefs() = 0;
56 69
57 // Hides the associated request autocomplete dialog (if it exists). 70 // Hides the associated request autocomplete dialog (if it exists).
58 virtual void HideRequestAutocompleteDialog() = 0; 71 virtual void HideRequestAutocompleteDialog() = 0;
59 72
60 // Causes the Autofill settings UI to be shown. 73 // Causes the Autofill settings UI to be shown.
61 virtual void ShowAutofillSettings() = 0; 74 virtual void ShowAutofillSettings() = 0;
62 75
63 // Run |save_card_callback| if the credit card should be imported as personal 76 // Run |save_card_callback| if the credit card should be imported as personal
64 // data. |metric_logger| can be used to log user actions. 77 // data. |metric_logger| can be used to log user actions.
65 virtual void ConfirmSaveCreditCard( 78 virtual void ConfirmSaveCreditCard(
66 const AutofillMetrics& metric_logger, 79 const AutofillMetrics& metric_logger,
67 const base::Closure& save_card_callback) = 0; 80 const base::Closure& save_card_callback) = 0;
68 81
69 // Causes the dialog for request autocomplete feature to be shown. 82 // Causes the dialog for request autocomplete feature to be shown.
70 virtual void ShowRequestAutocompleteDialog( 83 virtual void ShowRequestAutocompleteDialog(
71 const FormData& form, 84 const FormData& form,
72 const GURL& source_url, 85 const GURL& source_url,
73 const base::Callback<void(const FormStructure*)>& callback) = 0; 86 const ResultCallback& callback) = 0;
74 87
75 // Shows an Autofill popup with the given |values|, |labels|, |icons|, and 88 // Shows an Autofill popup with the given |values|, |labels|, |icons|, and
76 // |identifiers| for the element at |element_bounds|. |delegate| will be 89 // |identifiers| for the element at |element_bounds|. |delegate| will be
77 // notified of popup events. 90 // notified of popup events.
78 virtual void ShowAutofillPopup( 91 virtual void ShowAutofillPopup(
79 const gfx::RectF& element_bounds, 92 const gfx::RectF& element_bounds,
80 base::i18n::TextDirection text_direction, 93 base::i18n::TextDirection text_direction,
81 const std::vector<base::string16>& values, 94 const std::vector<base::string16>& values,
82 const std::vector<base::string16>& labels, 95 const std::vector<base::string16>& labels,
83 const std::vector<base::string16>& icons, 96 const std::vector<base::string16>& icons,
(...skipping 19 matching lines...) Expand all
103 // Inform the delegate that the field has been filled. 116 // Inform the delegate that the field has been filled.
104 virtual void DidFillOrPreviewField( 117 virtual void DidFillOrPreviewField(
105 const base::string16& autofilled_value, 118 const base::string16& autofilled_value,
106 const base::string16& profile_full_name) = 0; 119 const base::string16& profile_full_name) = 0;
107 120
108 }; 121 };
109 122
110 } // namespace autofill 123 } // namespace autofill
111 124
112 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_DELEGATE_H_ 125 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698