| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // The original URL of the page to save. Empty if no redirect occurs. | 71 // The original URL of the page to save. Empty if no redirect occurs. |
| 72 GURL original_url; | 72 GURL original_url; |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 // Observer of the OfflinePageModel. | 75 // Observer of the OfflinePageModel. |
| 76 class Observer { | 76 class Observer { |
| 77 public: | 77 public: |
| 78 // Invoked when the model has finished loading. | 78 // Invoked when the model has finished loading. |
| 79 virtual void OfflinePageModelLoaded(OfflinePageModel* model) = 0; | 79 virtual void OfflinePageModelLoaded(OfflinePageModel* model) = 0; |
| 80 | 80 |
| 81 // Invoked when the model is being updated, due to adding, removing or | 81 // Invoked when the model is being updated due to adding an offline page. |
| 82 // updating an offline page. | 82 virtual void OfflinePageAdded(OfflinePageModel* model, |
| 83 virtual void OfflinePageModelChanged(OfflinePageModel* model) = 0; | 83 const OfflinePageItem& added_page) = 0; |
| 84 | 84 |
| 85 // Invoked when an offline copy related to |offline_id| was deleted. | 85 // Invoked when an offline copy related to |offline_id| was deleted. |
| 86 virtual void OfflinePageDeleted(int64_t offline_id, | 86 virtual void OfflinePageDeleted(int64_t offline_id, |
| 87 const ClientId& client_id) = 0; | 87 const ClientId& client_id) = 0; |
| 88 | 88 |
| 89 protected: | 89 protected: |
| 90 virtual ~Observer() = default; | 90 virtual ~Observer() = default; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 using CheckPagesExistOfflineResult = | 93 using CheckPagesExistOfflineResult = |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // TODO(dougarnett): Remove this and its uses. | 174 // TODO(dougarnett): Remove this and its uses. |
| 175 virtual bool is_loaded() const = 0; | 175 virtual bool is_loaded() const = 0; |
| 176 | 176 |
| 177 // Returns the logger. Ownership is retained by the model. | 177 // Returns the logger. Ownership is retained by the model. |
| 178 virtual OfflineEventLogger* GetLogger() = 0; | 178 virtual OfflineEventLogger* GetLogger() = 0; |
| 179 }; | 179 }; |
| 180 | 180 |
| 181 } // namespace offline_pages | 181 } // namespace offline_pages |
| 182 | 182 |
| 183 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ | 183 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| OLD | NEW |