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

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: Nitpick and test run fixes Created 5 years, 6 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..2a1385171d7b6621fe64676980664eae1aa3ac6b 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,18 @@ 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();
+ DCHECK(navigation_entry);
+ if (!navigation_entry)
bondd 2015/07/01 22:16:50 AFAIK checking for DCHECK() failure like this is a
jww 2015/07/01 22:25:45 More specifically, this should not be a DCHECK() a
+ return false;
+
+ ssl_status = navigation_entry->GetSSL();
+ return ssl_status.security_style ==
+ content::SECURITY_STYLE_AUTHENTICATED &&
+ ssl_status.content_status == content::SSLStatus::NORMAL_CONTENT;
+}
+
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698