Chromium Code Reviews| 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/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 853 int resource_id; | 853 int resource_id; |
| 854 DictionaryValue error_strings; | 854 DictionaryValue error_strings; |
| 855 if (extension && !extension->from_bookmark()) { | 855 if (extension && !extension->from_bookmark()) { |
| 856 LocalizedError::GetAppErrorStrings(error, failed_url, extension, | 856 LocalizedError::GetAppErrorStrings(error, failed_url, extension, |
| 857 &error_strings); | 857 &error_strings); |
| 858 | 858 |
| 859 // TODO(erikkay): Should we use a different template for different | 859 // TODO(erikkay): Should we use a different template for different |
| 860 // error messages? | 860 // error messages? |
| 861 resource_id = IDR_ERROR_APP_HTML; | 861 resource_id = IDR_ERROR_APP_HTML; |
| 862 } else { | 862 } else { |
| 863 if (is_repost) { | 863 const std::string locale = RenderThread::Get()->GetLocale(); |
| 864 if (NetErrorHelper::GetErrorStringsForDnsProbe( | |
| 865 error, &error_strings, locale)) { | |
| 866 // We got error strings for the "DNS probe possible" page. | |
| 867 // NetErrorHelper will update it later. | |
| 868 } else if (is_repost) { | |
| 864 LocalizedError::GetFormRepostStrings(failed_url, &error_strings); | 869 LocalizedError::GetFormRepostStrings(failed_url, &error_strings); |
| 865 } else { | 870 } else { |
| 866 LocalizedError::GetStrings(error, &error_strings, | 871 LocalizedError::GetStrings(error, &error_strings, |
| 867 RenderThread::Get()->GetLocale()); | 872 RenderThread::Get()->GetLocale()); |
|
mmenke
2013/04/10 16:56:58
Shouldn't call GetLocale() again when we have it i
Deprecated (see juliatuttle)
2013/04/10 23:42:32
Done.
| |
| 868 } | 873 } |
| 869 resource_id = IDR_NET_ERROR_HTML; | 874 resource_id = IDR_NET_ERROR_HTML; |
| 870 } | 875 } |
| 871 | 876 |
| 872 const base::StringPiece template_html( | 877 const base::StringPiece template_html( |
| 873 ResourceBundle::GetSharedInstance().GetRawDataResource( | 878 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 874 resource_id)); | 879 resource_id)); |
| 875 if (template_html.empty()) { | 880 if (template_html.empty()) { |
| 876 NOTREACHED() << "unable to load template. ID: " << resource_id; | 881 NOTREACHED() << "unable to load template. ID: " << resource_id; |
| 877 } else { | 882 } else { |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1241 | 1246 |
| 1242 for (size_t i = 0; i < request_os_file_handle_allowed_hosts_.size(); ++i) { | 1247 for (size_t i = 0; i < request_os_file_handle_allowed_hosts_.size(); ++i) { |
| 1243 if (MatchPattern(inner.host(), request_os_file_handle_allowed_hosts_[i])) | 1248 if (MatchPattern(inner.host(), request_os_file_handle_allowed_hosts_[i])) |
| 1244 return true; | 1249 return true; |
| 1245 } | 1250 } |
| 1246 | 1251 |
| 1247 return false; | 1252 return false; |
| 1248 } | 1253 } |
| 1249 | 1254 |
| 1250 } // namespace chrome | 1255 } // namespace chrome |
| OLD | NEW |