| 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 11 matching lines...) Expand all Loading... |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 class DistillerViewerTest : public dom_distiller::DistillerViewerInterface { | 24 class DistillerViewerTest : public dom_distiller::DistillerViewerInterface { |
| 25 public: | 25 public: |
| 26 DistillerViewerTest(const GURL& url, | 26 DistillerViewerTest(const GURL& url, |
| 27 const DistillationFinishedCallback& callback, | 27 const DistillationFinishedCallback& callback, |
| 28 reading_list::ReadingListDistillerPageDelegate* delegate, | 28 reading_list::ReadingListDistillerPageDelegate* delegate, |
| 29 const std::string& html, | 29 const std::string& html, |
| 30 const GURL& redirect_url, | 30 const GURL& redirect_url, |
| 31 const std::string& mime_type) | 31 const std::string& mime_type) |
| 32 : dom_distiller::DistillerViewerInterface(nil, nil) { | 32 : dom_distiller::DistillerViewerInterface(nil) { |
| 33 std::vector<ImageInfo> images; | 33 std::vector<ImageInfo> images; |
| 34 if (redirect_url.is_valid()) { | 34 if (redirect_url.is_valid()) { |
| 35 delegate->DistilledPageRedirectedToURL(url, redirect_url); | 35 delegate->DistilledPageRedirectedToURL(url, redirect_url); |
| 36 } | 36 } |
| 37 if (!mime_type.empty()) { | 37 if (!mime_type.empty()) { |
| 38 delegate->DistilledPageHasMimeType(url, mime_type); | 38 delegate->DistilledPageHasMimeType(url, mime_type); |
| 39 } | 39 } |
| 40 callback.Run(url, html, images, "title"); | 40 callback.Run(url, html, images, "title"); |
| 41 } | 41 } |
| 42 | 42 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 ASSERT_TRUE(std::find(downloader_->downloaded_files_.begin(), | 252 ASSERT_TRUE(std::find(downloader_->downloaded_files_.begin(), |
| 253 downloader_->downloaded_files_.end(), | 253 downloader_->downloaded_files_.end(), |
| 254 url) != downloader_->downloaded_files_.end()); | 254 url) != downloader_->downloaded_files_.end()); |
| 255 ASSERT_TRUE(std::find(downloader_->removed_files_.begin(), | 255 ASSERT_TRUE(std::find(downloader_->removed_files_.begin(), |
| 256 downloader_->removed_files_.end(), | 256 downloader_->removed_files_.end(), |
| 257 url) != downloader_->removed_files_.end()); | 257 url) != downloader_->removed_files_.end()); |
| 258 ASSERT_TRUE(downloader_->CheckExistenceOfOfflineURLPagePath(url)); | 258 ASSERT_TRUE(downloader_->CheckExistenceOfOfflineURLPagePath(url)); |
| 259 } | 259 } |
| 260 | 260 |
| 261 } // namespace | 261 } // namespace |
| OLD | NEW |