OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MANAGER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_DELEGATE_H_ |
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_DELEGATE_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_DELEGATE_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
10 | 10 |
11 namespace autofill { | 11 namespace autofill { |
12 class PasswordGenerator; | 12 class PasswordGenerator; |
13 } | 13 } |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 class BrowserContext; | 16 class BrowserContext; |
17 struct PasswordForm; | 17 struct PasswordForm; |
18 struct SSLStatus; | 18 struct SSLStatus; |
19 } | 19 } |
20 | 20 |
21 namespace gfx { | 21 namespace gfx { |
22 class Rect; | 22 class Rect; |
23 class RectF; | 23 class RectF; |
24 } | 24 } |
25 | 25 |
| 26 class AutofillMetrics; |
26 class FormStructure; | 27 class FormStructure; |
27 class GURL; | 28 class GURL; |
28 class InfoBarService; | 29 class InfoBarService; |
29 class PrefServiceBase; | 30 class PrefServiceBase; |
30 class Profile; | 31 class Profile; |
31 class ProfileSyncServiceBase; | 32 class ProfileSyncServiceBase; |
32 | 33 |
33 struct FormData; | 34 struct FormData; |
34 | 35 |
35 namespace autofill { | 36 namespace autofill { |
36 | 37 |
| 38 enum DialogType { |
| 39 // Autofill dialog for the Autocheckout feature. |
| 40 DIALOG_TYPE_AUTOCHECKOUT, |
| 41 // Autofill dialog for the requestAutocomplete feature. |
| 42 DIALOG_TYPE_REQUEST_AUTOCOMPLETE, |
| 43 }; |
| 44 |
37 // A delegate interface that needs to be supplied to AutofillManager | 45 // A delegate interface that needs to be supplied to AutofillManager |
38 // by the embedder. | 46 // by the embedder. |
39 // | 47 // |
40 // Each delegate instance is associated with a given context within | 48 // Each delegate instance is associated with a given context within |
41 // which an AutofillManager is used (e.g. a single tab), so when we | 49 // which an AutofillManager is used (e.g. a single tab), so when we |
42 // say "for the delegate" below, we mean "in the execution context the | 50 // say "for the delegate" below, we mean "in the execution context the |
43 // delegate is associated with" (e.g. for the tab the AutofillManager is | 51 // delegate is associated with" (e.g. for the tab the AutofillManager is |
44 // attached to). | 52 // attached to). |
45 class AutofillManagerDelegate { | 53 class AutofillManagerDelegate { |
46 public: | 54 public: |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 virtual void ShowAutocheckoutBubble( | 94 virtual void ShowAutocheckoutBubble( |
87 const gfx::RectF& bounding_box, | 95 const gfx::RectF& bounding_box, |
88 const gfx::NativeView& native_view, | 96 const gfx::NativeView& native_view, |
89 const base::Closure& callback) = 0; | 97 const base::Closure& callback) = 0; |
90 | 98 |
91 // Causes the dialog for request autocomplete feature to be shown. | 99 // Causes the dialog for request autocomplete feature to be shown. |
92 virtual void ShowRequestAutocompleteDialog( | 100 virtual void ShowRequestAutocompleteDialog( |
93 const FormData& form, | 101 const FormData& form, |
94 const GURL& source_url, | 102 const GURL& source_url, |
95 const content::SSLStatus& ssl_status, | 103 const content::SSLStatus& ssl_status, |
| 104 const AutofillMetrics& metric_logger, |
| 105 DialogType dialog_type, |
96 const base::Callback<void(const FormStructure*)>& callback) = 0; | 106 const base::Callback<void(const FormStructure*)>& callback) = 0; |
97 | 107 |
98 // Called when the dialog for request autocomplete closes. | 108 // Called when the dialog for request autocomplete closes. |
99 virtual void RequestAutocompleteDialogClosed() = 0; | 109 virtual void RequestAutocompleteDialogClosed() = 0; |
100 | 110 |
101 // Updates the Autocheckout progress bar. |value| must be in [0.0, 1.0]. | 111 // Updates the Autocheckout progress bar. |value| must be in [0.0, 1.0]. |
102 virtual void UpdateProgressBar(double value) = 0; | 112 virtual void UpdateProgressBar(double value) = 0; |
103 }; | 113 }; |
104 | 114 |
105 } // namespace autofill | 115 } // namespace autofill |
106 | 116 |
107 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_DELEGATE_H_ | 117 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_DELEGATE_H_ |
OLD | NEW |