| 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/page_info_model.h" | 5 #include "chrome/browser/page_info_model.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/i18n/time_formatting.h" | 11 #include "base/i18n/time_formatting.h" |
| 12 #include "base/string_number_conversions.h" |
| 12 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/browser/cert_store.h" | 14 #include "chrome/browser/cert_store.h" |
| 14 #include "chrome/browser/pref_service.h" | 15 #include "chrome/browser/pref_service.h" |
| 15 #include "chrome/browser/profile.h" | 16 #include "chrome/browser/profile.h" |
| 16 #include "chrome/browser/ssl/ssl_manager.h" | 17 #include "chrome/browser/ssl/ssl_manager.h" |
| 17 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 18 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 19 #include "net/base/cert_status_flags.h" | 20 #include "net/base/cert_status_flags.h" |
| 20 #include "net/base/ssl_connection_status_flags.h" | 21 #include "net/base/ssl_connection_status_flags.h" |
| 21 #include "net/base/ssl_cipher_suite_names.h" | 22 #include "net/base/ssl_cipher_suite_names.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 subject_name)); | 130 subject_name)); |
| 130 } else if (ssl.security_bits() < 80) { | 131 } else if (ssl.security_bits() < 80) { |
| 131 state = false; | 132 state = false; |
| 132 description.assign(l10n_util::GetStringFUTF16( | 133 description.assign(l10n_util::GetStringFUTF16( |
| 133 IDS_PAGE_INFO_SECURITY_TAB_WEAK_ENCRYPTION_CONNECTION_TEXT, | 134 IDS_PAGE_INFO_SECURITY_TAB_WEAK_ENCRYPTION_CONNECTION_TEXT, |
| 134 subject_name)); | 135 subject_name)); |
| 135 } else { | 136 } else { |
| 136 description.assign(l10n_util::GetStringFUTF16( | 137 description.assign(l10n_util::GetStringFUTF16( |
| 137 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_CONNECTION_TEXT, | 138 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_CONNECTION_TEXT, |
| 138 subject_name, | 139 subject_name, |
| 139 IntToString16(ssl.security_bits()))); | 140 base::IntToString16(ssl.security_bits()))); |
| 140 if (ssl.displayed_insecure_content() || ssl.ran_insecure_content()) { | 141 if (ssl.displayed_insecure_content() || ssl.ran_insecure_content()) { |
| 141 state = false; | 142 state = false; |
| 142 description.assign(l10n_util::GetStringFUTF16( | 143 description.assign(l10n_util::GetStringFUTF16( |
| 143 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_SENTENCE_LINK, | 144 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_SENTENCE_LINK, |
| 144 description, | 145 description, |
| 145 l10n_util::GetStringUTF16(ssl.ran_insecure_content() ? | 146 l10n_util::GetStringUTF16(ssl.ran_insecure_content() ? |
| 146 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_ERROR : | 147 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_ERROR : |
| 147 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_WARNING))); | 148 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_WARNING))); |
| 148 } | 149 } |
| 149 } | 150 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY, | 252 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY, |
| 252 WideToUTF16(base::TimeFormatShortDate(first_visit))))); | 253 WideToUTF16(base::TimeFormatShortDate(first_visit))))); |
| 253 } | 254 } |
| 254 observer_->ModelChanged(); | 255 observer_->ModelChanged(); |
| 255 } | 256 } |
| 256 | 257 |
| 257 // static | 258 // static |
| 258 void PageInfoModel::RegisterPrefs(PrefService* prefs) { | 259 void PageInfoModel::RegisterPrefs(PrefService* prefs) { |
| 259 prefs->RegisterDictionaryPref(prefs::kPageInfoWindowPlacement); | 260 prefs->RegisterDictionaryPref(prefs::kPageInfoWindowPlacement); |
| 260 } | 261 } |
| OLD | NEW |