OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_OFFLINE_PAGES_CORE_OFFLINE_PAGE_ARCHIVER_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_ARCHIVER_H_ |
6 #define COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_ARCHIVER_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_ARCHIVER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 ERROR_CONTENT_UNAVAILABLE, // Content to archive is not available. | 49 ERROR_CONTENT_UNAVAILABLE, // Content to archive is not available. |
50 ERROR_ARCHIVE_CREATION_FAILED, // Creation of archive failed. | 50 ERROR_ARCHIVE_CREATION_FAILED, // Creation of archive failed. |
51 ERROR_SECURITY_CERTIFICATE, // Page was loaded on secure connection, but | 51 ERROR_SECURITY_CERTIFICATE, // Page was loaded on secure connection, but |
52 // there was a security error. | 52 // there was a security error. |
53 ERROR_ERROR_PAGE, // We detected an error page. | 53 ERROR_ERROR_PAGE, // We detected an error page. |
54 ERROR_INTERSTITIAL_PAGE, // We detected an interstitial page. | 54 ERROR_INTERSTITIAL_PAGE, // We detected an interstitial page. |
55 }; | 55 }; |
56 | 56 |
57 // Describes the parameters to control how to create an archive. | 57 // Describes the parameters to control how to create an archive. |
58 struct CreateArchiveParams { | 58 struct CreateArchiveParams { |
59 CreateArchiveParams() : remove_popup_overlay(false) {} | 59 CreateArchiveParams() |
| 60 : remove_popup_overlay(false), use_page_problem_detectors(false) {} |
60 | 61 |
61 // Whether to remove popup overlay that obstructs viewing normal content. | 62 // Whether to remove popup overlay that obstructs viewing normal content. |
62 bool remove_popup_overlay; | 63 bool remove_popup_overlay; |
| 64 |
| 65 // Run page problem detectors while generating MTHML if true. |
| 66 bool use_page_problem_detectors; |
63 }; | 67 }; |
64 | 68 |
65 typedef base::Callback<void(OfflinePageArchiver* /* archiver */, | 69 typedef base::Callback<void(OfflinePageArchiver* /* archiver */, |
66 ArchiverResult /* result */, | 70 ArchiverResult /* result */, |
67 const GURL& /* url */, | 71 const GURL& /* url */, |
68 const base::FilePath& /* file_path */, | 72 const base::FilePath& /* file_path */, |
69 const base::string16& /* title */, | 73 const base::string16& /* title */, |
70 int64_t /* file_size */)> | 74 int64_t /* file_size */)> |
71 CreateArchiveCallback; | 75 CreateArchiveCallback; |
72 | 76 |
73 virtual ~OfflinePageArchiver() {} | 77 virtual ~OfflinePageArchiver() {} |
74 | 78 |
75 // Starts creating the archive in the |archives_dir| per | 79 // Starts creating the archive in the |archives_dir| per |
76 // |create_archive_params|. Once archive is created |callback| will be called | 80 // |create_archive_params|. Once archive is created |callback| will be called |
77 // with the result and additional information. | 81 // with the result and additional information. |
78 virtual void CreateArchive(const base::FilePath& archives_dir, | 82 virtual void CreateArchive(const base::FilePath& archives_dir, |
79 const CreateArchiveParams& create_archive_params, | 83 const CreateArchiveParams& create_archive_params, |
80 const CreateArchiveCallback& callback) = 0; | 84 const CreateArchiveCallback& callback) = 0; |
81 }; | 85 }; |
82 | 86 |
83 } // namespace offline_pages | 87 } // namespace offline_pages |
84 | 88 |
85 #endif // COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_ARCHIVER_H_ | 89 #endif // COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_ARCHIVER_H_ |
OLD | NEW |