| 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_NTP_SNIPPETS_OFFLINE_PAGES_PROXY_OFFLINE_PAGE_PROXY_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_OFFLINE_PAGES_PROXY_OFFLINE_PAGE_PROXY_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_OFFLINE_PAGES_PROXY_OFFLINE_PAGE_PROXY_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_OFFLINE_PAGES_PROXY_OFFLINE_PAGE_PROXY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 void AddObserver(Observer* observer); | 53 void AddObserver(Observer* observer); |
| 54 void RemoveObserver(Observer* observer); | 54 void RemoveObserver(Observer* observer); |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 friend class base::RefCounted<OfflinePageProxy>; | 57 friend class base::RefCounted<OfflinePageProxy>; |
| 58 | 58 |
| 59 ~OfflinePageProxy() override; | 59 ~OfflinePageProxy() override; |
| 60 | 60 |
| 61 // OfflinePageModel::Observer implementation. | 61 // OfflinePageModel::Observer implementation. |
| 62 void OfflinePageModelLoaded(offline_pages::OfflinePageModel* model) override; | 62 void OfflinePageModelLoaded(offline_pages::OfflinePageModel* model) override; |
| 63 void OfflinePageModelChanged(offline_pages::OfflinePageModel* model) override; | 63 void OfflinePageAdded(offline_pages::OfflinePageModel* model, |
| 64 offline_pages::SavePageResult result, |
| 65 const offline_pages::OfflinePageItem* item) override; |
| 64 void OfflinePageDeleted(int64_t offline_id, | 66 void OfflinePageDeleted(int64_t offline_id, |
| 65 const offline_pages::ClientId& client_id) override; | 67 const offline_pages::ClientId& client_id) override; |
| 66 | 68 |
| 67 // Queries the OfflinePageModel for offline pages and notifies observers | 69 // Queries the OfflinePageModel for offline pages and notifies observers |
| 68 // through |OfflinePageModelChanged|. | 70 // through |OfflinePageModelChanged|. |
| 69 void FetchOfflinePagesAndNotify(); | 71 void FetchOfflinePagesAndNotify(); |
| 70 | 72 |
| 71 // Callback from the |OfflinePageModel::GetAllPages|. | 73 // Callback from the |OfflinePageModel::GetAllPages|. |
| 72 void OnOfflinePagesLoaded( | 74 void OnOfflinePagesLoaded( |
| 73 const offline_pages::MultipleOfflinePageItemResult& result); | 75 const offline_pages::MultipleOfflinePageItemResult& result); |
| 74 | 76 |
| 75 offline_pages::OfflinePageModel* offline_page_model_; | 77 offline_pages::OfflinePageModel* offline_page_model_; |
| 76 base::ObserverList<Observer> observers_; | 78 base::ObserverList<Observer> observers_; |
| 77 base::WeakPtrFactory<OfflinePageProxy> weak_ptr_factory_; | 79 base::WeakPtrFactory<OfflinePageProxy> weak_ptr_factory_; |
| 78 | 80 |
| 79 DISALLOW_COPY_AND_ASSIGN(OfflinePageProxy); | 81 DISALLOW_COPY_AND_ASSIGN(OfflinePageProxy); |
| 80 }; | 82 }; |
| 81 | 83 |
| 82 } // namespace ntp_snippets | 84 } // namespace ntp_snippets |
| 83 | 85 |
| 84 #endif // COMPONENTS_NTP_SNIPPETS_OFFLINE_PAGES_PROXY_OFFLINE_PAGE_PROXY_H_ | 86 #endif // COMPONENTS_NTP_SNIPPETS_OFFLINE_PAGES_PROXY_OFFLINE_PAGE_PROXY_H_ |
| OLD | NEW |