| 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/common/localized_error.h" | 5 #include "chrome/common/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" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/common/extensions/extension_constants.h" |
| 13 #include "chrome/common/extensions/extension_icon_set.h" | 14 #include "chrome/common/extensions/extension_icon_set.h" |
| 14 #include "chrome/common/extensions/extension_set.h" | 15 #include "chrome/common/extensions/extension_set.h" |
| 15 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
| 16 #include "grit/chromium_strings.h" | 17 #include "grit/chromium_strings.h" |
| 17 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
| 18 #include "net/base/escape.h" | 19 #include "net/base/escape.h" |
| 19 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
| 20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.
h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.
h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 22 #include "webkit/glue/webkit_glue.h" | 23 #include "webkit/glue/webkit_glue.h" |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 string16 failed_url(ASCIIToUTF16(display_url.spec())); | 715 string16 failed_url(ASCIIToUTF16(display_url.spec())); |
| 715 // URLs are always LTR. | 716 // URLs are always LTR. |
| 716 if (rtl) | 717 if (rtl) |
| 717 base::i18n::WrapStringWithLTRFormatting(&failed_url); | 718 base::i18n::WrapStringWithLTRFormatting(&failed_url); |
| 718 error_strings->SetString( | 719 error_strings->SetString( |
| 719 "url", l10n_util::GetStringFUTF16(IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 720 "url", l10n_util::GetStringFUTF16(IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 720 failed_url.c_str())); | 721 failed_url.c_str())); |
| 721 | 722 |
| 722 error_strings->SetString("title", app->name()); | 723 error_strings->SetString("title", app->name()); |
| 723 error_strings->SetString("icon", | 724 error_strings->SetString("icon", |
| 724 app->GetIconURL(ExtensionIconSet::EXTENSION_ICON_GIGANTOR, | 725 app->GetIconURL(extension_misc::EXTENSION_ICON_GIGANTOR, |
| 725 ExtensionIconSet::MATCH_SMALLER).spec()); | 726 ExtensionIconSet::MATCH_SMALLER).spec()); |
| 726 error_strings->SetString("name", app->name()); | 727 error_strings->SetString("name", app->name()); |
| 727 error_strings->SetString("msg", | 728 error_strings->SetString("msg", |
| 728 l10n_util::GetStringUTF16(IDS_ERRORPAGES_APP_WARNING)); | 729 l10n_util::GetStringUTF16(IDS_ERRORPAGES_APP_WARNING)); |
| 729 | 730 |
| 730 #if defined(OS_CHROMEOS) | 731 #if defined(OS_CHROMEOS) |
| 731 GURL learn_more_url(kAppWarningLearnMoreUrl); | 732 GURL learn_more_url(kAppWarningLearnMoreUrl); |
| 732 DictionaryValue* suggest_learn_more = new DictionaryValue(); | 733 DictionaryValue* suggest_learn_more = new DictionaryValue(); |
| 733 suggest_learn_more->SetString("msg", | 734 suggest_learn_more->SetString("msg", |
| 734 l10n_util::GetStringUTF16( | 735 l10n_util::GetStringUTF16( |
| 735 IDS_ERRORPAGES_SUGGESTION_LEARNMORE)); | 736 IDS_ERRORPAGES_SUGGESTION_LEARNMORE)); |
| 736 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); | 737 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); |
| 737 error_strings->Set("suggestionsLearnMore", suggest_learn_more); | 738 error_strings->Set("suggestionsLearnMore", suggest_learn_more); |
| 738 #endif // defined(OS_CHROMEOS) | 739 #endif // defined(OS_CHROMEOS) |
| 739 } | 740 } |
| OLD | NEW |