| 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 "components/error_page/common/localized_error.h" | 5 #include "components/error_page/common/localized_error.h" | 
| 6 | 6 | 
| 7 #include <stddef.h> | 7 #include <stddef.h> | 
| 8 | 8 | 
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" | 
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" | 
| (...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1049         "msg", l10n_util::GetStringUTF16( | 1049         "msg", l10n_util::GetStringUTF16( | 
| 1050             IDS_ERRORPAGES_BUTTON_SHOW_SAVED_COPY)); | 1050             IDS_ERRORPAGES_BUTTON_SHOW_SAVED_COPY)); | 
| 1051     show_saved_copy_button->SetString( | 1051     show_saved_copy_button->SetString( | 
| 1052         "title", | 1052         "title", | 
| 1053         l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_SHOW_SAVED_COPY_HELP)); | 1053         l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_SHOW_SAVED_COPY_HELP)); | 
| 1054     if (show_saved_copy_primary) | 1054     if (show_saved_copy_primary) | 
| 1055       show_saved_copy_button->SetString("primary", "true"); | 1055       show_saved_copy_button->SetString("primary", "true"); | 
| 1056     error_strings->Set("showSavedCopyButton", show_saved_copy_button); | 1056     error_strings->Set("showSavedCopyButton", show_saved_copy_button); | 
| 1057   } | 1057   } | 
| 1058 | 1058 | 
| 1059 #if defined(OS_ANDROID) |  | 
| 1060   // Offline button will not be provided when we want to show something in the |  | 
| 1061   // cache. |  | 
| 1062   if (!show_saved_copy_visible && has_offline_pages) { |  | 
| 1063     base::DictionaryValue* show_offline_pages_button = |  | 
| 1064         new base::DictionaryValue; |  | 
| 1065     base::string16 button_text = l10n_util::GetStringUTF16( |  | 
| 1066         offline_pages::GetOfflinePageFeatureMode() == |  | 
| 1067             offline_pages::FeatureMode::ENABLED_AS_BOOKMARKS |  | 
| 1068                 ? IDS_ERRORPAGES_BUTTON_SHOW_OFFLINE_PAGES_AS_BOOKMARKS |  | 
| 1069                 : IDS_ERRORPAGES_BUTTON_SHOW_OFFLINE_PAGES); |  | 
| 1070     show_offline_pages_button->SetString("msg", button_text); |  | 
| 1071     error_strings->Set("showOfflinePagesButton", show_offline_pages_button); |  | 
| 1072   } |  | 
| 1073 #endif  // defined(OS_ANDROID) |  | 
| 1074 |  | 
| 1075 #if defined(OS_CHROMEOS) | 1059 #if defined(OS_CHROMEOS) | 
| 1076   // ChromeOS has its own diagnostics extension, which doesn't rely on a | 1060   // ChromeOS has its own diagnostics extension, which doesn't rely on a | 
| 1077   // browser-initiated dialog. | 1061   // browser-initiated dialog. | 
| 1078   can_show_network_diagnostics_dialog = true; | 1062   can_show_network_diagnostics_dialog = true; | 
| 1079 #endif | 1063 #endif | 
| 1080   if (can_show_network_diagnostics_dialog && failed_url.is_valid() && | 1064   if (can_show_network_diagnostics_dialog && failed_url.is_valid() && | 
| 1081       failed_url.SchemeIsHTTPOrHTTPS()) { | 1065       failed_url.SchemeIsHTTPOrHTTPS()) { | 
| 1082     error_strings->SetString( | 1066     error_strings->SetString( | 
| 1083         "diagnose", l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_DIAGNOSE)); | 1067         "diagnose", l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_DIAGNOSE)); | 
| 1084   } | 1068   } | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
| 1097 | 1081 | 
| 1098 bool LocalizedError::HasStrings(const std::string& error_domain, | 1082 bool LocalizedError::HasStrings(const std::string& error_domain, | 
| 1099                                 int error_code) { | 1083                                 int error_code) { | 
| 1100   // Whether or not the there are strings for an error does not depend on | 1084   // Whether or not the there are strings for an error does not depend on | 
| 1101   // whether or not the page was be generated by a POST, so just claim it was | 1085   // whether or not the page was be generated by a POST, so just claim it was | 
| 1102   // not. | 1086   // not. | 
| 1103   return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; | 1087   return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; | 
| 1104 } | 1088 } | 
| 1105 | 1089 | 
| 1106 }  // namespace error_page | 1090 }  // namespace error_page | 
| OLD | NEW | 
|---|