| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/ssl/ssl_policy.h" | 5 #include "content/browser/ssl/ssl_policy.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // possibly have insecure content. See bug http://crbug.com/12423. | 146 // possibly have insecure content. See bug http://crbug.com/12423. |
| 147 if (site_instance && | 147 if (site_instance && |
| 148 backend_->DidHostRunInsecureContent( | 148 backend_->DidHostRunInsecureContent( |
| 149 entry->url().host(), site_instance->GetProcess()->GetID())) { | 149 entry->url().host(), site_instance->GetProcess()->GetID())) { |
| 150 entry->ssl().set_security_style( | 150 entry->ssl().set_security_style( |
| 151 content::SECURITY_STYLE_AUTHENTICATION_BROKEN); | 151 content::SECURITY_STYLE_AUTHENTICATION_BROKEN); |
| 152 entry->ssl().set_ran_insecure_content(); | 152 entry->ssl().set_ran_insecure_content(); |
| 153 return; | 153 return; |
| 154 } | 154 } |
| 155 | 155 |
| 156 if (tab_contents->displayed_insecure_content()) | 156 if (tab_contents->DisplayedInsecureContent()) |
| 157 entry->ssl().set_displayed_insecure_content(); | 157 entry->ssl().set_displayed_insecure_content(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void SSLPolicy::OnAllowCertificate(SSLCertErrorHandler* handler, bool allow) { | 160 void SSLPolicy::OnAllowCertificate(SSLCertErrorHandler* handler, bool allow) { |
| 161 if (allow) { | 161 if (allow) { |
| 162 // Default behavior for accepting a certificate. | 162 // Default behavior for accepting a certificate. |
| 163 // Note that we should not call SetMaxSecurityStyle here, because the active | 163 // Note that we should not call SetMaxSecurityStyle here, because the active |
| 164 // NavigationEntry has just been deleted (in HideInterstitialPage) and the | 164 // NavigationEntry has just been deleted (in HideInterstitialPage) and the |
| 165 // new NavigationEntry will not be set until DidNavigate. This is ok, | 165 // new NavigationEntry will not be set until DidNavigate. This is ok, |
| 166 // because the new NavigationEntry will have its max security style set | 166 // because the new NavigationEntry will have its max security style set |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 entry->ssl().set_security_style(entry->url().SchemeIsSecure() ? | 211 entry->ssl().set_security_style(entry->url().SchemeIsSecure() ? |
| 212 content::SECURITY_STYLE_AUTHENTICATED : | 212 content::SECURITY_STYLE_AUTHENTICATED : |
| 213 content::SECURITY_STYLE_UNAUTHENTICATED); | 213 content::SECURITY_STYLE_UNAUTHENTICATED); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { | 216 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { |
| 217 GURL parsed_origin(origin); | 217 GURL parsed_origin(origin); |
| 218 if (parsed_origin.SchemeIsSecure()) | 218 if (parsed_origin.SchemeIsSecure()) |
| 219 backend_->HostRanInsecureContent(parsed_origin.host(), pid); | 219 backend_->HostRanInsecureContent(parsed_origin.host(), pid); |
| 220 } | 220 } |
| OLD | NEW |