OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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. | |
4 | |
5 #ifndef CONTENT_PUBLIC_BROWSER_MHTML_EXTRA_DATA_H_ | |
6 #define CONTENT_PUBLIC_BROWSER_MHTML_EXTRA_DATA_H_ | |
7 | |
8 #include "base/supports_user_data.h" | |
9 #include "content/public/browser/web_contents.h" | |
10 | |
11 namespace content { | |
12 | |
13 // Interface class for adding an extra part to MHTML when doing MHTML | |
14 // generation. To use it, get it from the web contents with FromWebContents, | |
15 // then call AddExtraMHTMLPart to add a new part. | |
16 class CONTENT_EXPORT MHTMLExtraData : public base::SupportsUserData::Data { | |
Dmitry Titov
2017/03/29 18:53:06
Naming sugegstion: ExtraData -> ExtraParts? It'd b
Pete Williamson
2017/03/29 22:05:43
Done.
| |
17 public: | |
18 // Retrieves the extra data from the web contents. | |
19 static MHTMLExtraData* FromWebContents(WebContents* contents); | |
20 | |
21 // Add an extra MHTML part to the data structure stored by the WebContents. | |
22 // This will take care of generating the boundary line. This will also set | |
23 // the content-type and content-location headers to the values provided, and | |
24 // use the body provided. | |
25 virtual void AddExtraMHTMLPart(const std::string& content_type, | |
26 const std::string& content_location, | |
27 const std::string& body) = 0; | |
28 }; | |
29 | |
30 } // namespace content | |
31 | |
32 #endif // CONTENT_PUBLIC_BROWSER_MHTML_EXTRA_DATA_H_ | |
OLD | NEW |