| 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/bind.h" | 10 #include "base/bind.h" |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 IDS_PAGE_INFO_SECURITY_TAB_NON_UNIQUE_NAME); | 428 IDS_PAGE_INFO_SECURITY_TAB_NON_UNIQUE_NAME); |
| 429 } | 429 } |
| 430 } | 430 } |
| 431 | 431 |
| 432 // Site Connection | 432 // Site Connection |
| 433 // We consider anything less than 80 bits encryption to be weak encryption. | 433 // We consider anything less than 80 bits encryption to be weak encryption. |
| 434 // TODO(wtc): Bug 1198735: report mixed/unsafe content for unencrypted and | 434 // TODO(wtc): Bug 1198735: report mixed/unsafe content for unencrypted and |
| 435 // weakly encrypted connections. | 435 // weakly encrypted connections. |
| 436 site_connection_status_ = SITE_CONNECTION_STATUS_UNKNOWN; | 436 site_connection_status_ = SITE_CONNECTION_STATUS_UNKNOWN; |
| 437 | 437 |
| 438 if (!ssl.cert_id) { | 438 if (ssl.security_style == content::SECURITY_STYLE_UNKNOWN) { |
| 439 // Not HTTPS. | 439 // Page is still loading, so SSL status is not yet available. Say nothing. |
| 440 DCHECK_EQ(ssl.security_style, content::SECURITY_STYLE_UNAUTHENTICATED); | 440 DCHECK_EQ(ssl.security_bits, -1); |
| 441 if (ssl.security_style == content::SECURITY_STYLE_UNAUTHENTICATED) | 441 site_connection_status_ = SITE_CONNECTION_STATUS_UNENCRYPTED; |
| 442 site_connection_status_ = SITE_CONNECTION_STATUS_UNENCRYPTED; | |
| 443 else | |
| 444 site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED_ERROR; | |
| 445 | 442 |
| 446 site_connection_details_.assign(l10n_util::GetStringFUTF16( | 443 site_connection_details_.assign(l10n_util::GetStringFUTF16( |
| 447 IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, | 444 IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, |
| 445 subject_name)); |
| 446 } else if (ssl.security_style == content::SECURITY_STYLE_UNAUTHENTICATED) { |
| 447 // HTTPS without a certificate, or not HTTPS. |
| 448 DCHECK(!ssl.cert_id); |
| 449 site_connection_status_ = SITE_CONNECTION_STATUS_UNENCRYPTED; |
| 450 |
| 451 site_connection_details_.assign(l10n_util::GetStringFUTF16( |
| 452 IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, |
| 448 subject_name)); | 453 subject_name)); |
| 449 } else if (ssl.security_bits < 0) { | 454 } else if (ssl.security_bits < 0) { |
| 450 // Security strength is unknown. Say nothing. | 455 // Security strength is unknown. Say nothing. |
| 451 site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED_ERROR; | 456 site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED_ERROR; |
| 452 } else if (ssl.security_bits == 0) { | 457 } else if (ssl.security_bits == 0) { |
| 453 DCHECK_NE(ssl.security_style, content::SECURITY_STYLE_UNAUTHENTICATED); | 458 DCHECK_NE(ssl.security_style, content::SECURITY_STYLE_UNAUTHENTICATED); |
| 454 site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED_ERROR; | 459 site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED_ERROR; |
| 455 site_connection_details_.assign(l10n_util::GetStringFUTF16( | 460 site_connection_details_.assign(l10n_util::GetStringFUTF16( |
| 456 IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, | 461 IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, |
| 457 subject_name)); | 462 subject_name)); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 if (visited_before_today) { | 685 if (visited_before_today) { |
| 681 first_visit_text = l10n_util::GetStringFUTF16( | 686 first_visit_text = l10n_util::GetStringFUTF16( |
| 682 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY, | 687 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY, |
| 683 base::TimeFormatShortDate(first_visit)); | 688 base::TimeFormatShortDate(first_visit)); |
| 684 } else { | 689 } else { |
| 685 first_visit_text = l10n_util::GetStringUTF16( | 690 first_visit_text = l10n_util::GetStringUTF16( |
| 686 IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY); | 691 IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY); |
| 687 } | 692 } |
| 688 ui_->SetFirstVisit(first_visit_text); | 693 ui_->SetFirstVisit(first_visit_text); |
| 689 } | 694 } |
| OLD | NEW |