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/renderer/localized_error.h" | 5 #include "chrome/renderer/localized_error.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 | 294 |
295 } // namespace | 295 } // namespace |
296 | 296 |
297 const char LocalizedError::kHttpErrorDomain[] = "http"; | 297 const char LocalizedError::kHttpErrorDomain[] = "http"; |
298 | 298 |
299 void LocalizedError::GetStrings(const WebKit::WebURLError& error, | 299 void LocalizedError::GetStrings(const WebKit::WebURLError& error, |
300 DictionaryValue* error_strings) { | 300 DictionaryValue* error_strings) { |
301 bool rtl = LocaleIsRTL(); | 301 bool rtl = LocaleIsRTL(); |
302 error_strings->SetString("textdirection", rtl ? "rtl" : "ltr"); | 302 error_strings->SetString("textdirection", rtl ? "rtl" : "ltr"); |
303 | 303 |
304 // Grab strings that are applicable to all error pages | |
305 error_strings->SetString("detailsLink", | |
306 l10n_util::GetStringUTF16(IDS_ERRORPAGES_DETAILS_LINK)); | |
307 error_strings->SetString("detailsHeading", | |
308 l10n_util::GetStringUTF16(IDS_ERRORPAGES_DETAILS_HEADING)); | |
309 | |
310 // Grab the strings and settings that depend on the error type. Init | 304 // Grab the strings and settings that depend on the error type. Init |
311 // options with default values. | 305 // options with default values. |
312 LocalizedErrorMap options = { | 306 LocalizedErrorMap options = { |
313 0, | 307 0, |
314 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 308 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
315 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 309 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
316 IDS_ERRORPAGES_SUMMARY_NOT_AVAILABLE, | 310 IDS_ERRORPAGES_SUMMARY_NOT_AVAILABLE, |
317 IDS_ERRORPAGES_DETAILS_UNKNOWN, | 311 IDS_ERRORPAGES_DETAILS_UNKNOWN, |
318 SUGGEST_NONE, | 312 SUGGEST_NONE, |
319 }; | 313 }; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 error_strings->SetString( | 492 error_strings->SetString( |
499 "url", l10n_util::GetStringFUTF16(IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 493 "url", l10n_util::GetStringFUTF16(IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
500 failed_url.c_str())); | 494 failed_url.c_str())); |
501 | 495 |
502 error_strings->SetString("title", app->name()); | 496 error_strings->SetString("title", app->name()); |
503 error_strings->SetString("icon", app->icon_url().spec()); | 497 error_strings->SetString("icon", app->icon_url().spec()); |
504 error_strings->SetString("name", app->name()); | 498 error_strings->SetString("name", app->name()); |
505 error_strings->SetString("msg", | 499 error_strings->SetString("msg", |
506 l10n_util::GetStringUTF16(IDS_ERRORPAGES_APP_WARNING)); | 500 l10n_util::GetStringUTF16(IDS_ERRORPAGES_APP_WARNING)); |
507 } | 501 } |
OLD | NEW |