Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "apps/saved_files_service_delegate_impl.h" | |
| 6 | |
| 7 #include "apps/saved_files_service.h" | |
| 8 #include "content/public/browser/browser_context.h" | |
| 9 | |
| 10 namespace apps { | |
| 11 | |
| 12 SavedFilesServiceDelegateImpl::SavedFilesServiceDelegateImpl( | |
| 13 content::BrowserContext* browser_context) { | |
| 14 saved_files_service_ = SavedFilesService::Get(browser_context); | |
|
Devlin
2017/06/14 14:53:21
why not initialize this in the initializer list?
| |
| 15 } | |
| 16 | |
| 17 SavedFilesServiceDelegateImpl::~SavedFilesServiceDelegateImpl() {} | |
| 18 | |
| 19 bool SavedFilesServiceDelegateImpl::IsRegistered( | |
| 20 const std::string& extension_id, | |
| 21 const std::string& id) { | |
| 22 return saved_files_service_->IsRegistered(extension_id, id); | |
| 23 } | |
| 24 | |
| 25 void SavedFilesServiceDelegateImpl::RegisterFileEntry( | |
| 26 const std::string& extension_id, | |
| 27 const File& file) { | |
| 28 saved_files_service_->RegisterFileEntry(extension_id, file.id, file.path, | |
| 29 file.is_directory); | |
| 30 } | |
| 31 | |
| 32 bool SavedFilesServiceDelegateImpl::GetRegisteredFileInfo( | |
| 33 const std::string& extension_id, | |
| 34 const std::string& id, | |
| 35 File* file) { | |
| 36 const SavedFileEntry* entry = | |
| 37 saved_files_service_->GetFileEntry(extension_id, id); | |
| 38 if (!entry) | |
| 39 return false; | |
| 40 file->id = entry->id; | |
| 41 file->path = entry->path; | |
| 42 file->is_directory = entry->is_directory; | |
| 43 return true; | |
| 44 } | |
| 45 | |
| 46 void SavedFilesServiceDelegateImpl::EnqueueFileEntry( | |
| 47 const std::string& extension_id, | |
| 48 const std::string& id) { | |
| 49 saved_files_service_->EnqueueFileEntry(extension_id, id); | |
| 50 } | |
| 51 | |
| 52 } // namespace apps | |
| OLD | NEW |