| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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_DOWNLOAD_INTERNAL_DOWNLOAD_SERVICE_IMPL_H_ | 5 #ifndef COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_SERVICE_IMPL_H_ |
| 6 #define COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_SERVICE_IMPL_H_ | 6 #define COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "components/download/internal/config.h" | |
| 13 #include "components/download/public/download_service.h" | 12 #include "components/download/public/download_service.h" |
| 14 | 13 |
| 15 namespace download { | 14 namespace download { |
| 16 | 15 |
| 16 class Controller; |
| 17 |
| 17 struct DownloadParams; | 18 struct DownloadParams; |
| 18 struct SchedulingParams; | 19 struct SchedulingParams; |
| 19 | 20 |
| 20 // The internal implementation of the DownloadService. | 21 // The internal implementation of the DownloadService. |
| 21 class DownloadServiceImpl : public DownloadService { | 22 class DownloadServiceImpl : public DownloadService { |
| 22 public: | 23 public: |
| 23 DownloadServiceImpl(std::unique_ptr<Configuration> config); | 24 DownloadServiceImpl(std::unique_ptr<Controller> controller); |
| 24 ~DownloadServiceImpl() override; | 25 ~DownloadServiceImpl() override; |
| 25 | 26 |
| 26 // DownloadService implementation. | 27 // DownloadService implementation. |
| 28 ServiceStatus GetStatus() override; |
| 27 void StartDownload(const DownloadParams& download_params) override; | 29 void StartDownload(const DownloadParams& download_params) override; |
| 28 void PauseDownload(const std::string& guid) override; | 30 void PauseDownload(const std::string& guid) override; |
| 29 void ResumeDownload(const std::string& guid) override; | 31 void ResumeDownload(const std::string& guid) override; |
| 30 void CancelDownload(const std::string& guid) override; | 32 void CancelDownload(const std::string& guid) override; |
| 31 void ChangeDownloadCriteria(const std::string& guid, | 33 void ChangeDownloadCriteria(const std::string& guid, |
| 32 const SchedulingParams& params) override; | 34 const SchedulingParams& params) override; |
| 33 | 35 |
| 34 private: | 36 private: |
| 35 std::unique_ptr<Configuration> config_; | 37 std::unique_ptr<Controller> controller_; |
| 36 | 38 |
| 37 DISALLOW_COPY_AND_ASSIGN(DownloadServiceImpl); | 39 DISALLOW_COPY_AND_ASSIGN(DownloadServiceImpl); |
| 38 }; | 40 }; |
| 39 | 41 |
| 40 } // namespace download | 42 } // namespace download |
| 41 | 43 |
| 42 #endif // COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_SERVICE_IMPL_H_ | 44 #endif // COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_SERVICE_IMPL_H_ |
| OLD | NEW |