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

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

Issue 2040163003: Refactors offline page tab helper to stash the offline page item on redirect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@single-result
Patch Set: fix nit. Created 4 years, 6 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.h
diff --git a/chrome/browser/android/offline_pages/offline_page_utils.h b/chrome/browser/android/offline_pages/offline_page_utils.h
index bdda54ae7f933e397760110f0b1c243eb8e0db7c..a09715d8c30c93e8b3418149745d13ef04e32095 100644
--- a/chrome/browser/android/offline_pages/offline_page_utils.h
+++ b/chrome/browser/android/offline_pages/offline_page_utils.h
@@ -13,6 +13,7 @@ class GURL;
namespace content {
class BrowserContext;
+class WebContents;
}
namespace offline_pages {
@@ -53,6 +54,12 @@ class OfflinePageUtils {
// Marks that the offline page related to the |offline_url| has been accessed.
static void MarkPageAccessed(content::BrowserContext* browser_context,
const GURL& offline_url);
+
+ // Gets the offline page corresponding to the given web contents. The
+ // returned pointer is owned by the web_contents and may be deleted by user
+ // navigation, so it is unsafe to store a copy of the returned pointer.
+ static const OfflinePageItem* GetOfflinePageFromWebContents(
+ content::WebContents* web_contents);
};
} // namespace offline_pages

Powered by Google App Engine
This is Rietveld 408576698