OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/toolbar_model.h" | 5 #include "chrome/browser/toolbar_model.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
9 #include "chrome/browser/cert_store.h" | 9 #include "chrome/browser/cert_store.h" |
10 #include "chrome/browser/pref_service.h" | 10 #include "chrome/browser/pref_service.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 const NavigationEntry::SSLStatus& ssl = entry->ssl(); | 72 const NavigationEntry::SSLStatus& ssl = entry->ssl(); |
73 switch (ssl.security_style()) { | 73 switch (ssl.security_style()) { |
74 case SECURITY_STYLE_UNKNOWN: | 74 case SECURITY_STYLE_UNKNOWN: |
75 case SECURITY_STYLE_UNAUTHENTICATED: | 75 case SECURITY_STYLE_UNAUTHENTICATED: |
76 return NONE; | 76 return NONE; |
77 | 77 |
78 case SECURITY_STYLE_AUTHENTICATION_BROKEN: | 78 case SECURITY_STYLE_AUTHENTICATION_BROKEN: |
79 return SECURITY_ERROR; | 79 return SECURITY_ERROR; |
80 | 80 |
81 case SECURITY_STYLE_AUTHENTICATED: | 81 case SECURITY_STYLE_AUTHENTICATED: |
82 if (ssl.has_mixed_content()) | 82 if (ssl.displayed_mixed_content()) |
83 return SECURITY_WARNING; | 83 return SECURITY_WARNING; |
84 if (net::IsCertStatusError(ssl.cert_status())) { | 84 if (net::IsCertStatusError(ssl.cert_status())) { |
85 DCHECK_EQ(ssl.cert_status() & net::CERT_STATUS_ALL_ERRORS, | 85 DCHECK_EQ(ssl.cert_status() & net::CERT_STATUS_ALL_ERRORS, |
86 net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION); | 86 net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION); |
87 return SECURITY_WARNING; | 87 return SECURITY_WARNING; |
88 } | 88 } |
89 if ((ssl.cert_status() & net::CERT_STATUS_IS_EV) && | 89 if ((ssl.cert_status() & net::CERT_STATUS_IS_EV) && |
90 CertStore::GetSharedInstance()->RetrieveCert(ssl.cert_id(), NULL)) | 90 CertStore::GetSharedInstance()->RetrieveCert(ssl.cert_id(), NULL)) |
91 return EV_SECURE; | 91 return EV_SECURE; |
92 return SECURE; | 92 return SECURE; |
(...skipping 26 matching lines...) Expand all Loading... |
119 return SSLManager::GetEVCertName(*cert); | 119 return SSLManager::GetEVCertName(*cert); |
120 } | 120 } |
121 | 121 |
122 NavigationController* ToolbarModel::GetNavigationController() const { | 122 NavigationController* ToolbarModel::GetNavigationController() const { |
123 // This |current_tab| can be NULL during the initialization of the | 123 // This |current_tab| can be NULL during the initialization of the |
124 // toolbar during window creation (i.e. before any tabs have been added | 124 // toolbar during window creation (i.e. before any tabs have been added |
125 // to the window). | 125 // to the window). |
126 TabContents* current_tab = browser_->GetSelectedTabContents(); | 126 TabContents* current_tab = browser_->GetSelectedTabContents(); |
127 return current_tab ? ¤t_tab->controller() : NULL; | 127 return current_tab ? ¤t_tab->controller() : NULL; |
128 } | 128 } |
OLD | NEW |