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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2362523003: Add (some) password detection for HTTP-bad (Closed)
Patch Set: trigger the downgrade from OnPasswordFormsParsed Created 4 years, 2 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 | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index dea63ab0658e12887f32e8f489cb9f1e94a2ff84..95b5483720539cfee15fd1a1a995415da8f41993 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -417,6 +417,8 @@ WebContentsImpl::WebContentsImpl(BrowserContext* browser_context)
is_resume_pending_(false),
displayed_insecure_content_(false),
displayed_content_with_cert_errors_(false),
+ displayed_password_field_on_http_(false),
+ displayed_credit_card_field_on_http_(false),
has_accessed_initial_document_(false),
theme_color_(SK_ColorTRANSPARENT),
last_sent_theme_color_(SK_ColorTRANSPARENT),
@@ -2547,6 +2549,14 @@ bool WebContentsImpl::DisplayedContentWithCertErrors() const {
return displayed_content_with_cert_errors_;
}
+bool WebContentsImpl::DisplayedPasswordFieldOnHttp() const {
+ return displayed_password_field_on_http_;
+}
+
+bool WebContentsImpl::DisplayedCreditCardFieldOnHttp() const {
+ return displayed_credit_card_field_on_http_;
+}
+
WebContents* WebContentsImpl::OpenURL(const OpenURLParams& params) {
if (!delegate_)
return NULL;
@@ -3428,6 +3438,8 @@ void WebContentsImpl::DidNavigateMainFramePostCommit(
// displayed insecure content.
displayed_insecure_content_ = false;
displayed_content_with_cert_errors_ = false;
+ displayed_password_field_on_http_ = false;
+ displayed_credit_card_field_on_http_ = false;
SSLManager::NotifySSLInternalStateChanged(
GetController().GetBrowserContext());
}
@@ -3859,6 +3871,18 @@ void WebContentsImpl::StopMediaSession() {
MediaSession::Get(this)->Stop(MediaSession::SuspendType::UI);
}
+void WebContentsImpl::OnPasswordInputShownOnHttp() {
+ displayed_password_field_on_http_ = true;
+ SSLManager::NotifySSLInternalStateChanged(
+ GetController().GetBrowserContext());
+}
+
+void WebContentsImpl::OnCreditCardInputShownOnHttp() {
+ displayed_credit_card_field_on_http_ = true;
+ SSLManager::NotifySSLInternalStateChanged(
+ GetController().GetBrowserContext());
+}
+
void WebContentsImpl::OnFirstVisuallyNonEmptyPaint() {
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
DidFirstVisuallyNonEmptyPaint());
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698