| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 // The identification used by the client. | 64 // The identification used by the client. |
| 65 ClientId client_id; | 65 ClientId client_id; |
| 66 | 66 |
| 67 // Used for the offline_id for the saved file if non-zero. If it is | 67 // Used for the offline_id for the saved file if non-zero. If it is |
| 68 // kInvalidOfflineId, a new, random ID will be generated. | 68 // kInvalidOfflineId, a new, random ID will be generated. |
| 69 int64_t proposed_offline_id; | 69 int64_t proposed_offline_id; |
| 70 | 70 |
| 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 |
| 74 // Whether the page is being saved in the background. |
| 75 bool is_background; |
| 73 }; | 76 }; |
| 74 | 77 |
| 75 // Observer of the OfflinePageModel. | 78 // Observer of the OfflinePageModel. |
| 76 class Observer { | 79 class Observer { |
| 77 public: | 80 public: |
| 78 // Invoked when the model has finished loading. | 81 // Invoked when the model has finished loading. |
| 79 virtual void OfflinePageModelLoaded(OfflinePageModel* model) = 0; | 82 virtual void OfflinePageModelLoaded(OfflinePageModel* model) = 0; |
| 80 | 83 |
| 81 // Invoked when the model is being updated due to adding an offline page. | 84 // Invoked when the model is being updated due to adding an offline page. |
| 82 virtual void OfflinePageAdded(OfflinePageModel* model, | 85 virtual void OfflinePageAdded(OfflinePageModel* model, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // TODO(dougarnett): Remove this and its uses. | 177 // TODO(dougarnett): Remove this and its uses. |
| 175 virtual bool is_loaded() const = 0; | 178 virtual bool is_loaded() const = 0; |
| 176 | 179 |
| 177 // Returns the logger. Ownership is retained by the model. | 180 // Returns the logger. Ownership is retained by the model. |
| 178 virtual OfflineEventLogger* GetLogger() = 0; | 181 virtual OfflineEventLogger* GetLogger() = 0; |
| 179 }; | 182 }; |
| 180 | 183 |
| 181 } // namespace offline_pages | 184 } // namespace offline_pages |
| 182 | 185 |
| 183 #endif // COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_MODEL_H_ | 186 #endif // COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_MODEL_H_ |
| OLD | NEW |