| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_manager.h" | 5 #include "chrome/browser/ssl_manager.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/app/theme/theme_resources.h" | 9 #include "chrome/app/theme/theme_resources.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 URLRequest* request, | 461 URLRequest* request, |
| 462 MessageLoop* ui_loop) { | 462 MessageLoop* ui_loop) { |
| 463 ui_loop->PostTask(FROM_HERE, | 463 ui_loop->PostTask(FROM_HERE, |
| 464 NewRunnableMethod(new MixedContentHandler(rdh, request, ui_loop), | 464 NewRunnableMethod(new MixedContentHandler(rdh, request, ui_loop), |
| 465 &MixedContentHandler::Dispatch)); | 465 &MixedContentHandler::Dispatch)); |
| 466 } | 466 } |
| 467 | 467 |
| 468 void SSLManager::OnCertError(CertError* error) { | 468 void SSLManager::OnCertError(CertError* error) { |
| 469 // Ask our delegate to deal with the error. | 469 // Ask our delegate to deal with the error. |
| 470 NavigationEntry* entry = controller_->GetActiveEntry(); | 470 NavigationEntry* entry = controller_->GetActiveEntry(); |
| 471 // We might not have a navigation entry in some cases (e.g. when a |
| 472 // HTTPS page opens a popup with no URL and then populate it with |
| 473 // document.write()). See bug http://crbug.com/3845. |
| 474 if (!entry) |
| 475 return; |
| 476 |
| 471 delegate()->OnCertError(entry->url(), error); | 477 delegate()->OnCertError(entry->url(), error); |
| 472 } | 478 } |
| 473 | 479 |
| 474 void SSLManager::OnMixedContent(MixedContentHandler* mixed_content) { | 480 void SSLManager::OnMixedContent(MixedContentHandler* mixed_content) { |
| 475 // Ask our delegate to deal with the mixed content. | 481 // Ask our delegate to deal with the mixed content. |
| 476 NavigationEntry* entry = controller_->GetActiveEntry(); | 482 NavigationEntry* entry = controller_->GetActiveEntry(); |
| 483 // We might not have a navigation entry in some cases (e.g. when a |
| 484 // HTTPS page opens a popup with no URL and then populate it with |
| 485 // document.write()). See bug http://crbug.com/3845. |
| 486 if (!entry) |
| 487 return; |
| 488 |
| 477 delegate()->OnMixedContent(controller_, entry->url(), mixed_content); | 489 delegate()->OnMixedContent(controller_, entry->url(), mixed_content); |
| 478 } | 490 } |
| 479 | 491 |
| 480 void SSLManager::Observe(NotificationType type, | 492 void SSLManager::Observe(NotificationType type, |
| 481 const NotificationSource& source, | 493 const NotificationSource& source, |
| 482 const NotificationDetails& details) { | 494 const NotificationDetails& details) { |
| 483 // We should only be getting notifications from our controller. | 495 // We should only be getting notifications from our controller. |
| 484 DCHECK(source == Source<NavigationController>(controller_)); | 496 DCHECK(source == Source<NavigationController>(controller_)); |
| 485 | 497 |
| 486 // Dispatch by type. | 498 // Dispatch by type. |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 | 716 |
| 705 if (ca_name) { | 717 if (ca_name) { |
| 706 // TODO(wtc): should we show the root CA's name instead? | 718 // TODO(wtc): should we show the root CA's name instead? |
| 707 *ca_name = l10n_util::GetStringF( | 719 *ca_name = l10n_util::GetStringF( |
| 708 IDS_SECURE_CONNECTION_EV_CA, | 720 IDS_SECURE_CONNECTION_EV_CA, |
| 709 UTF8ToWide(cert.issuer().organization_names[0])); | 721 UTF8ToWide(cert.issuer().organization_names[0])); |
| 710 } | 722 } |
| 711 return true; | 723 return true; |
| 712 } | 724 } |
| 713 | 725 |
| OLD | NEW |