| 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_pref_store.h" | 9 #include "android_webview/browser/aw_pref_store.h" |
| 10 #include "android_webview/native/aw_contents.h" | 10 #include "android_webview/native/aw_contents.h" |
| 11 #include "base/android/jni_android.h" | 11 #include "base/android/jni_android.h" |
| 12 #include "base/android/jni_string.h" | 12 #include "base/android/jni_string.h" |
| 13 #include "base/android/scoped_java_ref.h" | 13 #include "base/android/scoped_java_ref.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/prefs/pref_registry_simple.h" | 15 #include "base/prefs/pref_registry_simple.h" |
| 16 #include "base/prefs/pref_service.h" | 16 #include "base/prefs/pref_service.h" |
| 17 #include "base/prefs/pref_service_builder.h" | 17 #include "base/prefs/pref_service_builder.h" |
| 18 #include "components/autofill/core/browser/autofill_popup_delegate.h" | 18 #include "components/autofill/core/browser/autofill_popup_delegate.h" |
| 19 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 19 #include "components/autofill/core/common/autofill_pref_names.h" | 20 #include "components/autofill/core/common/autofill_pref_names.h" |
| 20 #include "components/user_prefs/user_prefs.h" | 21 #include "components/user_prefs/user_prefs.h" |
| 21 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
| 22 #include "content/public/browser/web_contents_view.h" | 23 #include "content/public/browser/web_contents_view.h" |
| 23 #include "jni/AwAutofillManagerDelegate_jni.h" | 24 #include "jni/AwAutofillManagerDelegate_jni.h" |
| 24 | 25 |
| 25 using base::android::AttachCurrentThread; | 26 using base::android::AttachCurrentThread; |
| 26 using base::android::ConvertUTF16ToJavaString; | 27 using base::android::ConvertUTF16ToJavaString; |
| 27 using base::android::ScopedJavaLocalRef; | 28 using base::android::ScopedJavaLocalRef; |
| 28 using content::WebContents; | 29 using content::WebContents; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 PrefService* AwAutofillManagerDelegate::GetPrefs() { | 64 PrefService* AwAutofillManagerDelegate::GetPrefs() { |
| 64 return user_prefs::UserPrefs::Get( | 65 return user_prefs::UserPrefs::Get( |
| 65 AwContentBrowserClient::GetAwBrowserContext()); | 66 AwContentBrowserClient::GetAwBrowserContext()); |
| 66 } | 67 } |
| 67 | 68 |
| 68 autofill::PersonalDataManager* | 69 autofill::PersonalDataManager* |
| 69 AwAutofillManagerDelegate::GetPersonalDataManager() { | 70 AwAutofillManagerDelegate::GetPersonalDataManager() { |
| 70 return NULL; | 71 return NULL; |
| 71 } | 72 } |
| 72 | 73 |
| 74 scoped_refptr<autofill::AutofillWebDataService> |
| 75 AwAutofillManagerDelegate::GetDatabase() { |
| 76 return autofill::AutofillWebDataService::FromBrowserContext( |
| 77 web_contents_->GetBrowserContext()); |
| 78 } |
| 79 |
| 73 void AwAutofillManagerDelegate::ShowAutofillPopup( | 80 void AwAutofillManagerDelegate::ShowAutofillPopup( |
| 74 const gfx::RectF& element_bounds, | 81 const gfx::RectF& element_bounds, |
| 75 base::i18n::TextDirection text_direction, | 82 base::i18n::TextDirection text_direction, |
| 76 const std::vector<string16>& values, | 83 const std::vector<string16>& values, |
| 77 const std::vector<string16>& labels, | 84 const std::vector<string16>& labels, |
| 78 const std::vector<string16>& icons, | 85 const std::vector<string16>& icons, |
| 79 const std::vector<int>& identifiers, | 86 const std::vector<int>& identifiers, |
| 80 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) { | 87 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) { |
| 81 | 88 |
| 82 values_ = values; | 89 values_ = values; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 const GURL& source_url, | 189 const GURL& source_url, |
| 183 const base::Callback<void(const autofill::FormStructure*)>& callback) { | 190 const base::Callback<void(const autofill::FormStructure*)>& callback) { |
| 184 NOTIMPLEMENTED(); | 191 NOTIMPLEMENTED(); |
| 185 } | 192 } |
| 186 | 193 |
| 187 bool RegisterAwAutofillManagerDelegate(JNIEnv* env) { | 194 bool RegisterAwAutofillManagerDelegate(JNIEnv* env) { |
| 188 return RegisterNativesImpl(env) >= 0; | 195 return RegisterNativesImpl(env) >= 0; |
| 189 } | 196 } |
| 190 | 197 |
| 191 } // namespace android_webview | 198 } // namespace android_webview |
| OLD | NEW |