| 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/ssl/ssl_manager.h" | 5 #include "chrome/browser/ssl/ssl_manager.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/browser_thread.h" | 9 #include "chrome/browser/browser_thread.h" |
| 10 #include "chrome/browser/load_from_memory_cache_details.h" | 10 #include "chrome/browser/load_from_memory_cache_details.h" |
| 11 #include "chrome/browser/net/url_request_tracking.h" | 11 #include "chrome/browser/net/url_request_tracking.h" |
| 12 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
| 13 #include "chrome/browser/renderer_host/resource_request_details.h" | 13 #include "chrome/browser/renderer_host/resource_request_details.h" |
| 14 #include "chrome/browser/ssl/ssl_cert_error_handler.h" | 14 #include "chrome/browser/ssl/ssl_cert_error_handler.h" |
| 15 #include "chrome/browser/ssl/ssl_policy.h" | 15 #include "chrome/browser/ssl/ssl_policy.h" |
| 16 #include "chrome/browser/ssl/ssl_request_info.h" | 16 #include "chrome/browser/ssl/ssl_request_info.h" |
| 17 #include "chrome/browser/tab_contents/navigation_controller.h" | 17 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 18 #include "chrome/browser/tab_contents/navigation_entry.h" | 18 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 19 #include "chrome/browser/tab_contents/provisional_load_details.h" | 19 #include "chrome/browser/tab_contents/provisional_load_details.h" |
| 20 #include "chrome/common/notification_service.h" | 20 #include "chrome/common/notification_service.h" |
| 21 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
| 22 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
| 23 #include "net/base/cert_status_flags.h" | 23 #include "net/base/cert_status_flags.h" |
| 24 | 24 |
| 25 // static | 25 // static |
| 26 void SSLManager::OnSSLCertificateError(ResourceDispatcherHost* rdh, | 26 void SSLManager::OnSSLCertificateError(ResourceDispatcherHost* rdh, |
| 27 URLRequest* request, | 27 net::URLRequest* request, |
| 28 int cert_error, | 28 int cert_error, |
| 29 net::X509Certificate* cert) { | 29 net::X509Certificate* cert) { |
| 30 DVLOG(1) << "OnSSLCertificateError() cert_error: " << cert_error | 30 DVLOG(1) << "OnSSLCertificateError() cert_error: " << cert_error |
| 31 << " url: " << request->url().spec(); | 31 << " url: " << request->url().spec(); |
| 32 | 32 |
| 33 ResourceDispatcherHostRequestInfo* info = | 33 ResourceDispatcherHostRequestInfo* info = |
| 34 ResourceDispatcherHost::InfoForRequest(request); | 34 ResourceDispatcherHost::InfoForRequest(request); |
| 35 DCHECK(info); | 35 DCHECK(info); |
| 36 | 36 |
| 37 // A certificate error occurred. Construct a SSLCertErrorHandler object and | 37 // A certificate error occurred. Construct a SSLCertErrorHandler object and |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 264 |
| 265 policy()->UpdateEntry(entry, controller_->tab_contents()); | 265 policy()->UpdateEntry(entry, controller_->tab_contents()); |
| 266 | 266 |
| 267 if (!entry->ssl().Equals(original_ssl_status)) { | 267 if (!entry->ssl().Equals(original_ssl_status)) { |
| 268 NotificationService::current()->Notify( | 268 NotificationService::current()->Notify( |
| 269 NotificationType::SSL_VISIBLE_STATE_CHANGED, | 269 NotificationType::SSL_VISIBLE_STATE_CHANGED, |
| 270 Source<NavigationController>(controller_), | 270 Source<NavigationController>(controller_), |
| 271 NotificationService::NoDetails()); | 271 NotificationService::NoDetails()); |
| 272 } | 272 } |
| 273 } | 273 } |
| OLD | NEW |