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

Unified Diff: content/browser/ssl/ssl_manager.cc

Issue 2467773002: Notify SSLManager when all password fields on a page are gone (Closed)
Patch Set: tweak SSLManager comment Created 4 years, 1 month 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/ssl/ssl_manager.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/ssl/ssl_manager.cc
diff --git a/content/browser/ssl/ssl_manager.cc b/content/browser/ssl/ssl_manager.cc
index 9e309fe24aa5d071cb4a0e184e4e21edbe0e5abd..c9cf39e41a3ef946a2da5e68694fa775539cb9e6 100644
--- a/content/browser/ssl/ssl_manager.cc
+++ b/content/browser/ssl/ssl_manager.cc
@@ -184,14 +184,14 @@ void SSLManager::DidCommitProvisionalLoad(const LoadCommittedDetails& details) {
content_status_flags = previous_entry->GetSSL().content_status;
}
}
- UpdateEntry(entry, content_status_flags);
+ UpdateEntry(entry, content_status_flags, 0);
// Always notify the WebContents that the SSL state changed when a
// load is committed, in case the active navigation entry has changed.
NotifyDidChangeVisibleSSLState();
}
void SSLManager::DidDisplayMixedContent() {
- UpdateLastCommittedEntry(SSLStatus::DISPLAYED_INSECURE_CONTENT);
+ UpdateLastCommittedEntry(SSLStatus::DISPLAYED_INSECURE_CONTENT, 0);
}
void SSLManager::DidDisplayContentWithCertErrors() {
@@ -201,16 +201,20 @@ void SSLManager::DidDisplayContentWithCertErrors() {
// Only record information about subresources with cert errors if the
// main page is HTTPS with a certificate.
if (entry->GetURL().SchemeIsCryptographic() && entry->GetSSL().certificate) {
- UpdateLastCommittedEntry(SSLStatus::DISPLAYED_CONTENT_WITH_CERT_ERRORS);
+ UpdateLastCommittedEntry(SSLStatus::DISPLAYED_CONTENT_WITH_CERT_ERRORS, 0);
}
}
void SSLManager::DidShowPasswordInputOnHttp() {
- UpdateLastCommittedEntry(SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP);
+ UpdateLastCommittedEntry(SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP, 0);
+}
+
+void SSLManager::DidHideAllPasswordInputsOnHttp() {
+ UpdateLastCommittedEntry(0, SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP);
}
void SSLManager::DidShowCreditCardInputOnHttp() {
- UpdateLastCommittedEntry(SSLStatus::DISPLAYED_CREDIT_CARD_FIELD_ON_HTTP);
+ UpdateLastCommittedEntry(SSLStatus::DISPLAYED_CREDIT_CARD_FIELD_ON_HTTP, 0);
}
void SSLManager::DidRunMixedContent(const GURL& security_origin) {
@@ -227,7 +231,7 @@ void SSLManager::DidRunMixedContent(const GURL& security_origin) {
security_origin.host(), site_instance->GetProcess()->GetID(),
SSLHostStateDelegate::MIXED_CONTENT);
}
- UpdateEntry(entry, 0);
+ UpdateEntry(entry, 0, 0);
NotifySSLInternalStateChanged(controller_->GetBrowserContext());
}
@@ -245,7 +249,7 @@ void SSLManager::DidRunContentWithCertErrors(const GURL& security_origin) {
security_origin.host(), site_instance->GetProcess()->GetID(),
SSLHostStateDelegate::CERT_ERRORS_CONTENT);
}
- UpdateEntry(entry, 0);
+ UpdateEntry(entry, 0, 0);
NotifySSLInternalStateChanged(controller_->GetBrowserContext());
}
@@ -358,7 +362,8 @@ void SSLManager::OnCertErrorInternal(std::unique_ptr<SSLErrorHandler> handler,
}
void SSLManager::UpdateEntry(NavigationEntryImpl* entry,
- int additional_content_status_flags) {
+ int add_content_status_flags,
+ int remove_content_status_flags) {
// We don't always have a navigation entry to update, for example in the
// case of the Web Inspector.
if (!entry)
@@ -366,7 +371,8 @@ void SSLManager::UpdateEntry(NavigationEntryImpl* entry,
SSLStatus original_ssl_status = entry->GetSSL(); // Copy!
entry->GetSSL().initialized = true;
- entry->GetSSL().content_status |= additional_content_status_flags;
+ entry->GetSSL().content_status |= add_content_status_flags;
+ entry->GetSSL().content_status &= ~remove_content_status_flags;
SiteInstance* site_instance = entry->site_instance();
// Note that |site_instance| can be NULL here because NavigationEntries don't
@@ -394,11 +400,12 @@ void SSLManager::UpdateEntry(NavigationEntryImpl* entry,
NotifyDidChangeVisibleSSLState();
}
-void SSLManager::UpdateLastCommittedEntry(int additional_content_status_flags) {
+void SSLManager::UpdateLastCommittedEntry(int add_content_status_flags,
+ int remove_content_status_flags) {
NavigationEntryImpl* entry = controller_->GetLastCommittedEntry();
if (!entry)
return;
- UpdateEntry(entry, additional_content_status_flags);
+ UpdateEntry(entry, add_content_status_flags, remove_content_status_flags);
}
void SSLManager::NotifyDidChangeVisibleSSLState() {
@@ -414,7 +421,7 @@ void SSLManager::NotifySSLInternalStateChanged(BrowserContext* context) {
for (std::set<SSLManager*>::iterator i = managers->get().begin();
i != managers->get().end(); ++i) {
- (*i)->UpdateEntry((*i)->controller()->GetLastCommittedEntry(), 0);
+ (*i)->UpdateEntry((*i)->controller()->GetLastCommittedEntry(), 0, 0);
}
}
« no previous file with comments | « content/browser/ssl/ssl_manager.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698