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

Unified Diff: chrome/browser/net/net_error_tab_helper.cc

Issue 2588253002: Enable download page action for error page (Closed)
Patch Set: Fix trybots Created 3 years, 11 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/net_error_tab_helper.cc
diff --git a/chrome/browser/net/net_error_tab_helper.cc b/chrome/browser/net/net_error_tab_helper.cc
index 8b257b5fa2b42ac9f24499fff870ef4f334f88c8..ac28129061214589033ccb9dbc32cfa60749bb1f 100644
--- a/chrome/browser/net/net_error_tab_helper.cc
+++ b/chrome/browser/net/net_error_tab_helper.cc
@@ -142,7 +142,10 @@ bool NetErrorTabHelper::OnMessageReceived(
#if BUILDFLAG(ANDROID_JAVA_UI)
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(NetErrorTabHelper, message)
- IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DownloadPageLater, DownloadPageLater)
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DownloadPageLater,
+ OnDownloadPageLater)
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SetIsShowingDownloadButtonInErrorPage,
+ OnSetIsShowingDownloadButtonInErrorPage)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -158,6 +161,9 @@ NetErrorTabHelper::NetErrorTabHelper(WebContents* contents)
is_error_page_(false),
dns_error_active_(false),
dns_error_page_committed_(false),
+#if BUILDFLAG(ANDROID_JAVA_UI)
+ is_showing_download_button_in_error_page_(false),
+#endif // BUILDFLAG(ANDROID_JAVA_UI)
dns_probe_status_(error_page::DNS_PROBE_POSSIBLE),
weak_factory_(this) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -210,7 +216,7 @@ void NetErrorTabHelper::OnDnsProbeFinished(DnsProbeStatus result) {
}
#if BUILDFLAG(ANDROID_JAVA_UI)
-void NetErrorTabHelper::DownloadPageLater() {
+void NetErrorTabHelper::OnDownloadPageLater() {
// Makes sure that this is coming from an error page.
content::NavigationEntry* entry =
web_contents()->GetController().GetLastCommittedEntry();
@@ -224,6 +230,10 @@ void NetErrorTabHelper::DownloadPageLater() {
DownloadPageLaterHelper(url);
}
+
+void NetErrorTabHelper::OnSetIsShowingDownloadButtonInErrorPage(bool show) {
mmenke 2017/01/09 20:35:39 "show" seems a bit short. Maybe just showing_butt
jianli 2017/01/09 23:35:07 Done.
+ is_showing_download_button_in_error_page_ = show;
+}
#endif // BUILDFLAG(ANDROID_JAVA_UI)
void NetErrorTabHelper::InitializePref(WebContents* contents) {

Powered by Google App Engine
This is Rietveld 408576698