| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/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/WebKit/chromium/public/platform/WebURLError.
h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.
h" |
| 22 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 | 703 |
| 703 string16 failed_url(ASCIIToUTF16(display_url.spec())); | 704 string16 failed_url(ASCIIToUTF16(display_url.spec())); |
| 704 // URLs are always LTR. | 705 // URLs are always LTR. |
| 705 if (rtl) | 706 if (rtl) |
| 706 base::i18n::WrapStringWithLTRFormatting(&failed_url); | 707 base::i18n::WrapStringWithLTRFormatting(&failed_url); |
| 707 error_strings->SetString( | 708 error_strings->SetString( |
| 708 "url", l10n_util::GetStringFUTF16(IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 709 "url", l10n_util::GetStringFUTF16(IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 709 failed_url.c_str())); | 710 failed_url.c_str())); |
| 710 | 711 |
| 711 error_strings->SetString("title", app->name()); | 712 error_strings->SetString("title", app->name()); |
| 712 error_strings->SetString("icon", | 713 error_strings->SetString( |
| 713 app->GetIconURL(extension_misc::EXTENSION_ICON_GIGANTOR, | 714 "icon", |
| 714 ExtensionIconSet::MATCH_SMALLER).spec()); | 715 extensions::IconsInfo::GetIconURL( |
| 716 app, |
| 717 extension_misc::EXTENSION_ICON_GIGANTOR, |
| 718 ExtensionIconSet::MATCH_SMALLER).spec()); |
| 715 error_strings->SetString("name", app->name()); | 719 error_strings->SetString("name", app->name()); |
| 716 error_strings->SetString("msg", | 720 error_strings->SetString( |
| 721 "msg", |
| 717 l10n_util::GetStringUTF16(IDS_ERRORPAGES_APP_WARNING)); | 722 l10n_util::GetStringUTF16(IDS_ERRORPAGES_APP_WARNING)); |
| 718 | 723 |
| 719 #if defined(OS_CHROMEOS) | 724 #if defined(OS_CHROMEOS) |
| 720 GURL learn_more_url(kAppWarningLearnMoreUrl); | 725 GURL learn_more_url(kAppWarningLearnMoreUrl); |
| 721 DictionaryValue* suggest_learn_more = new DictionaryValue(); | 726 DictionaryValue* suggest_learn_more = new DictionaryValue(); |
| 722 suggest_learn_more->SetString("msg", | 727 suggest_learn_more->SetString("msg", |
| 723 l10n_util::GetStringUTF16( | 728 l10n_util::GetStringUTF16( |
| 724 IDS_ERRORPAGES_SUGGESTION_LEARNMORE)); | 729 IDS_ERRORPAGES_SUGGESTION_LEARNMORE)); |
| 725 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); | 730 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); |
| 726 error_strings->Set("suggestionsLearnMore", suggest_learn_more); | 731 error_strings->Set("suggestionsLearnMore", suggest_learn_more); |
| 727 #endif // defined(OS_CHROMEOS) | 732 #endif // defined(OS_CHROMEOS) |
| 728 } | 733 } |
| OLD | NEW |