| 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/ssl/ssl_blocking_page.h" | 5 #include "chrome/browser/ssl/ssl_blocking_page.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/strings/string_piece.h" | 9 #include "base/strings/string_piece.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 strings.SetString("errorType", | 211 strings.SetString("errorType", |
| 212 l10n_util::GetStringUTF16(IDS_SSL_BLOCKING_PAGE_TITLE)); | 212 l10n_util::GetStringUTF16(IDS_SSL_BLOCKING_PAGE_TITLE)); |
| 213 } else { | 213 } else { |
| 214 strings.SetString("title", | 214 strings.SetString("title", |
| 215 l10n_util::GetStringUTF16(IDS_SSL_ERROR_PAGE_TITLE)); | 215 l10n_util::GetStringUTF16(IDS_SSL_ERROR_PAGE_TITLE)); |
| 216 if (strict_enforcement_) { | 216 if (strict_enforcement_) { |
| 217 strings.SetString("reasonForNotProceeding", | 217 strings.SetString("reasonForNotProceeding", |
| 218 l10n_util::GetStringUTF16( | 218 l10n_util::GetStringUTF16( |
| 219 IDS_SSL_ERROR_PAGE_CANNOT_PROCEED)); | 219 IDS_SSL_ERROR_PAGE_CANNOT_PROCEED)); |
| 220 } else { | 220 } else { |
| 221 strings.SetString("reasonForNotProceeding", ""); | 221 strings.SetString("reasonForNotProceeding", std::string()); |
| 222 } | 222 } |
| 223 strings.SetString("errorType", ""); | 223 strings.SetString("errorType", std::string()); |
| 224 } | 224 } |
| 225 | 225 |
| 226 strings.SetString("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr"); | 226 strings.SetString("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr"); |
| 227 | 227 |
| 228 base::StringPiece html( | 228 base::StringPiece html( |
| 229 ResourceBundle::GetSharedInstance().GetRawDataResource( | 229 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 230 resource_id)); | 230 resource_id)); |
| 231 | 231 |
| 232 return webui::GetI18nTemplateHtml(html, &strings); | 232 return webui::GetI18nTemplateHtml(html, &strings); |
| 233 } | 233 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 const std::vector<string16>& extra_info) { | 311 const std::vector<string16>& extra_info) { |
| 312 DCHECK_LT(extra_info.size(), 5U); // We allow 5 paragraphs max. | 312 DCHECK_LT(extra_info.size(), 5U); // We allow 5 paragraphs max. |
| 313 const char* keys[5] = { | 313 const char* keys[5] = { |
| 314 "moreInfo1", "moreInfo2", "moreInfo3", "moreInfo4", "moreInfo5" | 314 "moreInfo1", "moreInfo2", "moreInfo3", "moreInfo4", "moreInfo5" |
| 315 }; | 315 }; |
| 316 int i; | 316 int i; |
| 317 for (i = 0; i < static_cast<int>(extra_info.size()); i++) { | 317 for (i = 0; i < static_cast<int>(extra_info.size()); i++) { |
| 318 strings->SetString(keys[i], extra_info[i]); | 318 strings->SetString(keys[i], extra_info[i]); |
| 319 } | 319 } |
| 320 for (; i < 5; i++) { | 320 for (; i < 5; i++) { |
| 321 strings->SetString(keys[i], ""); | 321 strings->SetString(keys[i], std::string()); |
| 322 } | 322 } |
| 323 } | 323 } |
| OLD | NEW |