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