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

Unified Diff: chrome/browser/android/offline_pages/offline_page_utils.cc

Issue 2337363002: Load live version when reloading an offline page on connected network (Closed)
Patch Set: Address more feedback Created 4 years, 3 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 1f06a44459557725bfa8bf96ba82a262bb5b5766..07ebb1bbc3b8439c85205e276354cecebd3ebb3e 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 "components/offline_pages/offline_page_feature.h"
#include "components/offline_pages/offline_page_item.h"
#include "components/offline_pages/offline_page_model.h"
+#include "components/offline_pages/request_header/offline_page_header.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/web_contents.h"
#include "url/gurl.h"
@@ -152,6 +153,7 @@ void OfflinePageUtils::MarkPageAccessed(
offline_page_model->MarkPageAccessed(offline_page->offline_id);
}
+// static
const OfflinePageItem* OfflinePageUtils::GetOfflinePageFromWebContents(
content::WebContents* web_contents) {
OfflinePageTabHelper* tab_helper =
@@ -160,6 +162,14 @@ const OfflinePageItem* OfflinePageUtils::GetOfflinePageFromWebContents(
}
// static
+const OfflinePageHeader* OfflinePageUtils::GetOfflineHeaderFromWebContents(
+ content::WebContents* web_contents) {
+ OfflinePageTabHelper* tab_helper =
+ OfflinePageTabHelper::FromWebContents(web_contents);
+ return tab_helper ? &(tab_helper->offline_header()) : nullptr;
+}
+
+// static
bool OfflinePageUtils::GetTabId(content::WebContents* web_contents,
int* tab_id) {
TabAndroid* tab_android = TabAndroid::FromWebContents(web_contents);

Powered by Google App Engine
This is Rietveld 408576698