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

Unified Diff: components/offline_pages/offline_page_model.h

Issue 2503853004: Support getting offline pages also by original URL (Closed)
Patch Set: Make NTP redirect work per comment Created 4 years, 1 month 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: components/offline_pages/offline_page_model.h
diff --git a/components/offline_pages/offline_page_model.h b/components/offline_pages/offline_page_model.h
index 272f6dc9c0cfe2744853758c7dca29c5b62b6a4c..5eb2cba101a33f482e921869bda0cf1c5a211452 100644
--- a/components/offline_pages/offline_page_model.h
+++ b/components/offline_pages/offline_page_model.h
@@ -48,6 +48,15 @@ struct OfflinePageItem;
// * how to cancel requests and what to expect
class OfflinePageModel : public base::SupportsUserData {
public:
+ // Controls how to search on differnt URLs for pages.
+ enum class URLSearchMode {
+ // Match against the last committed URL only.
+ SEARCH_BY_FINAL_URL_ONLY,
+ // Match against all stored URLs, including the last committed URL and
+ // the original request URL.
+ SEARCH_BY_ALL_URLS
+ };
+
// Describes the parameters to control how to save a page.
struct SavePageParams {
SavePageParams();
@@ -160,9 +169,11 @@ class OfflinePageModel : public base::SupportsUserData {
int64_t offline_id,
const SingleOfflinePageItemCallback& callback) = 0;
- // Returns the offline pages that are stored under |online_url|.
- virtual void GetPagesByOnlineURL(
- const GURL& online_url,
+ // Returns the offline pages that are related to |url|. |url_search_mode|
+ // controls how the url match is done. See URLSearchMode for more details.
+ virtual void GetPagesByURL(
+ const GURL& url,
+ URLSearchMode url_search_mode,
const MultipleOfflinePageItemCallback& callback) = 0;
// Marks pages with |offline_ids| as expired and deletes the associated

Powered by Google App Engine
This is Rietveld 408576698