Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2257)

Unified Diff: android_webview/native/aw_autofill_client.cc

Issue 1136473006: Don't autofill credit cards on non-secure pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add period Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/native/aw_autofill_client.h ('k') | chrome/browser/ui/autofill/chrome_autofill_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_autofill_client.cc
diff --git a/android_webview/native/aw_autofill_client.cc b/android_webview/native/aw_autofill_client.cc
index 613d22ba8804f7b711196be4fffb220515b86b78..b15f2f653ed087921cc409a2cf97f2cf89300a46 100644
--- a/android_webview/native/aw_autofill_client.cc
+++ b/android_webview/native/aw_autofill_client.cc
@@ -21,7 +21,9 @@
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/autofill/core/common/autofill_pref_names.h"
#include "components/user_prefs/user_prefs.h"
+#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/ssl_status.h"
#include "jni/AwAutofillClient_jni.h"
using base::android::AttachCurrentThread;
@@ -180,6 +182,22 @@ void AwAutofillClient::LinkClicked(const GURL& url,
NOTIMPLEMENTED();
}
+bool AwAutofillClient::IsContextSecure(const GURL& form_origin) {
+ content::SSLStatus ssl_status;
+ content::NavigationEntry* navigation_entry =
+ web_contents_->GetController().GetLastCommittedEntry();
+ if (!navigation_entry)
+ return false;
+
+ ssl_status = navigation_entry->GetSSL();
+ // Note: The implementation below is a copy of the one in
+ // ChromeAutofillClient::IsContextSecure, and should be kept in sync
+ // until crbug.com/505388 gets implemented.
+ return ssl_status.security_style ==
+ content::SECURITY_STYLE_AUTHENTICATED &&
+ ssl_status.content_status == content::SSLStatus::NORMAL_CONTENT;
+}
+
void AwAutofillClient::SuggestionSelected(JNIEnv* env,
jobject object,
jint position) {
« no previous file with comments | « android_webview/native/aw_autofill_client.h ('k') | chrome/browser/ui/autofill/chrome_autofill_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698