| 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 #include "ios/chrome/browser/reading_list/url_downloader.h" | 5 #include "ios/chrome/browser/reading_list/url_downloader.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #import "base/mac/bind_objc_block.h" | 10 #import "base/mac/bind_objc_block.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 if (offlineURLExists) { | 79 if (offlineURLExists) { |
| 80 DownloadCompletionHandler(url, std::string(), DOWNLOAD_EXISTS); | 80 DownloadCompletionHandler(url, std::string(), DOWNLOAD_EXISTS); |
| 81 return; | 81 return; |
| 82 } | 82 } |
| 83 distiller_.reset(new DistillerViewerTest( | 83 distiller_.reset(new DistillerViewerTest( |
| 84 url, | 84 url, |
| 85 base::Bind(&URLDownloader::DistillerCallback, base::Unretained(this)))); | 85 base::Bind(&URLDownloader::DistillerCallback, base::Unretained(this)))); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void OnEndDownload(const GURL& url, | 88 void OnEndDownload(const GURL& url, |
| 89 const GURL& distilled_url, |
| 89 SuccessState success, | 90 SuccessState success, |
| 90 const base::FilePath& distilled_path, | 91 const base::FilePath& distilled_path, |
| 91 const std::string& title) { | 92 const std::string& title) { |
| 92 downloaded_files_.push_back(url); | 93 downloaded_files_.push_back(url); |
| 93 } | 94 } |
| 94 | 95 |
| 95 void OnEndRemove(const GURL& url, bool success) { | 96 void OnEndRemove(const GURL& url, bool success) { |
| 96 removed_files_.push_back(url); | 97 removed_files_.push_back(url); |
| 97 } | 98 } |
| 98 }; | 99 }; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 ASSERT_TRUE(std::find(downloader_->downloaded_files_.begin(), | 185 ASSERT_TRUE(std::find(downloader_->downloaded_files_.begin(), |
| 185 downloader_->downloaded_files_.end(), | 186 downloader_->downloaded_files_.end(), |
| 186 url) != downloader_->downloaded_files_.end()); | 187 url) != downloader_->downloaded_files_.end()); |
| 187 ASSERT_TRUE(std::find(downloader_->removed_files_.begin(), | 188 ASSERT_TRUE(std::find(downloader_->removed_files_.begin(), |
| 188 downloader_->removed_files_.end(), | 189 downloader_->removed_files_.end(), |
| 189 url) != downloader_->removed_files_.end()); | 190 url) != downloader_->removed_files_.end()); |
| 190 ASSERT_TRUE(downloader_->CheckExistenceOfOfflineURLPagePath(url)); | 191 ASSERT_TRUE(downloader_->CheckExistenceOfOfflineURLPagePath(url)); |
| 191 } | 192 } |
| 192 | 193 |
| 193 } // namespace | 194 } // namespace |
| OLD | NEW |