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

Unified Diff: chrome/browser/android/offline_pages/offline_page_utils.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
Index: chrome/browser/android/offline_pages/offline_page_utils.cc
diff --git a/chrome/browser/android/offline_pages/offline_page_utils.cc b/chrome/browser/android/offline_pages/offline_page_utils.cc
index 2a6afa6e749f808ae28297228575daa92f5534b1..a640ab48cc48650abb7a49a96843b2a40bbcddf9 100644
--- a/chrome/browser/android/offline_pages/offline_page_utils.cc
+++ b/chrome/browser/android/offline_pages/offline_page_utils.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/android/offline_pages/offline_page_tab_helper.h"
#include "chrome/browser/android/offline_pages/request_coordinator_factory.h"
#include "chrome/browser/android/tab_android.h"
+#include "chrome/browser/net/net_error_tab_helper.h"
#include "components/offline_pages/core/background/request_coordinator.h"
#include "components/offline_pages/core/background/save_page_request.h"
#include "components/offline_pages/core/client_namespace_constants.h"
@@ -139,6 +140,14 @@ bool OfflinePageUtils::IsShowingOfflinePreview(
}
// static
+bool OfflinePageUtils::IsShowingDownloadButtonInErrorPage(
+ content::WebContents* web_contents) {
+ chrome_browser_net::NetErrorTabHelper* tab_helper =
+ chrome_browser_net::NetErrorTabHelper::FromWebContents(web_contents);
+ return tab_helper && tab_helper->is_showing_download_button_in_error_page();
+}
+
+// static
bool OfflinePageUtils::GetTabId(content::WebContents* web_contents,
int* tab_id) {
TabAndroid* tab_android = TabAndroid::FromWebContents(web_contents);
« no previous file with comments | « chrome/browser/android/offline_pages/offline_page_utils.h ('k') | chrome/browser/net/net_error_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698