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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "components/reading_list/ios/offline_url_utils.h" | 14 #include "components/reading_list/core/offline_url_utils.h" |
15 #include "ios/chrome/browser/chrome_paths.h" | 15 #include "ios/chrome/browser/chrome_paths.h" |
16 #include "ios/chrome/browser/dom_distiller/distiller_viewer.h" | 16 #include "ios/chrome/browser/dom_distiller/distiller_viewer.h" |
17 #include "ios/chrome/browser/reading_list/reading_list_distiller_page.h" | 17 #include "ios/chrome/browser/reading_list/reading_list_distiller_page.h" |
18 #include "ios/chrome/browser/reading_list/reading_list_distiller_page_factory.h" | 18 #include "ios/chrome/browser/reading_list/reading_list_distiller_page_factory.h" |
19 #include "ios/web/public/web_thread.h" | 19 #include "ios/web/public/web_thread.h" |
20 #include "net/base/escape.h" | 20 #include "net/base/escape.h" |
21 #include "net/base/load_flags.h" | 21 #include "net/base/load_flags.h" |
22 #include "net/http/http_response_headers.h" | 22 #include "net/http/http_response_headers.h" |
23 #include "net/url_request/url_fetcher.h" | 23 #include "net/url_request/url_fetcher.h" |
24 #include "net/url_request/url_fetcher_delegate.h" | 24 #include "net/url_request/url_fetcher_delegate.h" |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 base::FilePath path = reading_list::OfflineURLAbsolutePathFromRelativePath( | 377 base::FilePath path = reading_list::OfflineURLAbsolutePathFromRelativePath( |
378 base_directory_, | 378 base_directory_, |
379 reading_list::OfflinePagePath(url, reading_list::OFFLINE_TYPE_HTML)); | 379 reading_list::OfflinePagePath(url, reading_list::OFFLINE_TYPE_HTML)); |
380 int written = base::WriteFile(path, html.c_str(), html.length()); | 380 int written = base::WriteFile(path, html.c_str(), html.length()); |
381 if (written <= 0) { | 381 if (written <= 0) { |
382 return false; | 382 return false; |
383 } | 383 } |
384 saved_size_ += written; | 384 saved_size_ += written; |
385 return true; | 385 return true; |
386 } | 386 } |
OLD | NEW |