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

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

Issue 7976036: net: make HSTS hosts use the normal SSL interstitials (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 2 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
« no previous file with comments | « content/browser/ssl/ssl_manager.h ('k') | content/browser/ssl/ssl_policy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_manager.h" 5 #include "content/browser/ssl/ssl_manager.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "content/browser/browser_thread.h" 8 #include "content/browser/browser_thread.h"
9 #include "content/browser/load_from_memory_cache_details.h" 9 #include "content/browser/load_from_memory_cache_details.h"
10 #include "content/browser/renderer_host/resource_dispatcher_host.h" 10 #include "content/browser/renderer_host/resource_dispatcher_host.h"
11 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" 11 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
12 #include "content/browser/renderer_host/resource_request_details.h" 12 #include "content/browser/renderer_host/resource_request_details.h"
13 #include "content/browser/ssl/ssl_cert_error_handler.h" 13 #include "content/browser/ssl/ssl_cert_error_handler.h"
14 #include "content/browser/ssl/ssl_policy.h" 14 #include "content/browser/ssl/ssl_policy.h"
15 #include "content/browser/ssl/ssl_request_info.h" 15 #include "content/browser/ssl/ssl_request_info.h"
16 #include "content/browser/tab_contents/navigation_details.h" 16 #include "content/browser/tab_contents/navigation_details.h"
17 #include "content/browser/tab_contents/navigation_entry.h" 17 #include "content/browser/tab_contents/navigation_entry.h"
18 #include "content/browser/tab_contents/provisional_load_details.h" 18 #include "content/browser/tab_contents/provisional_load_details.h"
19 #include "content/browser/tab_contents/tab_contents.h" 19 #include "content/browser/tab_contents/tab_contents.h"
20 #include "content/common/notification_service.h" 20 #include "content/common/notification_service.h"
21 #include "content/common/notification_source.h" 21 #include "content/common/notification_source.h"
22 #include "net/base/cert_status_flags.h" 22 #include "net/base/cert_status_flags.h"
23 23
24 // static 24 // static
25 void SSLManager::OnSSLCertificateError(ResourceDispatcherHost* rdh, 25 void SSLManager::OnSSLCertificateError(ResourceDispatcherHost* rdh,
26 net::URLRequest* request, 26 net::URLRequest* request,
27 int cert_error, 27 const net::SSLInfo& ssl_info,
28 net::X509Certificate* cert) { 28 bool is_hsts_host) {
29 DVLOG(1) << "OnSSLCertificateError() cert_error: " << cert_error 29 DVLOG(1) << "OnSSLCertificateError() cert_error: "
30 << " url: " << request->url().spec(); 30 << net::MapCertStatusToNetError(ssl_info.cert_status)
31 << " url: " << request->url().spec()
32 << " cert_status: " << std::hex << ssl_info.cert_status;
31 33
32 ResourceDispatcherHostRequestInfo* info = 34 ResourceDispatcherHostRequestInfo* info =
33 ResourceDispatcherHost::InfoForRequest(request); 35 ResourceDispatcherHost::InfoForRequest(request);
34 36
35 // A certificate error occurred. Construct a SSLCertErrorHandler object and 37 // A certificate error occurred. Construct a SSLCertErrorHandler object and
36 // hand it over to the UI thread for processing. 38 // hand it over to the UI thread for processing.
37 BrowserThread::PostTask( 39 BrowserThread::PostTask(
38 BrowserThread::UI, FROM_HERE, 40 BrowserThread::UI, FROM_HERE,
39 NewRunnableMethod(new SSLCertErrorHandler(rdh, 41 NewRunnableMethod(new SSLCertErrorHandler(rdh,
40 request, 42 request,
41 info->resource_type(), 43 info->resource_type(),
42 cert_error, 44 ssl_info,
43 cert), 45 is_hsts_host),
44 &SSLCertErrorHandler::Dispatch)); 46 &SSLCertErrorHandler::Dispatch));
45 } 47 }
46 48
47 // static 49 // static
48 void SSLManager::NotifySSLInternalStateChanged( 50 void SSLManager::NotifySSLInternalStateChanged(
49 NavigationController* controller) { 51 NavigationController* controller) {
50 NotificationService::current()->Notify( 52 NotificationService::current()->Notify(
51 content::NOTIFICATION_SSL_INTERNAL_STATE_CHANGED, 53 content::NOTIFICATION_SSL_INTERNAL_STATE_CHANGED,
52 Source<content::BrowserContext>(controller->browser_context()), 54 Source<content::BrowserContext>(controller->browser_context()),
53 NotificationService::NoDetails()); 55 NotificationService::NoDetails());
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 244
243 policy()->UpdateEntry(entry, controller_->tab_contents()); 245 policy()->UpdateEntry(entry, controller_->tab_contents());
244 246
245 if (!entry->ssl().Equals(original_ssl_status)) { 247 if (!entry->ssl().Equals(original_ssl_status)) {
246 NotificationService::current()->Notify( 248 NotificationService::current()->Notify(
247 content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED, 249 content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED,
248 Source<NavigationController>(controller_), 250 Source<NavigationController>(controller_),
249 NotificationService::NoDetails()); 251 NotificationService::NoDetails());
250 } 252 }
251 } 253 }
OLDNEW
« no previous file with comments | « content/browser/ssl/ssl_manager.h ('k') | content/browser/ssl/ssl_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698