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

Unified Diff: chrome/browser/ui/autofill/chrome_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
Index: chrome/browser/ui/autofill/chrome_autofill_client.cc
diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chrome/browser/ui/autofill/chrome_autofill_client.cc
index ea7ff06fa8e265aee04091223e91ee6a3d63d7fb..0484d59b3c5c0cdcb5c43d74331cd814873ca06d 100644
--- a/chrome/browser/ui/autofill/chrome_autofill_client.cc
+++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc
@@ -34,6 +34,7 @@
#include "components/autofill/core/common/autofill_pref_names.h"
#include "components/password_manager/content/browser/content_password_manager_driver.h"
#include "components/user_prefs/user_prefs.h"
+#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_frame_host.h"
#include "ui/gfx/geometry/rect.h"
@@ -307,4 +308,19 @@ void ChromeAutofillClient::LinkClicked(const GURL& url,
url, content::Referrer(), disposition, ui::PAGE_TRANSITION_LINK, false));
}
+bool ChromeAutofillClient::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: If changing the implementation below, also change
+ // AwAutofillClient::IsContextSecure. See crbug.com/505388
+ return ssl_status.security_style ==
+ content::SECURITY_STYLE_AUTHENTICATED &&
+ ssl_status.content_status == content::SSLStatus::NORMAL_CONTENT;
+}
+
} // namespace autofill
« no previous file with comments | « chrome/browser/ui/autofill/chrome_autofill_client.h ('k') | components/autofill/core/browser/autofill_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698