| 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 <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 "title", | 992 "title", |
| 993 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_SHOW_SAVED_COPY_HELP)); | 993 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_SHOW_SAVED_COPY_HELP)); |
| 994 if (show_saved_copy_primary) | 994 if (show_saved_copy_primary) |
| 995 show_saved_copy_button->SetString("primary", "true"); | 995 show_saved_copy_button->SetString("primary", "true"); |
| 996 error_strings->Set("showSavedCopyButton", show_saved_copy_button); | 996 error_strings->Set("showSavedCopyButton", show_saved_copy_button); |
| 997 } | 997 } |
| 998 | 998 |
| 999 #if defined(OS_ANDROID) | 999 #if defined(OS_ANDROID) |
| 1000 if (!show_saved_copy_visible && | 1000 if (!show_saved_copy_visible && |
| 1001 failed_url.SchemeIsHTTPOrHTTPS() && | 1001 failed_url.SchemeIsHTTPOrHTTPS() && |
| 1002 offline_pages::IsOfflinePagesBackgroundLoadingEnabled()) { | 1002 offline_pages::IsOfflinePagesAsyncDownloadEnabled()) { |
| 1003 std::unique_ptr<base::DictionaryValue> download_button = | 1003 std::unique_ptr<base::DictionaryValue> download_button = |
| 1004 base::MakeUnique<base::DictionaryValue>(); | 1004 base::MakeUnique<base::DictionaryValue>(); |
| 1005 download_button->SetString( | 1005 download_button->SetString( |
| 1006 "msg", | 1006 "msg", |
| 1007 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_DOWNLOAD)); | 1007 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_DOWNLOAD)); |
| 1008 download_button->SetString( | 1008 download_button->SetString( |
| 1009 "disabledMsg", | 1009 "disabledMsg", |
| 1010 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_DOWNLOADING)); | 1010 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_DOWNLOADING)); |
| 1011 error_strings->Set("downloadButton", std::move(download_button)); | 1011 error_strings->Set("downloadButton", std::move(download_button)); |
| 1012 } | 1012 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1026 | 1026 |
| 1027 bool LocalizedError::HasStrings(const std::string& error_domain, | 1027 bool LocalizedError::HasStrings(const std::string& error_domain, |
| 1028 int error_code) { | 1028 int error_code) { |
| 1029 // Whether or not the there are strings for an error does not depend on | 1029 // Whether or not the there are strings for an error does not depend on |
| 1030 // whether or not the page was be generated by a POST, so just claim it was | 1030 // whether or not the page was be generated by a POST, so just claim it was |
| 1031 // not. | 1031 // not. |
| 1032 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; | 1032 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; |
| 1033 } | 1033 } |
| 1034 | 1034 |
| 1035 } // namespace error_page | 1035 } // namespace error_page |
| OLD | NEW |