| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "components/offline_pages/offline_page_model.h" | 5 #include "components/offline_pages/offline_page_model.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "components/offline_pages/offline_page_item.h" | 8 #include "components/offline_pages/offline_page_item.h" |
| 9 #include "components/offline_pages/offline_page_metadata_store.h" | 9 #include "components/offline_pages/offline_page_metadata_store.h" |
| 10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| 11 | 11 |
| 12 namespace offline_pages { | 12 namespace offline_pages { |
| 13 | 13 |
| 14 OfflinePageModel::OfflinePageModel(scoped_ptr<OfflinePageMetadataStore> store) | 14 OfflinePageModel::OfflinePageModel(scoped_ptr<OfflinePageMetadataStore> store, |
| 15 : store_(store.Pass()) { | 15 OfflinePageArchiver* archiver) |
| 16 : store_(store.Pass()), |
| 17 archiver_(archiver) { |
| 18 DCHECK(archiver); |
| 16 } | 19 } |
| 17 | 20 |
| 18 OfflinePageModel::~OfflinePageModel() { | 21 OfflinePageModel::~OfflinePageModel() { |
| 19 } | 22 } |
| 20 | 23 |
| 21 void OfflinePageModel::Shutdown() { | 24 void OfflinePageModel::Shutdown() { |
| 25 } |
| 26 |
| 27 void OfflinePageModel::SavePageOffline(const GURL& url) { |
| 28 } |
| 29 |
| 30 void OfflinePageModel::OnCreateArchiveSuccess( |
| 31 const OfflinePageArchiver::Request& request, |
| 32 const base::FilePath& file_path) { |
| 33 // TODO(fgorski): Match request against one of the expected requests |
| 34 // TODO(fgorski): Create an entry in the offline pages metadata store for that |
| 35 // request. |
| 22 NOTIMPLEMENTED(); | 36 NOTIMPLEMENTED(); |
| 23 } | 37 } |
| 24 | 38 |
| 25 void OfflinePageModel::SavePageOffline(const GURL& url) { | 39 void OfflinePageModel::OnCreateArchiveFailure( |
| 40 const OfflinePageArchiver::Request& request) { |
| 41 // TODO(fgorski): Log error and clean up. Respond with failure. |
| 42 // TODO(fgorski): Write offline page metadata in the store_. |
| 26 NOTIMPLEMENTED(); | 43 NOTIMPLEMENTED(); |
| 27 } | 44 } |
| 28 | 45 |
| 29 std::vector<OfflinePageItem> OfflinePageModel::GetAllOfflinePages() { | 46 std::vector<OfflinePageItem> OfflinePageModel::GetAllOfflinePages() { |
| 30 NOTIMPLEMENTED(); | 47 NOTIMPLEMENTED(); |
| 31 return std::vector<OfflinePageItem>(); | 48 return std::vector<OfflinePageItem>(); |
| 32 } | 49 } |
| 33 | 50 |
| 34 OfflinePageMetadataStore* OfflinePageModel::GetStoreForTesting() { | 51 OfflinePageMetadataStore* OfflinePageModel::GetStoreForTesting() { |
| 35 return store_.get(); | 52 return store_.get(); |
| 36 } | 53 } |
| 37 | 54 |
| 38 } // namespace offline_pages | 55 } // namespace offline_pages |
| OLD | NEW |