| 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/ssl_policy.h" | 5 #include "chrome/browser/ssl/ssl_policy.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/i18n/rtl.h" |
| 11 #include "base/singleton.h" | 12 #include "base/singleton.h" |
| 12 #include "base/string_piece.h" | 13 #include "base/string_piece.h" |
| 13 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 14 #include "chrome/browser/cert_store.h" | 15 #include "chrome/browser/cert_store.h" |
| 15 #include "chrome/browser/profile.h" | 16 #include "chrome/browser/profile.h" |
| 16 #include "chrome/browser/renderer_host/render_process_host.h" | 17 #include "chrome/browser/renderer_host/render_process_host.h" |
| 17 #include "chrome/browser/renderer_host/render_view_host.h" | 18 #include "chrome/browser/renderer_host/render_view_host.h" |
| 18 #include "chrome/browser/renderer_host/site_instance.h" | 19 #include "chrome/browser/renderer_host/site_instance.h" |
| 19 #include "chrome/browser/ssl/ssl_cert_error_handler.h" | 20 #include "chrome/browser/ssl/ssl_cert_error_handler.h" |
| 20 #include "chrome/browser/ssl/ssl_error_info.h" | 21 #include "chrome/browser/ssl/ssl_error_info.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 DictionaryValue strings; | 212 DictionaryValue strings; |
| 212 strings.SetString(L"title", l10n_util::GetString(IDS_SSL_ERROR_PAGE_TITLE)); | 213 strings.SetString(L"title", l10n_util::GetString(IDS_SSL_ERROR_PAGE_TITLE)); |
| 213 strings.SetString(L"headLine", error_info.title()); | 214 strings.SetString(L"headLine", error_info.title()); |
| 214 strings.SetString(L"description", error_info.details()); | 215 strings.SetString(L"description", error_info.details()); |
| 215 strings.SetString(L"moreInfoTitle", | 216 strings.SetString(L"moreInfoTitle", |
| 216 l10n_util::GetString(IDS_CERT_ERROR_EXTRA_INFO_TITLE)); | 217 l10n_util::GetString(IDS_CERT_ERROR_EXTRA_INFO_TITLE)); |
| 217 SSLBlockingPage::SetExtraInfo(&strings, error_info.extra_information()); | 218 SSLBlockingPage::SetExtraInfo(&strings, error_info.extra_information()); |
| 218 | 219 |
| 219 strings.SetString(L"back", l10n_util::GetString(IDS_SSL_ERROR_PAGE_BACK)); | 220 strings.SetString(L"back", l10n_util::GetString(IDS_SSL_ERROR_PAGE_BACK)); |
| 220 | 221 |
| 221 strings.SetString(L"textdirection", | 222 strings.SetString(L"textdirection", base::i18n::IsRTL() ? L"rtl" : L"ltr"); |
| 222 (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) ? | |
| 223 L"rtl" : L"ltr"); | |
| 224 | 223 |
| 225 static const base::StringPiece html( | 224 static const base::StringPiece html( |
| 226 ResourceBundle::GetSharedInstance().GetRawDataResource( | 225 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 227 IDR_SSL_ERROR_HTML)); | 226 IDR_SSL_ERROR_HTML)); |
| 228 | 227 |
| 229 std::string html_text(jstemplate_builder::GetI18nTemplateHtml(html, | 228 std::string html_text(jstemplate_builder::GetI18nTemplateHtml(html, |
| 230 &strings)); | 229 &strings)); |
| 231 | 230 |
| 232 TabContents* tab = handler->GetTabContents(); | 231 TabContents* tab = handler->GetTabContents(); |
| 233 int cert_id = CertStore::GetSharedInstance()->StoreCert( | 232 int cert_id = CertStore::GetSharedInstance()->StoreCert( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // mark the main frame's origin as broken too. | 279 // mark the main frame's origin as broken too. |
| 281 MarkOriginAsBroken(info->main_frame_origin(), info->child_id()); | 280 MarkOriginAsBroken(info->main_frame_origin(), info->child_id()); |
| 282 } | 281 } |
| 283 } | 282 } |
| 284 | 283 |
| 285 void SSLPolicy::UpdateStateForUnsafeContent(SSLRequestInfo* info) { | 284 void SSLPolicy::UpdateStateForUnsafeContent(SSLRequestInfo* info) { |
| 286 // This request as a broken cert, which means its host is broken. | 285 // This request as a broken cert, which means its host is broken. |
| 287 backend_->MarkHostAsBroken(info->url().host(), info->child_id()); | 286 backend_->MarkHostAsBroken(info->url().host(), info->child_id()); |
| 288 UpdateStateForMixedContent(info); | 287 UpdateStateForMixedContent(info); |
| 289 } | 288 } |
| OLD | NEW |