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/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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 "heading", l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_TITLE)); | 700 "heading", l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_TITLE)); |
701 DictionaryValue* summary = new DictionaryValue; | 701 DictionaryValue* summary = new DictionaryValue; |
702 summary->SetString( | 702 summary->SetString( |
703 "msg", l10n_util::GetStringUTF16(IDS_ERRORPAGES_HTTP_POST_WARNING)); | 703 "msg", l10n_util::GetStringUTF16(IDS_ERRORPAGES_HTTP_POST_WARNING)); |
704 error_strings->Set("summary", summary); | 704 error_strings->Set("summary", summary); |
705 } | 705 } |
706 | 706 |
707 void LocalizedError::GetAppErrorStrings( | 707 void LocalizedError::GetAppErrorStrings( |
708 const WebURLError& error, | 708 const WebURLError& error, |
709 const GURL& display_url, | 709 const GURL& display_url, |
710 const Extension* app, | 710 const extensions::Extension* app, |
711 DictionaryValue* error_strings) { | 711 DictionaryValue* error_strings) { |
712 DCHECK(app); | 712 DCHECK(app); |
713 | 713 |
714 bool rtl = LocaleIsRTL(); | 714 bool rtl = LocaleIsRTL(); |
715 error_strings->SetString("textdirection", rtl ? "rtl" : "ltr"); | 715 error_strings->SetString("textdirection", rtl ? "rtl" : "ltr"); |
716 | 716 |
717 string16 failed_url(ASCIIToUTF16(display_url.spec())); | 717 string16 failed_url(ASCIIToUTF16(display_url.spec())); |
718 // URLs are always LTR. | 718 // URLs are always LTR. |
719 if (rtl) | 719 if (rtl) |
720 base::i18n::WrapStringWithLTRFormatting(&failed_url); | 720 base::i18n::WrapStringWithLTRFormatting(&failed_url); |
(...skipping 12 matching lines...) Expand all Loading... |
733 #if defined(OS_CHROMEOS) | 733 #if defined(OS_CHROMEOS) |
734 GURL learn_more_url(kAppWarningLearnMoreUrl); | 734 GURL learn_more_url(kAppWarningLearnMoreUrl); |
735 DictionaryValue* suggest_learn_more = new DictionaryValue(); | 735 DictionaryValue* suggest_learn_more = new DictionaryValue(); |
736 suggest_learn_more->SetString("msg", | 736 suggest_learn_more->SetString("msg", |
737 l10n_util::GetStringUTF16( | 737 l10n_util::GetStringUTF16( |
738 IDS_ERRORPAGES_SUGGESTION_LEARNMORE)); | 738 IDS_ERRORPAGES_SUGGESTION_LEARNMORE)); |
739 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); | 739 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); |
740 error_strings->Set("suggestionsLearnMore", suggest_learn_more); | 740 error_strings->Set("suggestionsLearnMore", suggest_learn_more); |
741 #endif // defined(OS_CHROMEOS) | 741 #endif // defined(OS_CHROMEOS) |
742 } | 742 } |
OLD | NEW |