Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: components/error_page/common/localized_error.cc

Issue 2480753003: Use a new flag to control showing "DOWNLOAD PAGE LATER" in error pages (Closed)
Patch Set: Update histogram for about unittest Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | components/offline_pages/offline_page_feature.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | components/offline_pages/offline_page_feature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698