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

Side by Side Diff: android_webview/native/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: introduced java peer to AwAutofillManagerDelegate 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
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 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 ANDROID_WEBVIEW_BROWSER_AW_AUTOFILL_MANAGER_DELEGATE_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_AUTOFILL_MANAGER_DELEGATE_H_
6 #define ANDROID_WEBVIEW_BROWSER_AW_AUTOFILL_MANAGER_DELEGATE_H_ 6 #define ANDROID_WEBVIEW_BROWSER_AW_AUTOFILL_MANAGER_DELEGATE_H_
7 7
8 #include <jni.h>
9 #include <vector>
10
11 #include "base/android/jni_helper.h"
8 #include "base/basictypes.h" 12 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
10 #include "components/autofill/browser/autofill_manager_delegate.h" 14 #include "components/autofill/browser/autofill_manager_delegate.h"
11 #include "content/public/browser/web_contents_user_data.h" 15 #include "content/public/browser/web_contents_user_data.h"
12 16
13 namespace autofill { 17 namespace autofill {
14 class AutofillMetrics; 18 class AutofillMetrics;
15 class AutofillPopupDelegate; 19 class AutofillPopupDelegate;
16 class CreditCard; 20 class CreditCard;
17 class FormStructure; 21 class FormStructure;
18 class PasswordGenerator; 22 class PasswordGenerator;
19 class PersonalDataManager; 23 class PersonalDataManager;
20 struct FormData; 24 struct FormData;
21 namespace autocheckout { 25 namespace autocheckout {
22 class WhitelistManager; 26 class WhitelistManager;
23 } 27 }
24 } 28 }
25 29
26 namespace content { 30 namespace content {
27 class WebContents; 31 class WebContents;
28 } 32 }
29 33
34 namespace gfx {
35 class RectF;
36 }
37
30 class PersonalDataManager; 38 class PersonalDataManager;
31 class PrefService; 39 class PrefService;
32 40
33 namespace android_webview { 41 namespace android_webview {
34 42
35 // Manager delegate for the autofill functionality. Android webview 43 // Manager delegate for the autofill functionality. Android webview
36 // supports enabling autocomplete feature for each webview instance 44 // supports enabling autocomplete feature for each webview instance
37 // (different than the browser which supports enabling/disabling for 45 // (different than the browser which supports enabling/disabling for
38 // a profile). Since there is only one pref service for a given browser 46 // 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 47 // context, we cannot enable this feature via UserPrefs. Rather, we always
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 const gfx::RectF& element_bounds, 85 const gfx::RectF& element_bounds,
78 const std::vector<string16>& values, 86 const std::vector<string16>& values,
79 const std::vector<string16>& labels, 87 const std::vector<string16>& labels,
80 const std::vector<string16>& icons, 88 const std::vector<string16>& icons,
81 const std::vector<int>& identifiers, 89 const std::vector<int>& identifiers,
82 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) OVERRIDE; 90 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) OVERRIDE;
83 virtual void HideAutofillPopup() OVERRIDE; 91 virtual void HideAutofillPopup() OVERRIDE;
84 virtual void UpdateProgressBar(double value) OVERRIDE; 92 virtual void UpdateProgressBar(double value) OVERRIDE;
85 virtual bool ShouldIgnoreFormData() OVERRIDE; 93 virtual bool ShouldIgnoreFormData() OVERRIDE;
86 94
95 void SuggestionSelected(JNIEnv* env,
96 jobject obj,
97 jint position);
87 private: 98 private:
88 AwAutofillManagerDelegate(content::WebContents* contents); 99 AwAutofillManagerDelegate(content::WebContents* web_contents);
89 friend class content::WebContentsUserData<AwAutofillManagerDelegate>; 100 friend class content::WebContentsUserData<AwAutofillManagerDelegate>;
90 101
102 void ShowAutofillPopupImpl(const gfx::RectF& element_bounds,
103 const std::vector<string16>& values,
104 const std::vector<string16>& labels,
105 const std::vector<int>& identifiers);
106
91 // The web_contents associated with this delegate. 107 // The web_contents associated with this delegate.
92 content::WebContents* web_contents_; 108 content::WebContents* web_contents_;
109 bool save_form_data_;
110 JavaObjectWeakGlobalRef java_ref_;
93 111
94 bool save_form_data_; 112 // The current Autofill query values.
113 std::vector<string16> values_;
114 std::vector<int> identifiers_;
115 base::WeakPtr<autofill::AutofillPopupDelegate> delegate_;
95 116
96 DISALLOW_COPY_AND_ASSIGN(AwAutofillManagerDelegate); 117 DISALLOW_COPY_AND_ASSIGN(AwAutofillManagerDelegate);
97 }; 118 };
98 119
120 bool RegisterAwAutofillManagerDelegate(JNIEnv* env);
121
99 } // namespace android_webview 122 } // namespace android_webview
100 123
101 #endif // ANDROID_WEBVIEW_BROWSER_AW_AUTOFILL_MANAGER_DELEGATE_H_ 124 #endif // ANDROID_WEBVIEW_BROWSER_AW_AUTOFILL_MANAGER_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698