| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 case net::ERR_TOO_MANY_REDIRECTS: | 219 case net::ERR_TOO_MANY_REDIRECTS: |
| 220 learn_more_url = GURL(kRedirectLoopLearnMoreUrl); | 220 learn_more_url = GURL(kRedirectLoopLearnMoreUrl); |
| 221 break; | 221 break; |
| 222 default: | 222 default: |
| 223 break; | 223 break; |
| 224 } | 224 } |
| 225 | 225 |
| 226 if (learn_more_url.is_valid()) { | 226 if (learn_more_url.is_valid()) { |
| 227 // Add the language parameter to the URL. | 227 // Add the language parameter to the URL. |
| 228 std::string query = learn_more_url.query() + "&hl=" + | 228 std::string query = learn_more_url.query() + "&hl=" + |
| 229 WideToASCII(webkit_glue::GetWebKitLocale()); | 229 webkit_glue::GetWebKitLocale(); |
| 230 GURL::Replacements repl; | 230 GURL::Replacements repl; |
| 231 repl.SetQueryStr(query); | 231 repl.SetQueryStr(query); |
| 232 learn_more_url = learn_more_url.ReplaceComponents(repl); | 232 learn_more_url = learn_more_url.ReplaceComponents(repl); |
| 233 | 233 |
| 234 DictionaryValue* suggest_learn_more = new DictionaryValue; | 234 DictionaryValue* suggest_learn_more = new DictionaryValue; |
| 235 suggest_learn_more->SetString("msg", | 235 suggest_learn_more->SetString("msg", |
| 236 l10n_util::GetStringUTF16(IDS_ERRORPAGES_SUGGESTION_LEARNMORE)); | 236 l10n_util::GetStringUTF16(IDS_ERRORPAGES_SUGGESTION_LEARNMORE)); |
| 237 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); | 237 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); |
| 238 error_strings->Set("suggestionsLearnMore", suggest_learn_more); | 238 error_strings->Set("suggestionsLearnMore", suggest_learn_more); |
| 239 } | 239 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 253 "title", l10n_util::GetStringFUTF16(IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 253 "title", l10n_util::GetStringFUTF16(IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 254 failed_url)); | 254 failed_url)); |
| 255 error_strings->SetString( | 255 error_strings->SetString( |
| 256 "heading", l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_TITLE)); | 256 "heading", l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_TITLE)); |
| 257 error_strings->SetString("suggestionsHeading", ""); | 257 error_strings->SetString("suggestionsHeading", ""); |
| 258 DictionaryValue* summary = new DictionaryValue; | 258 DictionaryValue* summary = new DictionaryValue; |
| 259 summary->SetString( | 259 summary->SetString( |
| 260 "msg", l10n_util::GetStringUTF16(IDS_ERRORPAGES_HTTP_POST_WARNING)); | 260 "msg", l10n_util::GetStringUTF16(IDS_ERRORPAGES_HTTP_POST_WARNING)); |
| 261 error_strings->Set("summary", summary); | 261 error_strings->Set("summary", summary); |
| 262 } | 262 } |
| OLD | NEW |