| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // Returns zero or one offline pages associated with a specified |offline_id|. | 142 // Returns zero or one offline pages associated with a specified |offline_id|. |
| 143 virtual void GetPageByOfflineId( | 143 virtual void GetPageByOfflineId( |
| 144 int64_t offline_id, | 144 int64_t offline_id, |
| 145 const SingleOfflinePageItemCallback& callback) = 0; | 145 const SingleOfflinePageItemCallback& callback) = 0; |
| 146 | 146 |
| 147 // Returns an offline page associated with a specified |offline_id|. nullptr | 147 // Returns an offline page associated with a specified |offline_id|. nullptr |
| 148 // is returned if not found. | 148 // is returned if not found. |
| 149 virtual const OfflinePageItem* MaybeGetPageByOfflineId( | 149 virtual const OfflinePageItem* MaybeGetPageByOfflineId( |
| 150 int64_t offline_id) const = 0; | 150 int64_t offline_id) const = 0; |
| 151 | 151 |
| 152 // Returns the offline page that is stored under |offline_url|, if any. | |
| 153 virtual void GetPageByOfflineURL( | |
| 154 const GURL& offline_url, | |
| 155 const SingleOfflinePageItemCallback& callback) = 0; | |
| 156 | |
| 157 // Returns an offline page that is stored as |offline_url|. A nullptr is | |
| 158 // returned if not found. | |
| 159 // | |
| 160 // This function is deprecated, and may return |nullptr| even if a page | |
| 161 // exists, depending on the implementation details of OfflinePageModel. | |
| 162 // Use |GetPageByOfflineURL| instead. | |
| 163 virtual const OfflinePageItem* MaybeGetPageByOfflineURL( | |
| 164 const GURL& offline_url) const = 0; | |
| 165 | |
| 166 // Returns the offline pages that are stored under |online_url|. | 152 // Returns the offline pages that are stored under |online_url|. |
| 167 virtual void GetPagesByOnlineURL( | 153 virtual void GetPagesByOnlineURL( |
| 168 const GURL& online_url, | 154 const GURL& online_url, |
| 169 const MultipleOfflinePageItemCallback& callback) = 0; | 155 const MultipleOfflinePageItemCallback& callback) = 0; |
| 170 | 156 |
| 171 // Returns an offline page saved for |online_url|. A nullptr is returned if | 157 // Returns an offline page saved for |online_url|. A nullptr is returned if |
| 172 // not found. See |GetBestPageForOnlineURL| for selection criteria. | 158 // not found. See |GetBestPageForOnlineURL| for selection criteria. |
| 173 virtual const OfflinePageItem* MaybeGetBestPageForOnlineURL( | 159 virtual const OfflinePageItem* MaybeGetBestPageForOnlineURL( |
| 174 const GURL& online_url) const = 0; | 160 const GURL& online_url) const = 0; |
| 175 | 161 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 192 // TODO(dougarnett): Remove this and its uses. | 178 // TODO(dougarnett): Remove this and its uses. |
| 193 virtual bool is_loaded() const = 0; | 179 virtual bool is_loaded() const = 0; |
| 194 | 180 |
| 195 // Returns the logger. Ownership is retained by the model. | 181 // Returns the logger. Ownership is retained by the model. |
| 196 virtual OfflineEventLogger* GetLogger() = 0; | 182 virtual OfflineEventLogger* GetLogger() = 0; |
| 197 }; | 183 }; |
| 198 | 184 |
| 199 } // namespace offline_pages | 185 } // namespace offline_pages |
| 200 | 186 |
| 201 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ | 187 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| OLD | NEW |