| 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/content/browser/autocheckout/whitelist_manager.h" | |
| 19 #include "components/autofill/core/browser/autofill_popup_delegate.h" | 18 #include "components/autofill/core/browser/autofill_popup_delegate.h" |
| 20 #include "components/autofill/core/common/autofill_pref_names.h" | 19 #include "components/autofill/core/common/autofill_pref_names.h" |
| 21 #include "components/user_prefs/user_prefs.h" | 20 #include "components/user_prefs/user_prefs.h" |
| 22 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
| 23 #include "content/public/browser/web_contents_view.h" | 22 #include "content/public/browser/web_contents_view.h" |
| 24 #include "jni/AwAutofillManagerDelegate_jni.h" | 23 #include "jni/AwAutofillManagerDelegate_jni.h" |
| 25 | 24 |
| 26 using base::android::AttachCurrentThread; | 25 using base::android::AttachCurrentThread; |
| 27 using base::android::ConvertUTF16ToJavaString; | 26 using base::android::ConvertUTF16ToJavaString; |
| 28 using base::android::ScopedJavaLocalRef; | 27 using base::android::ScopedJavaLocalRef; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 PrefService* AwAutofillManagerDelegate::GetPrefs() { | 63 PrefService* AwAutofillManagerDelegate::GetPrefs() { |
| 65 return user_prefs::UserPrefs::Get( | 64 return user_prefs::UserPrefs::Get( |
| 66 AwContentBrowserClient::GetAwBrowserContext()); | 65 AwContentBrowserClient::GetAwBrowserContext()); |
| 67 } | 66 } |
| 68 | 67 |
| 69 autofill::PersonalDataManager* | 68 autofill::PersonalDataManager* |
| 70 AwAutofillManagerDelegate::GetPersonalDataManager() { | 69 AwAutofillManagerDelegate::GetPersonalDataManager() { |
| 71 return NULL; | 70 return NULL; |
| 72 } | 71 } |
| 73 | 72 |
| 74 autofill::autocheckout::WhitelistManager* | |
| 75 AwAutofillManagerDelegate::GetAutocheckoutWhitelistManager() const { | |
| 76 return NULL; | |
| 77 } | |
| 78 | |
| 79 void AwAutofillManagerDelegate::ShowAutofillPopup( | 73 void AwAutofillManagerDelegate::ShowAutofillPopup( |
| 80 const gfx::RectF& element_bounds, | 74 const gfx::RectF& element_bounds, |
| 81 base::i18n::TextDirection text_direction, | 75 base::i18n::TextDirection text_direction, |
| 82 const std::vector<string16>& values, | 76 const std::vector<string16>& values, |
| 83 const std::vector<string16>& labels, | 77 const std::vector<string16>& labels, |
| 84 const std::vector<string16>& icons, | 78 const std::vector<string16>& icons, |
| 85 const std::vector<int>& identifiers, | 79 const std::vector<int>& identifiers, |
| 86 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) { | 80 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) { |
| 87 | 81 |
| 88 values_ = values; | 82 values_ = values; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 jobject object, | 155 jobject object, |
| 162 jint position) { | 156 jint position) { |
| 163 if (delegate_) | 157 if (delegate_) |
| 164 delegate_->DidAcceptSuggestion(values_[position], identifiers_[position]); | 158 delegate_->DidAcceptSuggestion(values_[position], identifiers_[position]); |
| 165 } | 159 } |
| 166 | 160 |
| 167 void AwAutofillManagerDelegate::HideRequestAutocompleteDialog() { | 161 void AwAutofillManagerDelegate::HideRequestAutocompleteDialog() { |
| 168 NOTIMPLEMENTED(); | 162 NOTIMPLEMENTED(); |
| 169 } | 163 } |
| 170 | 164 |
| 171 void AwAutofillManagerDelegate::OnAutocheckoutError() { | |
| 172 NOTIMPLEMENTED(); | |
| 173 } | |
| 174 | |
| 175 void AwAutofillManagerDelegate::OnAutocheckoutSuccess() { | |
| 176 NOTIMPLEMENTED(); | |
| 177 } | |
| 178 | |
| 179 void AwAutofillManagerDelegate::ShowAutofillSettings() { | 165 void AwAutofillManagerDelegate::ShowAutofillSettings() { |
| 180 NOTIMPLEMENTED(); | 166 NOTIMPLEMENTED(); |
| 181 } | 167 } |
| 182 | 168 |
| 183 void AwAutofillManagerDelegate::ConfirmSaveCreditCard( | 169 void AwAutofillManagerDelegate::ConfirmSaveCreditCard( |
| 184 const autofill::AutofillMetrics& metric_logger, | 170 const autofill::AutofillMetrics& metric_logger, |
| 185 const autofill::CreditCard& credit_card, | 171 const autofill::CreditCard& credit_card, |
| 186 const base::Closure& save_card_callback) { | 172 const base::Closure& save_card_callback) { |
| 187 NOTIMPLEMENTED(); | 173 NOTIMPLEMENTED(); |
| 188 } | 174 } |
| 189 | 175 |
| 190 bool AwAutofillManagerDelegate::ShowAutocheckoutBubble( | |
| 191 const gfx::RectF& bounding_box, | |
| 192 bool is_google_user, | |
| 193 const base::Callback<void(autofill::AutocheckoutBubbleState)>& callback) { | |
| 194 NOTIMPLEMENTED(); | |
| 195 return false; | |
| 196 } | |
| 197 | |
| 198 void AwAutofillManagerDelegate::HideAutocheckoutBubble() { | |
| 199 NOTIMPLEMENTED(); | |
| 200 } | |
| 201 | |
| 202 void AwAutofillManagerDelegate::ShowRequestAutocompleteDialog( | 176 void AwAutofillManagerDelegate::ShowRequestAutocompleteDialog( |
| 203 const autofill::FormData& form, | 177 const autofill::FormData& form, |
| 204 const GURL& source_url, | 178 const GURL& source_url, |
| 205 autofill::DialogType dialog_type, | 179 autofill::DialogType dialog_type, |
| 206 const base::Callback<void(const autofill::FormStructure*, | 180 const base::Callback<void(const autofill::FormStructure*, |
| 207 const std::string&)>& callback) { | 181 const std::string&)>& callback) { |
| 208 NOTIMPLEMENTED(); | 182 NOTIMPLEMENTED(); |
| 209 } | 183 } |
| 210 | 184 |
| 211 void AwAutofillManagerDelegate::AddAutocheckoutStep( | |
| 212 autofill::AutocheckoutStepType step_type) { | |
| 213 NOTIMPLEMENTED(); | |
| 214 } | |
| 215 | |
| 216 void AwAutofillManagerDelegate::UpdateAutocheckoutStep( | |
| 217 autofill::AutocheckoutStepType step_type, | |
| 218 autofill::AutocheckoutStepStatus step_status) { | |
| 219 NOTIMPLEMENTED(); | |
| 220 } | |
| 221 | |
| 222 bool RegisterAwAutofillManagerDelegate(JNIEnv* env) { | 185 bool RegisterAwAutofillManagerDelegate(JNIEnv* env) { |
| 223 return RegisterNativesImpl(env) >= 0; | 186 return RegisterNativesImpl(env) >= 0; |
| 224 } | 187 } |
| 225 | 188 |
| 226 } // namespace android_webview | 189 } // namespace android_webview |
| OLD | NEW |