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

Side by Side Diff: android_webview/browser/aw_autofill_manager_delegate.h

Issue 16212007: Implement the autofill UI for chromium powered android webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue15097004
Patch Set: move ui files Created 7 years, 6 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
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_AUTOFILL_MANAGER_DELEGATE_H_
6 #define ANDROID_WEBVIEW_BROWSER_AW_AUTOFILL_MANAGER_DELEGATE_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "components/autofill/browser/autofill_manager_delegate.h"
11 #include "content/public/browser/web_contents_user_data.h"
12
13 namespace autofill {
14 class AutofillMetrics;
15 class AutofillPopupDelegate;
16 class CreditCard;
17 class FormStructure;
18 class PasswordGenerator;
19 class PersonalDataManager;
20 struct FormData;
21 namespace autocheckout {
22 class WhitelistManager;
23 }
24 }
25
26 namespace content {
27 class WebContents;
28 }
29
30 class PersonalDataManager;
31 class PrefService;
32
33 namespace android_webview {
34
35 // Manager delegate for the autofill functionality. Android webview
36 // supports enabling autocomplete feature for each webview instance
37 // (different than the browser which supports enabling/disabling for
38 // a profile). Since there is only one pref service for a given browser
39 // context, we cannot enable this feature via UserPrefs. Rather, we always
40 // keep the feature enabled at the pref service, and control it via
41 // the delegates.
42 class AwAutofillManagerDelegate
43 : public autofill::AutofillManagerDelegate,
44 public content::WebContentsUserData<AwAutofillManagerDelegate> {
45
46 public:
47 virtual ~AwAutofillManagerDelegate();
48
49 void SetSaveFormData(bool enabled);
50 bool GetSaveFormData();
51
52 // AutofillManagerDelegate implementation.
53 virtual autofill::PersonalDataManager* GetPersonalDataManager() OVERRIDE;
54 virtual PrefService* GetPrefs() OVERRIDE;
55 virtual autofill::autocheckout::WhitelistManager*
56 GetAutocheckoutWhitelistManager() const OVERRIDE;
57 virtual void HideRequestAutocompleteDialog() OVERRIDE;
58 virtual void OnAutocheckoutError() OVERRIDE;
59 virtual void ShowAutofillSettings() OVERRIDE;
60 virtual void ConfirmSaveCreditCard(
61 const autofill::AutofillMetrics& metric_logger,
62 const autofill::CreditCard& credit_card,
63 const base::Closure& save_card_callback) OVERRIDE;
64 virtual void ShowAutocheckoutBubble(
65 const gfx::RectF& bounds,
66 bool is_google_user,
67 const base::Callback<void(bool)>& callback) OVERRIDE;
68 virtual void HideAutocheckoutBubble() OVERRIDE;
69 virtual void ShowRequestAutocompleteDialog(
70 const autofill::FormData& form,
71 const GURL& source_url,
72 autofill::DialogType dialog_type,
73 const base::Callback<void(const autofill::FormStructure*,
74 const std::string&)>& callback) OVERRIDE;
75 virtual void ShowAutofillPopup(
76 const gfx::RectF& element_bounds,
77 const std::vector<string16>& values,
78 const std::vector<string16>& labels,
79 const std::vector<string16>& icons,
80 const std::vector<int>& identifiers,
81 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) OVERRIDE;
82 virtual void HideAutofillPopup() OVERRIDE;
83 virtual void UpdateProgressBar(double value) OVERRIDE;
84
85 private:
86 AwAutofillManagerDelegate(content::WebContents* contents);
87 friend class content::WebContentsUserData<AwAutofillManagerDelegate>;
88
89 bool save_form_data_;
90
91 DISALLOW_COPY_AND_ASSIGN(AwAutofillManagerDelegate);
92 };
93
94 } // namespace android_webview
95
96 #endif // ANDROID_WEBVIEW_BROWSER_AW_AUTOFILL_MANAGER_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698