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

Side by Side Diff: content/browser/ssl/ssl_policy.cc

Issue 10082021: TabContents -> WebContentsImpl, part 13. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, fix references Created 8 years, 8 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 void SSLPolicy::OnRequestStarted(SSLRequestInfo* info) { 104 void SSLPolicy::OnRequestStarted(SSLRequestInfo* info) {
105 // TODO(abarth): This mechanism is wrong. What we should be doing is sending 105 // TODO(abarth): This mechanism is wrong. What we should be doing is sending
106 // this information back through WebKit and out some FrameLoaderClient 106 // this information back through WebKit and out some FrameLoaderClient
107 // methods. 107 // methods.
108 108
109 if (net::IsCertStatusError(info->ssl_cert_status())) 109 if (net::IsCertStatusError(info->ssl_cert_status()))
110 backend_->HostRanInsecureContent(info->url().host(), info->child_id()); 110 backend_->HostRanInsecureContent(info->url().host(), info->child_id());
111 } 111 }
112 112
113 void SSLPolicy::UpdateEntry(NavigationEntryImpl* entry, 113 void SSLPolicy::UpdateEntry(NavigationEntryImpl* entry,
114 TabContents* tab_contents) { 114 WebContentsImpl* web_contents) {
115 DCHECK(entry); 115 DCHECK(entry);
116 116
117 InitializeEntryIfNeeded(entry); 117 InitializeEntryIfNeeded(entry);
118 118
119 if (!entry->GetURL().SchemeIsSecure()) 119 if (!entry->GetURL().SchemeIsSecure())
120 return; 120 return;
121 121
122 // An HTTPS response may not have a certificate for some reason. When that 122 // An HTTPS response may not have a certificate for some reason. When that
123 // happens, use the unauthenticated (HTTP) rather than the authentication 123 // happens, use the unauthenticated (HTTP) rather than the authentication
124 // broken security style so that we can detect this error condition. 124 // broken security style so that we can detect this error condition.
(...skipping 26 matching lines...) Expand all
151 // possibly have insecure content. See bug http://crbug.com/12423. 151 // possibly have insecure content. See bug http://crbug.com/12423.
152 if (site_instance && 152 if (site_instance &&
153 backend_->DidHostRunInsecureContent( 153 backend_->DidHostRunInsecureContent(
154 entry->GetURL().host(), site_instance->GetProcess()->GetID())) { 154 entry->GetURL().host(), site_instance->GetProcess()->GetID())) {
155 entry->GetSSL().security_style = 155 entry->GetSSL().security_style =
156 content::SECURITY_STYLE_AUTHENTICATION_BROKEN; 156 content::SECURITY_STYLE_AUTHENTICATION_BROKEN;
157 entry->GetSSL().content_status |= SSLStatus::RAN_INSECURE_CONTENT; 157 entry->GetSSL().content_status |= SSLStatus::RAN_INSECURE_CONTENT;
158 return; 158 return;
159 } 159 }
160 160
161 if (tab_contents->DisplayedInsecureContent()) 161 if (web_contents->DisplayedInsecureContent())
162 entry->GetSSL().content_status |= SSLStatus::DISPLAYED_INSECURE_CONTENT; 162 entry->GetSSL().content_status |= SSLStatus::DISPLAYED_INSECURE_CONTENT;
163 } 163 }
164 164
165 void SSLPolicy::OnAllowCertificate(scoped_refptr<SSLCertErrorHandler> handler, 165 void SSLPolicy::OnAllowCertificate(scoped_refptr<SSLCertErrorHandler> handler,
166 bool allow) { 166 bool allow) {
167 if (allow) { 167 if (allow) {
168 // Default behavior for accepting a certificate. 168 // Default behavior for accepting a certificate.
169 // Note that we should not call SetMaxSecurityStyle here, because the active 169 // Note that we should not call SetMaxSecurityStyle here, because the active
170 // NavigationEntry has just been deleted (in HideInterstitialPage) and the 170 // NavigationEntry has just been deleted (in HideInterstitialPage) and the
171 // new NavigationEntry will not be set until DidNavigate. This is ok, 171 // new NavigationEntry will not be set until DidNavigate. This is ok,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 entry->GetSSL().security_style = entry->GetURL().SchemeIsSecure() ? 226 entry->GetSSL().security_style = entry->GetURL().SchemeIsSecure() ?
227 content::SECURITY_STYLE_AUTHENTICATED : 227 content::SECURITY_STYLE_AUTHENTICATED :
228 content::SECURITY_STYLE_UNAUTHENTICATED; 228 content::SECURITY_STYLE_UNAUTHENTICATED;
229 } 229 }
230 230
231 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { 231 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) {
232 GURL parsed_origin(origin); 232 GURL parsed_origin(origin);
233 if (parsed_origin.SchemeIsSecure()) 233 if (parsed_origin.SchemeIsSecure())
234 backend_->HostRanInsecureContent(parsed_origin.host(), pid); 234 backend_->HostRanInsecureContent(parsed_origin.host(), pid);
235 } 235 }
OLDNEW
« no previous file with comments | « content/browser/site_instance_impl_unittest.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698