| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> |
| 9 | 10 |
| 10 #include "base/files/file.h" | 11 #include "base/files/file.h" |
| 11 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
| 12 #include "base/process/process.h" | 13 #include "base/process/process.h" |
| 13 #include "ipc/ipc_platform_file.h" | 14 #include "ipc/ipc_platform_file.h" |
| 14 | 15 |
| 15 namespace base { | 16 namespace base { |
| 16 class FilePath; | 17 class FilePath; |
| 17 } | 18 } |
| 18 | 19 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 33 | 34 |
| 34 // Instructs the render view to generate a MHTML representation of the current | 35 // Instructs the render view to generate a MHTML representation of the current |
| 35 // page for |web_contents|. | 36 // page for |web_contents|. |
| 36 void SaveMHTML(WebContents* web_contents, | 37 void SaveMHTML(WebContents* web_contents, |
| 37 const base::FilePath& file_path, | 38 const base::FilePath& file_path, |
| 38 const GenerateMHTMLCallback& callback); | 39 const GenerateMHTMLCallback& callback); |
| 39 | 40 |
| 40 // Handler for ViewHostMsg_SavedPageAsMHTML (a notification from the renderer | 41 // Handler for ViewHostMsg_SavedPageAsMHTML (a notification from the renderer |
| 41 // that the MHTML generation finished). | 42 // that the MHTML generation finished). |
| 42 void OnSavedPageAsMHTML(int job_id, | 43 void OnSavedPageAsMHTML(int job_id, |
| 43 bool mhtml_generation_in_renderer_succeeded); | 44 bool mhtml_generation_in_renderer_succeeded, |
| 45 const std::string& mhtml_boundary_marker); |
| 44 | 46 |
| 45 private: | 47 private: |
| 46 friend struct base::DefaultSingletonTraits<MHTMLGenerationManager>; | 48 friend struct base::DefaultSingletonTraits<MHTMLGenerationManager>; |
| 47 class Job; | 49 class Job; |
| 48 enum class JobStatus { SUCCESS, FAILURE }; | 50 enum class JobStatus { SUCCESS, FAILURE }; |
| 49 | 51 |
| 50 MHTMLGenerationManager(); | 52 MHTMLGenerationManager(); |
| 51 virtual ~MHTMLGenerationManager(); | 53 virtual ~MHTMLGenerationManager(); |
| 52 | 54 |
| 53 // Called on the file thread to create |file|. | 55 // Called on the file thread to create |file|. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 76 IDToJobMap id_to_job_; | 78 IDToJobMap id_to_job_; |
| 77 | 79 |
| 78 int next_job_id_; | 80 int next_job_id_; |
| 79 | 81 |
| 80 DISALLOW_COPY_AND_ASSIGN(MHTMLGenerationManager); | 82 DISALLOW_COPY_AND_ASSIGN(MHTMLGenerationManager); |
| 81 }; | 83 }; |
| 82 | 84 |
| 83 } // namespace content | 85 } // namespace content |
| 84 | 86 |
| 85 #endif // CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ | 87 #endif // CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ |
| OLD | NEW |