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

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

Issue 2588253002: Enable download page action for error page (Closed)
Patch Set: Address download feedback 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
« no previous file with comments | « chrome/browser/net/net_error_tab_helper.h ('k') | chrome/browser/net/net_error_tab_helper_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0ab91f09b64d19d1fd230b609ab45d84c80da972..2cac81cd148ec5ff5d0b390d9df393c532cb4515 100644
--- a/chrome/browser/net/net_error_tab_helper.cc
+++ b/chrome/browser/net/net_error_tab_helper.cc
@@ -130,6 +130,9 @@ void NetErrorTabHelper::DidFinishNavigation(
!navigation_handle->IsErrorPage()) {
dns_error_active_ = false;
dns_error_page_committed_ = false;
+#if defined(OS_ANDROID)
+ is_showing_download_button_in_error_page_ = false;
+#endif // defined(OS_ANDROID)
}
}
@@ -141,7 +144,10 @@ bool NetErrorTabHelper::OnMessageReceived(
#if defined(OS_ANDROID)
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()
@@ -157,6 +163,9 @@ NetErrorTabHelper::NetErrorTabHelper(WebContents* contents)
is_error_page_(false),
dns_error_active_(false),
dns_error_page_committed_(false),
+#if defined(OS_ANDROID)
+ is_showing_download_button_in_error_page_(false),
+#endif // defined(OS_ANDROID)
dns_probe_status_(error_page::DNS_PROBE_POSSIBLE),
weak_factory_(this) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -209,7 +218,7 @@ void NetErrorTabHelper::OnDnsProbeFinished(DnsProbeStatus result) {
}
#if defined(OS_ANDROID)
-void NetErrorTabHelper::DownloadPageLater() {
+void NetErrorTabHelper::OnDownloadPageLater() {
// Makes sure that this is coming from an error page.
content::NavigationEntry* entry =
web_contents()->GetController().GetLastCommittedEntry();
@@ -223,6 +232,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 // defined(OS_ANDROID)
void NetErrorTabHelper::InitializePref(WebContents* contents) {
« no previous file with comments | « chrome/browser/net/net_error_tab_helper.h ('k') | chrome/browser/net/net_error_tab_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698