| 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_CORE_OFFLINE_PAGE_MODEL_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_MODEL_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_MODEL_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_MODEL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 virtual void AddObserver(Observer* observer) = 0; | 109 virtual void AddObserver(Observer* observer) = 0; |
| 110 virtual void RemoveObserver(Observer* observer) = 0; | 110 virtual void RemoveObserver(Observer* observer) = 0; |
| 111 | 111 |
| 112 static const int64_t kInvalidOfflineId = 0; | 112 static const int64_t kInvalidOfflineId = 0; |
| 113 | 113 |
| 114 // Attempts to save a page offline per |save_page_params|. Requires that the | 114 // Attempts to save a page offline per |save_page_params|. Requires that the |
| 115 // model is loaded. Generates a new offline id or uses the proposed offline | 115 // model is loaded. Generates a new offline id or uses the proposed offline |
| 116 // id in |save_page_params| and returns it. | 116 // id in |save_page_params| and returns it. |
| 117 virtual void SavePage(const SavePageParams& save_page_params, | 117 virtual void SavePage(const SavePageParams& save_page_params, |
| 118 std::unique_ptr<OfflinePageArchiver> archiver, | 118 std::unique_ptr<OfflinePageArchiver> archiver, |
| 119 const std::vector<std::string>& signal_data, |
| 119 const SavePageCallback& callback) = 0; | 120 const SavePageCallback& callback) = 0; |
| 120 | 121 |
| 121 // Marks that the offline page related to the passed |offline_id| has been | 122 // Marks that the offline page related to the passed |offline_id| has been |
| 122 // accessed. Its access info, including last access time and access count, | 123 // accessed. Its access info, including last access time and access count, |
| 123 // will be updated. Requires that the model is loaded. | 124 // will be updated. Requires that the model is loaded. |
| 124 virtual void MarkPageAccessed(int64_t offline_id) = 0; | 125 virtual void MarkPageAccessed(int64_t offline_id) = 0; |
| 125 | 126 |
| 126 // Deletes pages based on |offline_ids|. | 127 // Deletes pages based on |offline_ids|. |
| 127 virtual void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, | 128 virtual void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, |
| 128 const DeletePageCallback& callback) = 0; | 129 const DeletePageCallback& callback) = 0; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 // TODO(dougarnett): Remove this and its uses. | 178 // TODO(dougarnett): Remove this and its uses. |
| 178 virtual bool is_loaded() const = 0; | 179 virtual bool is_loaded() const = 0; |
| 179 | 180 |
| 180 // Returns the logger. Ownership is retained by the model. | 181 // Returns the logger. Ownership is retained by the model. |
| 181 virtual OfflineEventLogger* GetLogger() = 0; | 182 virtual OfflineEventLogger* GetLogger() = 0; |
| 182 }; | 183 }; |
| 183 | 184 |
| 184 } // namespace offline_pages | 185 } // namespace offline_pages |
| 185 | 186 |
| 186 #endif // COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_MODEL_H_ | 187 #endif // COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_MODEL_H_ |
| OLD | NEW |