Chromium Code Reviews| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 virtual void RemoveEntryByURL(const GURL& url) = 0; | 103 virtual void RemoveEntryByURL(const GURL& url) = 0; |
| 104 | 104 |
| 105 // If the |url| is in the reading list and entry(|url|).read != |read|, sets | 105 // If the |url| is in the reading list and entry(|url|).read != |read|, sets |
| 106 // the read state of the URL to read. This will also update the update time of | 106 // the read state of the URL to read. This will also update the update time of |
| 107 // the entry. | 107 // the entry. |
| 108 virtual void SetReadStatus(const GURL& url, bool read) = 0; | 108 virtual void SetReadStatus(const GURL& url, bool read) = 0; |
| 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 SetEntryDistilledPath(const GURL& url, | |
| 114 const base::FilePath& distilled_path) = 0; | |
| 115 virtual void SetEntryDistilledState( | 113 virtual void SetEntryDistilledState( |
| 116 const GURL& url, | 114 const GURL& url, |
| 117 ReadingListEntry::DistillationState state) = 0; | 115 ReadingListEntry::DistillationState state) = 0; |
| 118 | 116 |
| 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| | |
| 119 // (path of the file on disk) and the |distilled_url| (url of the page that | |
| 120 // was distilled. | |
| 121 virtual void SetEntryDistilledInfo(const GURL& url, | |
|
gambard
2017/01/20 14:01:24
Put it in the same order than the SetEntryDistille
Olivier
2017/01/20 14:43:51
Not sure I understand.
Do you mean change order of
gambard
2017/01/20 14:53:32
Order of methods declaration, sorry.
Your change w
| |
| 122 const base::FilePath& distilled_path, | |
| 123 const GURL& distilled_url) = 0; | |
| 124 | |
| 119 // Observer registration methods. The model will remove all observers upon | 125 // Observer registration methods. The model will remove all observers upon |
| 120 // destruction automatically. | 126 // destruction automatically. |
| 121 void AddObserver(ReadingListModelObserver* observer); | 127 void AddObserver(ReadingListModelObserver* observer); |
| 122 void RemoveObserver(ReadingListModelObserver* observer); | 128 void RemoveObserver(ReadingListModelObserver* observer); |
| 123 | 129 |
| 124 // Helper class that is used to scope batch updates. | 130 // Helper class that is used to scope batch updates. |
| 125 class ScopedReadingListBatchUpdate { | 131 class ScopedReadingListBatchUpdate { |
| 126 public: | 132 public: |
| 127 explicit ScopedReadingListBatchUpdate(ReadingListModel* model) | 133 explicit ScopedReadingListBatchUpdate(ReadingListModel* model) |
| 128 : model_(model) {} | 134 : model_(model) {} |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 152 // Called when model is leaving batch update mode. | 158 // Called when model is leaving batch update mode. |
| 153 virtual void LeavingBatchUpdates(); | 159 virtual void LeavingBatchUpdates(); |
| 154 | 160 |
| 155 private: | 161 private: |
| 156 unsigned int current_batch_updates_count_; | 162 unsigned int current_batch_updates_count_; |
| 157 | 163 |
| 158 DISALLOW_COPY_AND_ASSIGN(ReadingListModel); | 164 DISALLOW_COPY_AND_ASSIGN(ReadingListModel); |
| 159 }; | 165 }; |
| 160 | 166 |
| 161 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_ | 167 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_ |
| OLD | NEW |