| 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 and the |distillation_size| (the size of the offline data). |
| 121 virtual void SetEntryDistilledInfo(const GURL& url, | 121 virtual void SetEntryDistilledInfo(const GURL& url, |
| 122 const base::FilePath& distilled_path, | 122 const base::FilePath& distilled_path, |
| 123 const GURL& distilled_url) = 0; | 123 const GURL& distilled_url, |
| 124 int64_t size) = 0; |
| 124 | 125 |
| 125 // Observer registration methods. The model will remove all observers upon | 126 // Observer registration methods. The model will remove all observers upon |
| 126 // destruction automatically. | 127 // destruction automatically. |
| 127 void AddObserver(ReadingListModelObserver* observer); | 128 void AddObserver(ReadingListModelObserver* observer); |
| 128 void RemoveObserver(ReadingListModelObserver* observer); | 129 void RemoveObserver(ReadingListModelObserver* observer); |
| 129 | 130 |
| 130 // Helper class that is used to scope batch updates. | 131 // Helper class that is used to scope batch updates. |
| 131 class ScopedReadingListBatchUpdate { | 132 class ScopedReadingListBatchUpdate { |
| 132 public: | 133 public: |
| 133 explicit ScopedReadingListBatchUpdate(ReadingListModel* model) | 134 explicit ScopedReadingListBatchUpdate(ReadingListModel* model) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 158 // Called when model is leaving batch update mode. | 159 // Called when model is leaving batch update mode. |
| 159 virtual void LeavingBatchUpdates(); | 160 virtual void LeavingBatchUpdates(); |
| 160 | 161 |
| 161 private: | 162 private: |
| 162 unsigned int current_batch_updates_count_; | 163 unsigned int current_batch_updates_count_; |
| 163 | 164 |
| 164 DISALLOW_COPY_AND_ASSIGN(ReadingListModel); | 165 DISALLOW_COPY_AND_ASSIGN(ReadingListModel); |
| 165 }; | 166 }; |
| 166 | 167 |
| 167 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_ | 168 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_ |
| OLD | NEW |