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 "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 LookupErrorMap(error_domain, error_code); | 348 LookupErrorMap(error_domain, error_code); |
349 if (error_map) | 349 if (error_map) |
350 options = *error_map; | 350 options = *error_map; |
351 | 351 |
352 if (options.suggestions != SUGGEST_NONE) { | 352 if (options.suggestions != SUGGEST_NONE) { |
353 error_strings->SetString( | 353 error_strings->SetString( |
354 "suggestionsHeading", | 354 "suggestionsHeading", |
355 l10n_util::GetStringUTF16(IDS_ERRORPAGES_SUGGESTION_HEADING)); | 355 l10n_util::GetStringUTF16(IDS_ERRORPAGES_SUGGESTION_HEADING)); |
356 } | 356 } |
357 | 357 |
358 string16 failed_url(ASCIIToUTF16(error.unreachableURL.spec())); | 358 string16 failed_url(ASCIIToUTF16(std::string(error.unreachableURL.spec()))); |
359 // URLs are always LTR. | 359 // URLs are always LTR. |
360 if (rtl) | 360 if (rtl) |
361 base::i18n::WrapStringWithLTRFormatting(&failed_url); | 361 base::i18n::WrapStringWithLTRFormatting(&failed_url); |
362 error_strings->SetString("title", | 362 error_strings->SetString("title", |
363 l10n_util::GetStringFUTF16(options.title_resource_id, failed_url)); | 363 l10n_util::GetStringFUTF16(options.title_resource_id, failed_url)); |
364 error_strings->SetString("heading", | 364 error_strings->SetString("heading", |
365 l10n_util::GetStringUTF16(options.heading_resource_id)); | 365 l10n_util::GetStringUTF16(options.heading_resource_id)); |
366 | 366 |
367 DictionaryValue* summary = new DictionaryValue; | 367 DictionaryValue* summary = new DictionaryValue; |
368 summary->SetString("msg", | 368 summary->SetString("msg", |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 failed_url.c_str())); | 535 failed_url.c_str())); |
536 | 536 |
537 error_strings->SetString("title", app->name()); | 537 error_strings->SetString("title", app->name()); |
538 error_strings->SetString("icon", | 538 error_strings->SetString("icon", |
539 app->GetIconURL(Extension::EXTENSION_ICON_LARGE, | 539 app->GetIconURL(Extension::EXTENSION_ICON_LARGE, |
540 ExtensionIconSet::MATCH_SMALLER).spec()); | 540 ExtensionIconSet::MATCH_SMALLER).spec()); |
541 error_strings->SetString("name", app->name()); | 541 error_strings->SetString("name", app->name()); |
542 error_strings->SetString("msg", | 542 error_strings->SetString("msg", |
543 l10n_util::GetStringUTF16(IDS_ERRORPAGES_APP_WARNING)); | 543 l10n_util::GetStringUTF16(IDS_ERRORPAGES_APP_WARNING)); |
544 } | 544 } |
OLD | NEW |