| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 // Returns via callback all GURLs in |urls| that are equal to the online URL | 140 // Returns via callback all GURLs in |urls| that are equal to the online URL |
| 141 // of any offline page. | 141 // of any offline page. |
| 142 virtual void CheckPagesExistOffline( | 142 virtual void CheckPagesExistOffline( |
| 143 const std::set<GURL>& urls, | 143 const std::set<GURL>& urls, |
| 144 const CheckPagesExistOfflineCallback& callback) = 0; | 144 const CheckPagesExistOfflineCallback& callback) = 0; |
| 145 | 145 |
| 146 // Gets all offline pages. | 146 // Gets all offline pages. |
| 147 virtual void GetAllPages(const MultipleOfflinePageItemCallback& callback) = 0; | 147 virtual void GetAllPages(const MultipleOfflinePageItemCallback& callback) = 0; |
| 148 | 148 |
| 149 // Gets all offline pages including expired ones. | |
| 150 virtual void GetAllPagesWithExpired( | |
| 151 const MultipleOfflinePageItemCallback& callback) = 0; | |
| 152 | |
| 153 // Gets all offline ids where the offline page has the matching client id. | 149 // Gets all offline ids where the offline page has the matching client id. |
| 154 virtual void GetOfflineIdsForClientId( | 150 virtual void GetOfflineIdsForClientId( |
| 155 const ClientId& client_id, | 151 const ClientId& client_id, |
| 156 const MultipleOfflineIdCallback& callback) = 0; | 152 const MultipleOfflineIdCallback& callback) = 0; |
| 157 | 153 |
| 158 // Returns zero or one offline pages associated with a specified |offline_id|. | 154 // Returns zero or one offline pages associated with a specified |offline_id|. |
| 159 virtual void GetPageByOfflineId( | 155 virtual void GetPageByOfflineId( |
| 160 int64_t offline_id, | 156 int64_t offline_id, |
| 161 const SingleOfflinePageItemCallback& callback) = 0; | 157 const SingleOfflinePageItemCallback& callback) = 0; |
| 162 | 158 |
| 163 // Returns the offline pages that are stored under |online_url|. | 159 // Returns the offline pages that are stored under |online_url|. |
| 164 virtual void GetPagesByOnlineURL( | 160 virtual void GetPagesByOnlineURL( |
| 165 const GURL& online_url, | 161 const GURL& online_url, |
| 166 const MultipleOfflinePageItemCallback& callback) = 0; | 162 const MultipleOfflinePageItemCallback& callback) = 0; |
| 167 | 163 |
| 168 // Marks pages with |offline_ids| as expired and deletes the associated | |
| 169 // archive files. | |
| 170 virtual void ExpirePages(const std::vector<int64_t>& offline_ids, | |
| 171 const base::Time& expiration_time, | |
| 172 const base::Callback<void(bool)>& callback) = 0; | |
| 173 | |
| 174 // Returns the policy controller. | 164 // Returns the policy controller. |
| 175 virtual ClientPolicyController* GetPolicyController() = 0; | 165 virtual ClientPolicyController* GetPolicyController() = 0; |
| 176 | 166 |
| 177 // TODO(dougarnett): Remove this and its uses. | 167 // TODO(dougarnett): Remove this and its uses. |
| 178 virtual bool is_loaded() const = 0; | 168 virtual bool is_loaded() const = 0; |
| 179 | 169 |
| 180 // Returns the logger. Ownership is retained by the model. | 170 // Returns the logger. Ownership is retained by the model. |
| 181 virtual OfflineEventLogger* GetLogger() = 0; | 171 virtual OfflineEventLogger* GetLogger() = 0; |
| 182 }; | 172 }; |
| 183 | 173 |
| 184 } // namespace offline_pages | 174 } // namespace offline_pages |
| 185 | 175 |
| 186 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ | 176 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| OLD | NEW |