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

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, 3 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) 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 int cert_error,
28 net::X509Certificate* cert) { 28 const net::SSLInfo& ssl_info,
29 bool must_be_fatal) {
29 DVLOG(1) << "OnSSLCertificateError() cert_error: " << cert_error 30 DVLOG(1) << "OnSSLCertificateError() cert_error: " << cert_error
30 << " url: " << request->url().spec(); 31 << " url: " << request->url().spec();
31 32
32 ResourceDispatcherHostRequestInfo* info = 33 ResourceDispatcherHostRequestInfo* info =
33 ResourceDispatcherHost::InfoForRequest(request); 34 ResourceDispatcherHost::InfoForRequest(request);
34 35
35 // A certificate error occurred. Construct a SSLCertErrorHandler object and 36 // A certificate error occurred. Construct a SSLCertErrorHandler object and
36 // hand it over to the UI thread for processing. 37 // hand it over to the UI thread for processing.
37 BrowserThread::PostTask( 38 BrowserThread::PostTask(
38 BrowserThread::UI, FROM_HERE, 39 BrowserThread::UI, FROM_HERE,
39 NewRunnableMethod(new SSLCertErrorHandler(rdh, 40 NewRunnableMethod(new SSLCertErrorHandler(rdh,
40 request, 41 request,
41 info->resource_type(), 42 info->resource_type(),
42 cert_error, 43 cert_error,
43 cert), 44 ssl_info,
45 must_be_fatal),
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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 242
241 policy()->UpdateEntry(entry, controller_->tab_contents()); 243 policy()->UpdateEntry(entry, controller_->tab_contents());
242 244
243 if (!entry->ssl().Equals(original_ssl_status)) { 245 if (!entry->ssl().Equals(original_ssl_status)) {
244 NotificationService::current()->Notify( 246 NotificationService::current()->Notify(
245 content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED, 247 content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED,
246 Source<NavigationController>(controller_), 248 Source<NavigationController>(controller_),
247 NotificationService::NoDetails()); 249 NotificationService::NoDetails());
248 } 250 }
249 } 251 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698