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

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: Remove debug code Created 5 years, 7 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 b57836999a7a56ab5310afa7d5dbc792799ae741..584718232de370afd33ecedddb3291f8796bd2ae 100644
--- a/chrome/browser/ui/autofill/chrome_autofill_client.cc
+++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc
@@ -33,6 +33,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"
@@ -305,4 +306,18 @@ void ChromeAutofillClient::LinkClicked(const GURL& url,
url, content::Referrer(), disposition, ui::PAGE_TRANSITION_LINK, false));
}
+bool ChromeAutofillClient::IsContextSecure(const GURL& form_origin) {
jww 2015/06/08 18:37:35 It seems bad to introduce this. We have isPrivileg
Evan Stade 2015/06/08 22:41:42 this param is not used
sigbjorn 2015/06/12 11:47:53 It is used in the fallback mechanism. It is not ne
sigbjorn 2015/06/12 11:47:53 isPrivilegedContext seems to only check isPotentia
+ content::SSLStatus ssl_status;
+ content::NavigationEntry* navigation_entry =
+ web_contents()->GetController().GetVisibleEntry();
jww 2015/06/08 18:37:35 This is probably not what we want. We probably wan
+ DCHECK(navigation_entry);
+ if (!navigation_entry)
+ return false;
+
+ ssl_status = navigation_entry->GetSSL();
+ return ssl_status.security_style ==
+ content::SECURITY_STYLE_AUTHENTICATED &&
jww 2015/06/08 18:37:34 We probably shouldn't be using the security style
sigbjorn 2015/06/12 11:47:53 Using the security style is on purpose. The user h
+ ssl_status.content_status == content::SSLStatus::NORMAL_CONTENT;
+}
+
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698