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/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "third_party/WebKit/public/platform/WebURLError.h" | 24 #include "third_party/WebKit/public/platform/WebURLError.h" |
25 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
26 #include "ui/base/webui/web_ui_util.h" | 26 #include "ui/base/webui/web_ui_util.h" |
27 #include "url/gurl.h" | 27 #include "url/gurl.h" |
28 #include "webkit/glue/webkit_glue.h" | 28 #include "webkit/glue/webkit_glue.h" |
29 | 29 |
30 #if defined(OS_WIN) | 30 #if defined(OS_WIN) |
31 #include "base/win/windows_version.h" | 31 #include "base/win/windows_version.h" |
32 #endif | 32 #endif |
33 | 33 |
34 using WebKit::WebURLError; | 34 using blink::WebURLError; |
35 | 35 |
36 // Some error pages have no details. | 36 // Some error pages have no details. |
37 const unsigned int kErrorPagesNoDetails = 0; | 37 const unsigned int kErrorPagesNoDetails = 0; |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
41 static const char kRedirectLoopLearnMoreUrl[] = | 41 static const char kRedirectLoopLearnMoreUrl[] = |
42 "https://www.google.com/support/chrome/bin/answer.py?answer=95626"; | 42 "https://www.google.com/support/chrome/bin/answer.py?answer=95626"; |
43 static const char kWeakDHKeyLearnMoreUrl[] = | 43 static const char kWeakDHKeyLearnMoreUrl[] = |
44 "http://sites.google.com/a/chromium.org/dev/" | 44 "http://sites.google.com/a/chromium.org/dev/" |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 suggest_learn_more->SetString("body", | 763 suggest_learn_more->SetString("body", |
764 l10n_util::GetStringUTF16(IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY)); | 764 l10n_util::GetStringUTF16(IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY)); |
765 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); | 765 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); |
766 suggestions->Append(suggest_learn_more); | 766 suggestions->Append(suggest_learn_more); |
767 } | 767 } |
768 } | 768 } |
769 | 769 |
770 error_strings->Set("suggestions", suggestions); | 770 error_strings->Set("suggestions", suggestions); |
771 } | 771 } |
772 | 772 |
773 string16 LocalizedError::GetErrorDetails(const WebKit::WebURLError& error, | 773 string16 LocalizedError::GetErrorDetails(const blink::WebURLError& error, |
774 bool is_post) { | 774 bool is_post) { |
775 const LocalizedErrorMap* error_map = | 775 const LocalizedErrorMap* error_map = |
776 LookupErrorMap(error.domain.utf8(), error.reason, is_post); | 776 LookupErrorMap(error.domain.utf8(), error.reason, is_post); |
777 if (error_map) | 777 if (error_map) |
778 return l10n_util::GetStringUTF16(error_map->details_resource_id); | 778 return l10n_util::GetStringUTF16(error_map->details_resource_id); |
779 else | 779 else |
780 return l10n_util::GetStringUTF16(IDS_ERRORPAGES_DETAILS_UNKNOWN); | 780 return l10n_util::GetStringUTF16(IDS_ERRORPAGES_DETAILS_UNKNOWN); |
781 } | 781 } |
782 | 782 |
783 bool LocalizedError::HasStrings(const std::string& error_domain, | 783 bool LocalizedError::HasStrings(const std::string& error_domain, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 #if defined(OS_CHROMEOS) | 820 #if defined(OS_CHROMEOS) |
821 GURL learn_more_url(kAppWarningLearnMoreUrl); | 821 GURL learn_more_url(kAppWarningLearnMoreUrl); |
822 base::DictionaryValue* suggest_learn_more = new base::DictionaryValue(); | 822 base::DictionaryValue* suggest_learn_more = new base::DictionaryValue(); |
823 suggest_learn_more->SetString("msg", | 823 suggest_learn_more->SetString("msg", |
824 l10n_util::GetStringUTF16( | 824 l10n_util::GetStringUTF16( |
825 IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY)); | 825 IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY)); |
826 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); | 826 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); |
827 error_strings->Set("suggestionsLearnMore", suggest_learn_more); | 827 error_strings->Set("suggestionsLearnMore", suggest_learn_more); |
828 #endif // defined(OS_CHROMEOS) | 828 #endif // defined(OS_CHROMEOS) |
829 } | 829 } |
OLD | NEW |