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 #import "ios/chrome/browser/ui/reading_list/reading_list_menu_notifier.h" | 5 #import "ios/chrome/browser/ui/reading_list/reading_list_menu_notifier.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "components/reading_list/core/reading_list_model.h" | 9 #include "components/reading_list/core/reading_list_model.h" |
10 #import "ios/chrome/browser/ui/reading_list/reading_list_menu_notification_deleg
ate.h" | 10 #import "ios/chrome/browser/ui/reading_list/reading_list_menu_notification_deleg
ate.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 void ReadingListModelLoaded(const ReadingListModel* model) override {} | 46 void ReadingListModelLoaded(const ReadingListModel* model) override {} |
47 | 47 |
48 void ReadingListModelBeganBatchUpdates( | 48 void ReadingListModelBeganBatchUpdates( |
49 const ReadingListModel* model) override {} | 49 const ReadingListModel* model) override {} |
50 | 50 |
51 void ReadingListModelCompletedBatchUpdates( | 51 void ReadingListModelCompletedBatchUpdates( |
52 const ReadingListModel* model) override { | 52 const ReadingListModel* model) override { |
53 [owner_ readingListModelCompletedBatchUpdates:model]; | 53 [owner_ readingListModelCompletedBatchUpdates:model]; |
54 } | 54 } |
55 | 55 |
56 void ReadingListModelBeingDeleted(const ReadingListModel* model) override{}; | 56 void ReadingListModelBeingDeleted(const ReadingListModel* model) override {} |
57 | 57 |
58 void ReadingListDidApplyChanges(ReadingListModel* model) override { | 58 void ReadingListDidApplyChanges(ReadingListModel* model) override { |
59 [owner_ readingListModelCompletedBatchUpdates:model]; | 59 [owner_ readingListModelCompletedBatchUpdates:model]; |
60 } | 60 } |
61 | 61 |
62 private: | 62 private: |
63 ReadingListMenuNotifier* owner_; // weak, owns us | 63 ReadingListMenuNotifier* owner_; // weak, owns us |
64 }; | 64 }; |
65 | 65 |
66 @implementation ReadingListMenuNotifier | 66 @implementation ReadingListMenuNotifier |
(...skipping 24 matching lines...) Expand all Loading... |
91 | 91 |
92 - (NSInteger)readingListUnreadCount { | 92 - (NSInteger)readingListUnreadCount { |
93 return _readingListModel->unread_size(); | 93 return _readingListModel->unread_size(); |
94 } | 94 } |
95 | 95 |
96 - (BOOL)readingListUnseenItemsExist { | 96 - (BOOL)readingListUnseenItemsExist { |
97 return _readingListModel->unseen_size() > 0; | 97 return _readingListModel->unseen_size() > 0; |
98 } | 98 } |
99 | 99 |
100 @end | 100 @end |
OLD | NEW |