OLD | NEW |
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 #include "android_webview/native/aw_autofill_manager_delegate.h" | 5 #include "android_webview/native/aw_autofill_manager_delegate.h" |
6 | 6 |
7 #include "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
8 #include "android_webview/browser/aw_content_browser_client.h" | 8 #include "android_webview/browser/aw_content_browser_client.h" |
| 9 #include "android_webview/browser/aw_form_database_service.h" |
9 #include "android_webview/browser/aw_pref_store.h" | 10 #include "android_webview/browser/aw_pref_store.h" |
10 #include "android_webview/native/aw_contents.h" | 11 #include "android_webview/native/aw_contents.h" |
11 #include "base/android/jni_android.h" | 12 #include "base/android/jni_android.h" |
12 #include "base/android/jni_string.h" | 13 #include "base/android/jni_string.h" |
13 #include "base/android/scoped_java_ref.h" | 14 #include "base/android/scoped_java_ref.h" |
14 #include "base/logging.h" | 15 #include "base/logging.h" |
15 #include "base/prefs/pref_registry_simple.h" | 16 #include "base/prefs/pref_registry_simple.h" |
16 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
17 #include "base/prefs/pref_service_factory.h" | 18 #include "base/prefs/pref_service_factory.h" |
18 #include "components/autofill/core/browser/autofill_popup_delegate.h" | 19 #include "components/autofill/core/browser/autofill_popup_delegate.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 AwContentBrowserClient::GetAwBrowserContext()); | 68 AwContentBrowserClient::GetAwBrowserContext()); |
68 } | 69 } |
69 | 70 |
70 autofill::PersonalDataManager* | 71 autofill::PersonalDataManager* |
71 AwAutofillManagerDelegate::GetPersonalDataManager() { | 72 AwAutofillManagerDelegate::GetPersonalDataManager() { |
72 return NULL; | 73 return NULL; |
73 } | 74 } |
74 | 75 |
75 scoped_refptr<autofill::AutofillWebDataService> | 76 scoped_refptr<autofill::AutofillWebDataService> |
76 AwAutofillManagerDelegate::GetDatabase() { | 77 AwAutofillManagerDelegate::GetDatabase() { |
77 return autofill::AutofillWebDataService::FromBrowserContext( | 78 android_webview::AwFormDatabaseService* service = |
78 web_contents_->GetBrowserContext()); | 79 static_cast<android_webview::AwBrowserContext*>( |
| 80 web_contents_->GetBrowserContext())->GetFormDatabaseService(); |
| 81 return service->get_autofill_webdata_service(); |
79 } | 82 } |
80 | 83 |
81 void AwAutofillManagerDelegate::ShowAutofillPopup( | 84 void AwAutofillManagerDelegate::ShowAutofillPopup( |
82 const gfx::RectF& element_bounds, | 85 const gfx::RectF& element_bounds, |
83 base::i18n::TextDirection text_direction, | 86 base::i18n::TextDirection text_direction, |
84 const std::vector<string16>& values, | 87 const std::vector<string16>& values, |
85 const std::vector<string16>& labels, | 88 const std::vector<string16>& labels, |
86 const std::vector<string16>& icons, | 89 const std::vector<string16>& icons, |
87 const std::vector<int>& identifiers, | 90 const std::vector<int>& identifiers, |
88 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) { | 91 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 const GURL& source_url, | 193 const GURL& source_url, |
191 const base::Callback<void(const autofill::FormStructure*)>& callback) { | 194 const base::Callback<void(const autofill::FormStructure*)>& callback) { |
192 NOTIMPLEMENTED(); | 195 NOTIMPLEMENTED(); |
193 } | 196 } |
194 | 197 |
195 bool RegisterAwAutofillManagerDelegate(JNIEnv* env) { | 198 bool RegisterAwAutofillManagerDelegate(JNIEnv* env) { |
196 return RegisterNativesImpl(env) >= 0; | 199 return RegisterNativesImpl(env) >= 0; |
197 } | 200 } |
198 | 201 |
199 } // namespace android_webview | 202 } // namespace android_webview |
OLD | NEW |