OLD | NEW |
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 "chrome/browser/ui/website_settings/website_settings.h" | 5 #include "chrome/browser/ui/website_settings/website_settings.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" | 21 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" |
22 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" | 22 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" |
23 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" | 23 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" |
24 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" | 24 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" |
25 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 25 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
26 #include "chrome/browser/history/history_service_factory.h" | 26 #include "chrome/browser/history/history_service_factory.h" |
27 #include "chrome/browser/infobars/infobar_service.h" | 27 #include "chrome/browser/infobars/infobar_service.h" |
28 #include "chrome/browser/profiles/profile.h" | 28 #include "chrome/browser/profiles/profile.h" |
29 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" | 29 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" |
30 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" | 30 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" |
| 31 #include "chrome/browser/ssl/ssl_error_info.h" |
31 #include "chrome/browser/ui/website_settings/website_settings_ui.h" | 32 #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
32 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
33 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
34 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
35 #include "chrome/grit/chromium_strings.h" | 36 #include "chrome/grit/chromium_strings.h" |
36 #include "chrome/grit/generated_resources.h" | 37 #include "chrome/grit/generated_resources.h" |
37 #include "components/content_settings/core/browser/content_settings_utils.h" | 38 #include "components/content_settings/core/browser/content_settings_utils.h" |
38 #include "components/content_settings/core/browser/host_content_settings_map.h" | 39 #include "components/content_settings/core/browser/host_content_settings_map.h" |
39 #include "components/content_settings/core/browser/local_shared_objects_counter.
h" | 40 #include "components/content_settings/core/browser/local_shared_objects_counter.
h" |
40 #include "components/content_settings/core/common/content_settings.h" | 41 #include "components/content_settings/core/common/content_settings.h" |
41 #include "components/content_settings/core/common/content_settings_pattern.h" | 42 #include "components/content_settings/core/common/content_settings_pattern.h" |
42 #include "components/rappor/rappor_utils.h" | 43 #include "components/rappor/rappor_utils.h" |
43 #include "components/ssl_errors/error_info.h" | |
44 #include "components/url_formatter/elide_url.h" | 44 #include "components/url_formatter/elide_url.h" |
45 #include "content/public/browser/browser_thread.h" | 45 #include "content/public/browser/browser_thread.h" |
46 #include "content/public/browser/cert_store.h" | 46 #include "content/public/browser/cert_store.h" |
47 #include "content/public/browser/user_metrics.h" | 47 #include "content/public/browser/user_metrics.h" |
48 #include "content/public/common/content_switches.h" | 48 #include "content/public/common/content_switches.h" |
49 #include "content/public/common/ssl_status.h" | 49 #include "content/public/common/ssl_status.h" |
50 #include "content/public/common/url_constants.h" | 50 #include "content/public/common/url_constants.h" |
51 #include "net/cert/cert_status_flags.h" | 51 #include "net/cert/cert_status_flags.h" |
52 #include "net/cert/x509_certificate.h" | 52 #include "net/cert/x509_certificate.h" |
53 #include "net/ssl/ssl_cipher_suite_names.h" | 53 #include "net/ssl/ssl_cipher_suite_names.h" |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 } else { | 478 } else { |
479 // HTTP or HTTPS with errors (not warnings). | 479 // HTTP or HTTPS with errors (not warnings). |
480 site_identity_details_.assign(l10n_util::GetStringUTF16( | 480 site_identity_details_.assign(l10n_util::GetStringUTF16( |
481 IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY)); | 481 IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY)); |
482 if (ssl.security_style == content::SECURITY_STYLE_UNAUTHENTICATED) | 482 if (ssl.security_style == content::SECURITY_STYLE_UNAUTHENTICATED) |
483 site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; | 483 site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; |
484 else | 484 else |
485 site_identity_status_ = SITE_IDENTITY_STATUS_ERROR; | 485 site_identity_status_ = SITE_IDENTITY_STATUS_ERROR; |
486 | 486 |
487 const base::string16 bullet = UTF8ToUTF16("\n • "); | 487 const base::string16 bullet = UTF8ToUTF16("\n • "); |
488 std::vector<ssl_errors::ErrorInfo> errors; | 488 std::vector<SSLErrorInfo> errors; |
489 ssl_errors::ErrorInfo::GetErrorsForCertStatus(cert, ssl.cert_status, url, | 489 SSLErrorInfo::GetErrorsForCertStatus(ssl.cert_id, ssl.cert_status, |
490 &errors); | 490 url, &errors); |
491 for (size_t i = 0; i < errors.size(); ++i) { | 491 for (size_t i = 0; i < errors.size(); ++i) { |
492 site_identity_details_ += bullet; | 492 site_identity_details_ += bullet; |
493 site_identity_details_ += errors[i].short_description(); | 493 site_identity_details_ += errors[i].short_description(); |
494 } | 494 } |
495 | 495 |
496 if (ssl.cert_status & net::CERT_STATUS_NON_UNIQUE_NAME) { | 496 if (ssl.cert_status & net::CERT_STATUS_NON_UNIQUE_NAME) { |
497 site_identity_details_ += ASCIIToUTF16("\n\n"); | 497 site_identity_details_ += ASCIIToUTF16("\n\n"); |
498 site_identity_details_ += l10n_util::GetStringUTF16( | 498 site_identity_details_ += l10n_util::GetStringUTF16( |
499 IDS_PAGE_INFO_SECURITY_TAB_NON_UNIQUE_NAME); | 499 IDS_PAGE_INFO_SECURITY_TAB_NON_UNIQUE_NAME); |
500 } | 500 } |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 info.connection_status = site_connection_status_; | 730 info.connection_status = site_connection_status_; |
731 info.connection_status_description = | 731 info.connection_status_description = |
732 UTF16ToUTF8(site_connection_details_); | 732 UTF16ToUTF8(site_connection_details_); |
733 info.identity_status = site_identity_status_; | 733 info.identity_status = site_identity_status_; |
734 info.identity_status_description = | 734 info.identity_status_description = |
735 UTF16ToUTF8(site_identity_details_); | 735 UTF16ToUTF8(site_identity_details_); |
736 info.cert_id = cert_id_; | 736 info.cert_id = cert_id_; |
737 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; | 737 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; |
738 ui_->SetIdentityInfo(info); | 738 ui_->SetIdentityInfo(info); |
739 } | 739 } |
OLD | NEW |