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

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

Issue 2588253002: Enable download page action for error page (Closed)
Patch Set: set false in NetErrorTabHelper::DidFinishNavigation 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..b31b55436b5c8e6f721d2d73004e231fe64f838c 100644
--- a/chrome/browser/net/net_error_tab_helper.cc
+++ b/chrome/browser/net/net_error_tab_helper.cc
@@ -131,6 +131,9 @@ void NetErrorTabHelper::DidFinishNavigation(
!navigation_handle->IsErrorPage()) {
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)
}
}
@@ -142,7 +145,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 +164,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 +219,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 +233,11 @@ void NetErrorTabHelper::DownloadPageLater() {
DownloadPageLaterHelper(url);
}
+
+void NetErrorTabHelper::OnSetIsShowingDownloadButtonInErrorPage(
+ bool is_showing_download_button) {
+ is_showing_download_button_in_error_page_ = is_showing_download_button;
+}
#endif // BUILDFLAG(ANDROID_JAVA_UI)
void NetErrorTabHelper::InitializePref(WebContents* contents) {

Powered by Google App Engine
This is Rietveld 408576698