Chromium Code Reviews| 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 90ed8bfbe1ad4a2b63a99b0904d76cee594b186d..acde4c9401528bfc78bad50b75195c7943a3f998 100644 |
| --- a/components/offline_pages/offline_page_model.h |
| +++ b/components/offline_pages/offline_page_model.h |
| @@ -242,9 +242,23 @@ class OfflinePageModel : public KeyedService, public base::SupportsUserData { |
| void GetPagesByOnlineURL(const GURL& online_url, |
| const MultipleOfflinePageItemCallback& callback); |
| + // Returns via callback an offline page saved for |online_url|, if any. The |
| + // best page is chosen based on creation date; a more recently created offline |
| + // page will be preferred over an older one. This API function does not |
|
fgorski
2016/05/10 20:52:53
nit: Be consistent with usage of double space afte
dewittj
2016/05/11 15:57:25
Done.
|
| + // respect namespaces, as it is used to choose which page is rendered in a |
| + // tab. Today all namespaces are treated equally for the purposes of this |
| + // selection. |
| + void GetBestPageForOnlineURL(const GURL& online_url, |
| + const SingleOfflinePageItemCallback callback); |
| + |
| // Returns an offline page saved for |online_url|. A nullptr is returned if |
| - // not found. |
| - const OfflinePageItem* MaybeGetPageByOnlineURL(const GURL& online_url) const; |
| + // not found. The best page is chosen based on creation date; a more recently |
|
fgorski
2016/05/10 20:52:53
Simply:
See |GetBestPAge..| for selection of best
dewittj
2016/05/11 15:57:25
Done.
|
| + // created offline page will be preferred over an older one. This API |
| + // function does not respect namespaces, as it is used to choose which page is |
| + // rendered in a tab. Today all namespaces are treated equally for the |
| + // purposes of this selection. |
| + const OfflinePageItem* MaybeGetBestPageForOnlineURL( |
| + 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 |
| @@ -305,6 +319,9 @@ class OfflinePageModel : public KeyedService, public base::SupportsUserData { |
| void GetPageByOfflineURLWhenLoadDone( |
| const GURL& offline_url, |
| const SingleOfflinePageItemCallback& callback) const; |
| + void GetBestPageForOnlineURLWhenLoadDone( |
| + const GURL& online_url, |
| + const SingleOfflinePageItemCallback& callback) const; |
| // Callback for checking whether we have offline pages. |
| void HasPagesAfterLoadDone(const std::string& name_space, |