Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: components/reading_list/ios/reading_list_model.h

Issue 2541683003: Clean ReadingListModel. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/reading_list/ios/reading_list_model_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
109 : model_(model) {} 109 : model_(model) {}
110 110
111 virtual ~ScopedReadingListBatchUpdate(); 111 virtual ~ScopedReadingListBatchUpdate();
112 112
113 private: 113 private:
114 ReadingListModel* model_; 114 ReadingListModel* model_;
115 115
116 DISALLOW_COPY_AND_ASSIGN(ScopedReadingListBatchUpdate); 116 DISALLOW_COPY_AND_ASSIGN(ScopedReadingListBatchUpdate);
117 }; 117 };
118 118
119 // TODO(crbug.com/664924): Remove temporary methods for transition.
120
121 // Allows iterating through read entries in the model. Must be called on a
122 // singlerunloop to ensure no entry is returned twice and all entries are
123 // returned
124 virtual const ReadingListEntry& GetReadEntryAtIndex(size_t index) const = 0;
125 virtual const ReadingListEntry& GetUnreadEntryAtIndex(size_t index) const = 0;
126 virtual void MarkReadByURL(const GURL& url) = 0;
127 virtual void MarkUnreadByURL(const GURL& url) = 0;
128 virtual size_t read_size() const = 0;
129
130 protected: 119 protected:
131 ReadingListModel(); 120 ReadingListModel();
132 virtual ~ReadingListModel(); 121 virtual ~ReadingListModel();
133 122
134 // The observers. 123 // The observers.
135 base::ObserverList<ReadingListModelObserver> observers_; 124 base::ObserverList<ReadingListModelObserver> observers_;
136 125
137 // Tells model that batch updates have completed. Called from 126 // Tells model that batch updates have completed. Called from
138 // ReadingListBatchUpdateToken dtor. 127 // ReadingListBatchUpdateToken dtor.
139 virtual void EndBatchUpdates(); 128 virtual void EndBatchUpdates();
140 129
141 // Called when model is entering batch update mode. 130 // Called when model is entering batch update mode.
142 virtual void EnteringBatchUpdates(); 131 virtual void EnteringBatchUpdates();
143 132
144 // Called when model is leaving batch update mode. 133 // Called when model is leaving batch update mode.
145 virtual void LeavingBatchUpdates(); 134 virtual void LeavingBatchUpdates();
146 135
147 private: 136 private:
148 unsigned int current_batch_updates_count_; 137 unsigned int current_batch_updates_count_;
149 138
150 DISALLOW_COPY_AND_ASSIGN(ReadingListModel); 139 DISALLOW_COPY_AND_ASSIGN(ReadingListModel);
151 }; 140 };
152 141
153 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_ 142 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | components/reading_list/ios/reading_list_model_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698