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

Unified Diff: components/offline_pages/offline_page_model.h

Issue 1442433003: Add "Show saved copy" button in dino page when there's offline copy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update button color for "Show all saved pages" per UI review Created 5 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 628de2aa052f39bd97ef4da1c033562dfb8ac791..28acc7afaea5c796cd02facdc901a3ab6f28f1ca 100644
--- a/components/offline_pages/offline_page_model.h
+++ b/components/offline_pages/offline_page_model.h
@@ -173,6 +173,9 @@ class OfflinePageModel : public KeyedService,
// Wipes out all the data by deleting all saved files and clearing the store.
void ClearAll(const base::Closure& callback);
+ // Returns true if there're offline pages.
+ bool HasOfflinePages() const;
+
// Gets all available offline pages. Requires that the model is loaded.
const std::vector<OfflinePageItem> GetAllPages() const;
@@ -188,6 +191,10 @@ class OfflinePageModel : public KeyedService,
// returned if not found.
const OfflinePageItem* GetPageByOfflineURL(const GURL& offline_url) const;
+ // Returns an offline page saved for |online_url|. A nullptr is returned if
+ // not found.
+ const OfflinePageItem* GetPageByOnlineURL(const GURL& online_url) const;
+
// Checks that all of the offline pages have corresponding offline copies.
// If a page is discovered to be missing an offline copy, its offline page
// metadata will be removed and |OfflinePageDeleted| will be sent to model
« no previous file with comments | « components/error_page/renderer/net_error_helper_core_unittest.cc ('k') | components/offline_pages/offline_page_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698