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