michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsViewSourceHandler_h___ michael@0: #define nsViewSourceHandler_h___ michael@0: michael@0: #include "nsIProtocolHandler.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: class nsViewSourceHandler MOZ_FINAL : public nsIProtocolHandler michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIPROTOCOLHANDLER michael@0: michael@0: nsViewSourceHandler(); michael@0: michael@0: ~nsViewSourceHandler(); michael@0: michael@0: // Creates a new nsViewSourceChannel to view the source of an about:srcdoc michael@0: // URI with contents specified by srcdoc. michael@0: nsresult NewSrcdocChannel(nsIURI* uri, const nsAString &srcdoc, michael@0: nsIURI* baseURI, nsIChannel** result); michael@0: michael@0: static nsViewSourceHandler* GetInstance(); michael@0: michael@0: private: michael@0: static nsViewSourceHandler* gInstance; michael@0: michael@0: }; michael@0: michael@0: #endif /* !defined( nsViewSourceHandler_h___ ) */