summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl_manager.cc
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-19 15:42:20 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-19 15:42:20 +0000
commiteb34392be36ea2948f39bd22a6beae19e0b0bd24 (patch)
treeb5b4e701a3c0e01cc4a2be2ac8c2b798c472cab6 /chrome/browser/ssl_manager.cc
parentd499ed582b58cf676becdc97ca7280861a9483b0 (diff)
downloadchromium_src-eb34392be36ea2948f39bd22a6beae19e0b0bd24.zip
chromium_src-eb34392be36ea2948f39bd22a6beae19e0b0bd24.tar.gz
chromium_src-eb34392be36ea2948f39bd22a6beae19e0b0bd24.tar.bz2
Factor the SSL state out of the main NavigationEntry into a helper class. This
makes it easier to find stuff and also copy ssl state (just assign). I made one "real" change in web_contents where I copy the entire SSL state now to the new entry rather than just a few fields like the old one. I couldn't figure out why this was necessary: running it shows that this leaves the other two fields in the uninitialized state which seems wrong. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1032 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ssl_manager.cc')
-rw-r--r--chrome/browser/ssl_manager.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/chrome/browser/ssl_manager.cc b/chrome/browser/ssl_manager.cc
index 0e9b16a..be58f24 100644
--- a/chrome/browser/ssl_manager.cc
+++ b/chrome/browser/ssl_manager.cc
@@ -213,7 +213,7 @@ void SSLManager::ShowMessageWithLink(const std::wstring& msg,
return;
// Don't show the message if the user doesn't expect an authenticated session.
- if (entry->GetSecurityStyle() <= SECURITY_STYLE_UNAUTHENTICATED)
+ if (entry->ssl().security_style() <= SECURITY_STYLE_UNAUTHENTICATED)
return;
InfoBarView* info_bar_view =
@@ -247,8 +247,8 @@ void SSLManager::SetMaxSecurityStyle(SecurityStyle style) {
return;
}
- if (entry->GetSecurityStyle() > style) {
- entry->SetSecurityStyle(style);
+ if (entry->ssl().security_style() > style) {
+ entry->ssl().set_security_style(style);
controller_->EntryUpdated(entry);
}
}
@@ -261,7 +261,7 @@ void SSLManager::AddMessageToConsole(const std::wstring& msg,
if (!web_contents)
return;
- web_contents->AddMessageToConsole(L"", msg, level);
+ web_contents->AddMessageToConsole(std::wstring(), msg, level);
}
@@ -310,7 +310,7 @@ bool SSLManager::ProcessedSSLErrorFromRequest() const {
return false;
}
- return net::IsCertStatusError(entry->GetSSLCertStatus());
+ return net::IsCertStatusError(entry->ssl().cert_status());
}
////////////////////////////////////////////////////////////////////////////////
@@ -603,8 +603,10 @@ void SSLManager::InitializeEntryIfNeeded(NavigationEntry* entry) {
// If the security style of the entry is SECURITY_STYLE_UNKNOWN, then it is a
// fresh entry and should get the default style.
- if (entry->GetSecurityStyle() == SECURITY_STYLE_UNKNOWN)
- entry->SetSecurityStyle(delegate()->GetDefaultStyle(entry->GetURL()));
+ if (entry->ssl().security_style() == SECURITY_STYLE_UNKNOWN) {
+ entry->ssl().set_security_style(
+ delegate()->GetDefaultStyle(entry->GetURL()));
+ }
}
void SSLManager::NavigationStateChanged() {
@@ -648,11 +650,11 @@ void SSLManager::DidCommitProvisionalLoad(ProvisionalLoadDetails* details) {
NavigationEntry* entry = controller_->GetActiveEntry();
if (entry) {
// We may not have an entry if this is a navigation to an initial blank
- // page.
- entry->ResetSSLStates(); // Clears mixed/unsafe content state.
- entry->SetSSLCertID(details->ssl_cert_id());
- entry->SetSSLCertStatus(details->ssl_cert_status());
- entry->SetSSLSecurityBits(details->ssl_security_bits());
+ // page. Reset the SSL information and add the new data we have.
+ entry->ssl() = NavigationEntry::SSLStatus();
+ entry->ssl().set_cert_id(details->ssl_cert_id());
+ entry->ssl().set_cert_status(details->ssl_cert_status());
+ entry->ssl().set_security_bits(details->ssl_security_bits());
controller_->EntryUpdated(entry);
}