Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_client.h" | 5 #include "android_webview/native/aw_autofill_client.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_form_database_service.h" |
| 10 #include "android_webview/browser/aw_pref_store.h" | 10 #include "android_webview/browser/aw_pref_store.h" |
| 11 #include "android_webview/native/aw_contents.h" | 11 #include "android_webview/native/aw_contents.h" |
| 12 #include "base/android/jni_android.h" | 12 #include "base/android/jni_android.h" |
| 13 #include "base/android/jni_string.h" | 13 #include "base/android/jni_string.h" |
| 14 #include "base/android/scoped_java_ref.h" | 14 #include "base/android/scoped_java_ref.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/prefs/pref_registry_simple.h" | 16 #include "base/prefs/pref_registry_simple.h" |
| 17 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
| 18 #include "base/prefs/pref_service_factory.h" | 18 #include "base/prefs/pref_service_factory.h" |
| 19 #include "components/autofill/core/browser/autofill_popup_delegate.h" | 19 #include "components/autofill/core/browser/autofill_popup_delegate.h" |
| 20 #include "components/autofill/core/browser/suggestion.h" | 20 #include "components/autofill/core/browser/suggestion.h" |
| 21 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 21 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 22 #include "components/autofill/core/common/autofill_pref_names.h" | 22 #include "components/autofill/core/common/autofill_pref_names.h" |
| 23 #include "components/user_prefs/user_prefs.h" | 23 #include "components/user_prefs/user_prefs.h" |
| 24 #include "content/public/browser/navigation_entry.h" | |
| 24 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
| 26 #include "content/public/common/ssl_status.h" | |
| 25 #include "jni/AwAutofillClient_jni.h" | 27 #include "jni/AwAutofillClient_jni.h" |
| 26 | 28 |
| 27 using base::android::AttachCurrentThread; | 29 using base::android::AttachCurrentThread; |
| 28 using base::android::ConvertUTF16ToJavaString; | 30 using base::android::ConvertUTF16ToJavaString; |
| 29 using base::android::ScopedJavaLocalRef; | 31 using base::android::ScopedJavaLocalRef; |
| 30 using content::WebContents; | 32 using content::WebContents; |
| 31 | 33 |
| 32 DEFINE_WEB_CONTENTS_USER_DATA_KEY(android_webview::AwAutofillClient); | 34 DEFINE_WEB_CONTENTS_USER_DATA_KEY(android_webview::AwAutofillClient); |
| 33 | 35 |
| 34 namespace android_webview { | 36 namespace android_webview { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 | 175 |
| 174 void AwAutofillClient::OnFirstUserGestureObserved() { | 176 void AwAutofillClient::OnFirstUserGestureObserved() { |
| 175 NOTIMPLEMENTED(); | 177 NOTIMPLEMENTED(); |
| 176 } | 178 } |
| 177 | 179 |
| 178 void AwAutofillClient::LinkClicked(const GURL& url, | 180 void AwAutofillClient::LinkClicked(const GURL& url, |
| 179 WindowOpenDisposition disposition) { | 181 WindowOpenDisposition disposition) { |
| 180 NOTIMPLEMENTED(); | 182 NOTIMPLEMENTED(); |
| 181 } | 183 } |
| 182 | 184 |
| 185 bool AwAutofillClient::IsContextSecure(const GURL& form_origin) { | |
| 186 content::SSLStatus ssl_status; | |
|
boliu
2015/07/06 17:56:07
can you add a comment here and in ChromeAutofillCl
| |
| 187 content::NavigationEntry* navigation_entry = | |
| 188 web_contents_->GetController().GetLastCommittedEntry(); | |
| 189 if (!navigation_entry) | |
| 190 return false; | |
| 191 | |
| 192 ssl_status = navigation_entry->GetSSL(); | |
| 193 return ssl_status.security_style == | |
| 194 content::SECURITY_STYLE_AUTHENTICATED && | |
| 195 ssl_status.content_status == content::SSLStatus::NORMAL_CONTENT; | |
| 196 } | |
| 197 | |
| 183 void AwAutofillClient::SuggestionSelected(JNIEnv* env, | 198 void AwAutofillClient::SuggestionSelected(JNIEnv* env, |
| 184 jobject object, | 199 jobject object, |
| 185 jint position) { | 200 jint position) { |
| 186 if (delegate_) { | 201 if (delegate_) { |
| 187 delegate_->DidAcceptSuggestion(suggestions_[position].value, | 202 delegate_->DidAcceptSuggestion(suggestions_[position].value, |
| 188 suggestions_[position].frontend_id, | 203 suggestions_[position].frontend_id, |
| 189 position); | 204 position); |
| 190 } | 205 } |
| 191 } | 206 } |
| 192 | 207 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 226 content::RenderFrameHost* rfh, | 241 content::RenderFrameHost* rfh, |
| 227 const ResultCallback& callback) { | 242 const ResultCallback& callback) { |
| 228 NOTIMPLEMENTED(); | 243 NOTIMPLEMENTED(); |
| 229 } | 244 } |
| 230 | 245 |
| 231 bool RegisterAwAutofillClient(JNIEnv* env) { | 246 bool RegisterAwAutofillClient(JNIEnv* env) { |
| 232 return RegisterNativesImpl(env); | 247 return RegisterNativesImpl(env); |
| 233 } | 248 } |
| 234 | 249 |
| 235 } // namespace android_webview | 250 } // namespace android_webview |
| OLD | NEW |