Chromium Code Reviews| Index: content/public/browser/mhtml_extra_data.h |
| diff --git a/content/public/browser/mhtml_extra_data.h b/content/public/browser/mhtml_extra_data.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6ef8ec6f760b0c552313d551b5eaa72696980035 |
| --- /dev/null |
| +++ b/content/public/browser/mhtml_extra_data.h |
| @@ -0,0 +1,32 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_PUBLIC_BROWSER_MHTML_EXTRA_DATA_H_ |
| +#define CONTENT_PUBLIC_BROWSER_MHTML_EXTRA_DATA_H_ |
| + |
| +#include "base/supports_user_data.h" |
| +#include "content/public/browser/web_contents.h" |
| + |
| +namespace content { |
| + |
| +// Interface class for adding an extra part to MHTML when doing MHTML |
| +// generation. To use it, get it from the web contents with FromWebContents, |
| +// then call AddExtraMHTMLPart to add a new part. |
| +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.
|
| + public: |
| + // Retrieves the extra data from the web contents. |
| + static MHTMLExtraData* FromWebContents(WebContents* contents); |
| + |
| + // Add an extra MHTML part to the data structure stored by the WebContents. |
| + // This will take care of generating the boundary line. This will also set |
| + // the content-type and content-location headers to the values provided, and |
| + // use the body provided. |
| + virtual void AddExtraMHTMLPart(const std::string& content_type, |
| + const std::string& content_location, |
| + const std::string& body) = 0; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_BROWSER_MHTML_EXTRA_DATA_H_ |