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_builder.h" | 18 #include "base/prefs/pref_service_builder.h" |
18 #include "components/autofill/core/browser/autofill_popup_delegate.h" | 19 #include "components/autofill/core/browser/autofill_popup_delegate.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 AwContentBrowserClient::GetAwBrowserContext()); | 67 AwContentBrowserClient::GetAwBrowserContext()); |
67 } | 68 } |
68 | 69 |
69 autofill::PersonalDataManager* | 70 autofill::PersonalDataManager* |
70 AwAutofillManagerDelegate::GetPersonalDataManager() { | 71 AwAutofillManagerDelegate::GetPersonalDataManager() { |
71 return NULL; | 72 return NULL; |
72 } | 73 } |
73 | 74 |
74 scoped_refptr<autofill::AutofillWebDataService> | 75 scoped_refptr<autofill::AutofillWebDataService> |
75 AwAutofillManagerDelegate::GetDatabase() { | 76 AwAutofillManagerDelegate::GetDatabase() { |
76 return autofill::AutofillWebDataService::FromBrowserContext( | 77 android_webview::AwFormDatabaseService* service = |
77 web_contents_->GetBrowserContext()); | 78 static_cast<android_webview::AwBrowserContext*>( |
| 79 web_contents_->GetBrowserContext())->GetFormDatabaseService(); |
| 80 return service->get_autofill_webdata_service(); |
78 } | 81 } |
79 | 82 |
80 void AwAutofillManagerDelegate::ShowAutofillPopup( | 83 void AwAutofillManagerDelegate::ShowAutofillPopup( |
81 const gfx::RectF& element_bounds, | 84 const gfx::RectF& element_bounds, |
82 base::i18n::TextDirection text_direction, | 85 base::i18n::TextDirection text_direction, |
83 const std::vector<string16>& values, | 86 const std::vector<string16>& values, |
84 const std::vector<string16>& labels, | 87 const std::vector<string16>& labels, |
85 const std::vector<string16>& icons, | 88 const std::vector<string16>& icons, |
86 const std::vector<int>& identifiers, | 89 const std::vector<int>& identifiers, |
87 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) { | 90 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 const GURL& source_url, | 192 const GURL& source_url, |
190 const base::Callback<void(const autofill::FormStructure*)>& callback) { | 193 const base::Callback<void(const autofill::FormStructure*)>& callback) { |
191 NOTIMPLEMENTED(); | 194 NOTIMPLEMENTED(); |
192 } | 195 } |
193 | 196 |
194 bool RegisterAwAutofillManagerDelegate(JNIEnv* env) { | 197 bool RegisterAwAutofillManagerDelegate(JNIEnv* env) { |
195 return RegisterNativesImpl(env) >= 0; | 198 return RegisterNativesImpl(env) >= 0; |
196 } | 199 } |
197 | 200 |
198 } // namespace android_webview | 201 } // namespace android_webview |
OLD | NEW |