Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / content / renderer / mhtml_generator.h
blob8a65b46afb4c819844b9b64e41176fd2bfb8092a
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_MHTML_GENERATOR_H_
6 #define CONTENT_RENDERER_MHTML_GENERATOR_H_
8 #include "base/files/file.h"
9 #include "content/public/renderer/render_view_observer.h"
10 #include "ipc/ipc_platform_file.h"
12 namespace content {
13 class RenderViewImpl;
15 class MHTMLGenerator : public RenderViewObserver {
16 public:
17 explicit MHTMLGenerator(RenderViewImpl* render_view);
18 ~MHTMLGenerator() override;
20 private:
21 // RenderViewObserver implementation:
22 bool OnMessageReceived(const IPC::Message& message) override;
24 void OnSavePageAsMHTML(int job_id,
25 IPC::PlatformFileForTransit file_for_transit);
27 void NotifyBrowser(int job_id, int64 data_size);
28 // Returns the size of the generated MHTML, -1 if it failed.
29 int64 GenerateMHTML();
31 base::File file_;
33 DISALLOW_COPY_AND_ASSIGN(MHTMLGenerator);
36 } // namespace content
38 #endif // CONTENT_RENDERER_MHTML_GENERATOR_H_