| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_READING_LIST_IOS_READING_LIST_MODEL_H_ | 5 #ifndef COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_ |
| 6 #define COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_ | 6 #define COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 // Methods to mutate an entry. Will locate the relevant entry by URL. Does | 110 // Methods to mutate an entry. Will locate the relevant entry by URL. Does |
| 111 // nothing if the entry is not found. | 111 // nothing if the entry is not found. |
| 112 virtual void SetEntryTitle(const GURL& url, const std::string& title) = 0; | 112 virtual void SetEntryTitle(const GURL& url, const std::string& title) = 0; |
| 113 virtual void SetEntryDistilledState( | 113 virtual void SetEntryDistilledState( |
| 114 const GURL& url, | 114 const GURL& url, |
| 115 ReadingListEntry::DistillationState state) = 0; | 115 ReadingListEntry::DistillationState state) = 0; |
| 116 | 116 |
| 117 // Sets the Distilled info for the entry |url|. This method sets the | 117 // Sets the Distilled info for the entry |url|. This method sets the |
| 118 // DistillationState of the entry to PROCESSED and sets the |distilled_path| | 118 // DistillationState of the entry to PROCESSED and sets the |distilled_path| |
| 119 // (path of the file on disk) and the |distilled_url| (url of the page that | 119 // (path of the file on disk), the |distilled_url| (url of the page that |
| 120 // was distilled. | 120 // was distilled, the |distillation_size| (the size of the offline data) and |
| 121 // the |distillation_date| (date of distillation in microseconds since Jan 1st |
| 122 // 1970. |
| 121 virtual void SetEntryDistilledInfo(const GURL& url, | 123 virtual void SetEntryDistilledInfo(const GURL& url, |
| 122 const base::FilePath& distilled_path, | 124 const base::FilePath& distilled_path, |
| 123 const GURL& distilled_url) = 0; | 125 const GURL& distilled_url, |
| 126 int64_t distilation_size, |
| 127 int64_t distilation_time) = 0; |
| 124 | 128 |
| 125 // Observer registration methods. The model will remove all observers upon | 129 // Observer registration methods. The model will remove all observers upon |
| 126 // destruction automatically. | 130 // destruction automatically. |
| 127 void AddObserver(ReadingListModelObserver* observer); | 131 void AddObserver(ReadingListModelObserver* observer); |
| 128 void RemoveObserver(ReadingListModelObserver* observer); | 132 void RemoveObserver(ReadingListModelObserver* observer); |
| 129 | 133 |
| 130 // Helper class that is used to scope batch updates. | 134 // Helper class that is used to scope batch updates. |
| 131 class ScopedReadingListBatchUpdate { | 135 class ScopedReadingListBatchUpdate { |
| 132 public: | 136 public: |
| 133 explicit ScopedReadingListBatchUpdate(ReadingListModel* model) | 137 explicit ScopedReadingListBatchUpdate(ReadingListModel* model) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 158 // Called when model is leaving batch update mode. | 162 // Called when model is leaving batch update mode. |
| 159 virtual void LeavingBatchUpdates(); | 163 virtual void LeavingBatchUpdates(); |
| 160 | 164 |
| 161 private: | 165 private: |
| 162 unsigned int current_batch_updates_count_; | 166 unsigned int current_batch_updates_count_; |
| 163 | 167 |
| 164 DISALLOW_COPY_AND_ASSIGN(ReadingListModel); | 168 DISALLOW_COPY_AND_ASSIGN(ReadingListModel); |
| 165 }; | 169 }; |
| 166 | 170 |
| 167 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_ | 171 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_ |
| OLD | NEW |