Index: chrome/browser/ui/toolbar/toolbar_model_impl.cc |
diff --git a/chrome/browser/ui/toolbar/toolbar_model_impl.cc b/chrome/browser/ui/toolbar/toolbar_model_impl.cc |
index 6f2c5426d247e77bf1e0c3b93f1f6073b77d20e7..794b863ca5c54bba32c23434c9f641c06eaf1c68 100644 |
--- a/chrome/browser/ui/toolbar/toolbar_model_impl.cc |
+++ b/chrome/browser/ui/toolbar/toolbar_model_impl.cc |
@@ -10,7 +10,7 @@ |
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/search/search.h" |
-#include "chrome/browser/ssl/connection_security.h" |
+#include "chrome/browser/ssl/security_state_model.h" |
#include "chrome/browser/ui/toolbar/toolbar_model_delegate.h" |
#include "chrome/common/pref_names.h" |
#include "chrome/common/url_constants.h" |
@@ -109,13 +109,18 @@ bool ToolbarModelImpl::WouldPerformSearchTermReplacement( |
return !GetSearchTerms(ignore_editing).empty(); |
} |
-connection_security::SecurityLevel ToolbarModelImpl::GetSecurityLevel( |
+SecurityStateModel::SecurityLevel ToolbarModelImpl::GetSecurityLevel( |
bool ignore_editing) const { |
+ SecurityStateModel* model(nullptr); |
+ if (delegate_->GetActiveWebContents()) { |
+ model = |
+ SecurityStateModel::FromWebContents(delegate_->GetActiveWebContents()); |
+ } |
+ |
// When editing, assume no security style. |
- return (input_in_progress() && !ignore_editing) |
- ? connection_security::NONE |
- : connection_security::GetSecurityLevelForWebContents( |
- delegate_->GetActiveWebContents()); |
+ return ((input_in_progress() && !ignore_editing) || !model) |
+ ? SecurityStateModel::NONE |
+ : model->security_info().security_level; |
} |
int ToolbarModelImpl::GetIcon() const { |
@@ -126,19 +131,19 @@ int ToolbarModelImpl::GetIcon() const { |
} |
int ToolbarModelImpl::GetIconForSecurityLevel( |
- connection_security::SecurityLevel level) const { |
+ SecurityStateModel::SecurityLevel level) const { |
switch (level) { |
- case connection_security::NONE: |
+ case SecurityStateModel::NONE: |
return IDR_LOCATION_BAR_HTTP; |
- case connection_security::EV_SECURE: |
- case connection_security::SECURE: |
+ case SecurityStateModel::EV_SECURE: |
+ case SecurityStateModel::SECURE: |
return IDR_OMNIBOX_HTTPS_VALID; |
- case connection_security::SECURITY_WARNING: |
+ case SecurityStateModel::SECURITY_WARNING: |
// Surface Dubious as Neutral. |
return IDR_LOCATION_BAR_HTTP; |
- case connection_security::SECURITY_POLICY_WARNING: |
+ case SecurityStateModel::SECURITY_POLICY_WARNING: |
return IDR_OMNIBOX_HTTPS_POLICY_WARNING; |
- case connection_security::SECURITY_ERROR: |
+ case SecurityStateModel::SECURITY_ERROR: |
return IDR_OMNIBOX_HTTPS_INVALID; |
} |
@@ -147,7 +152,7 @@ int ToolbarModelImpl::GetIconForSecurityLevel( |
} |
base::string16 ToolbarModelImpl::GetEVCertName() const { |
- if (GetSecurityLevel(false) != connection_security::EV_SECURE) |
+ if (GetSecurityLevel(false) != SecurityStateModel::EV_SECURE) |
return base::string16(); |
// Note: Navigation controller and active entry are guaranteed non-NULL or |
@@ -240,10 +245,10 @@ base::string16 ToolbarModelImpl::GetSearchTerms(bool ignore_editing) const { |
// Otherwise, extract search terms for HTTPS pages that do not have a security |
// error. |
- connection_security::SecurityLevel security_level = |
+ SecurityStateModel::SecurityLevel security_level = |
GetSecurityLevel(ignore_editing); |
- return ((security_level == connection_security::NONE) || |
- (security_level == connection_security::SECURITY_ERROR)) |
+ return ((security_level == SecurityStateModel::NONE) || |
+ (security_level == SecurityStateModel::SECURITY_ERROR)) |
? base::string16() |
: search_terms; |
} |