2015-02-13 22:36:47 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2012-05-21 15:12:37 +04:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2000-11-09 00:00:37 +03:00
|
|
|
|
|
|
|
#ifndef NSDEFAULTURIFIXUP_H
|
|
|
|
#define NSDEFAULTURIFIXUP_H
|
|
|
|
|
|
|
|
#include "nsIURIFixup.h"
|
|
|
|
|
2014-04-25 02:42:00 +04:00
|
|
|
class nsDefaultURIFixupInfo;
|
|
|
|
|
2000-11-09 00:00:37 +03:00
|
|
|
/* Header file */
|
|
|
|
class nsDefaultURIFixup : public nsIURIFixup
|
|
|
|
{
|
|
|
|
public:
|
2015-02-13 22:36:37 +03:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIURIFIXUP
|
2000-11-09 00:00:37 +03:00
|
|
|
|
2015-02-13 22:36:37 +03:00
|
|
|
nsDefaultURIFixup();
|
2000-11-09 00:00:37 +03:00
|
|
|
|
|
|
|
protected:
|
2015-02-13 22:36:37 +03:00
|
|
|
virtual ~nsDefaultURIFixup();
|
2000-11-09 00:00:37 +03:00
|
|
|
|
|
|
|
private:
|
2015-02-13 22:36:37 +03:00
|
|
|
/* additional members */
|
|
|
|
nsresult FileURIFixup(const nsACString& aStringURI, nsIURI** aURI);
|
|
|
|
nsresult ConvertFileToStringURI(const nsACString& aIn, nsCString& aResult);
|
|
|
|
nsresult FixupURIProtocol(const nsACString& aIn,
|
|
|
|
nsDefaultURIFixupInfo* aFixupInfo,
|
|
|
|
nsIURI** aURI);
|
|
|
|
nsresult KeywordURIFixup(const nsACString& aStringURI,
|
|
|
|
nsDefaultURIFixupInfo* aFixupInfo,
|
|
|
|
nsIInputStream** aPostData);
|
|
|
|
nsresult TryKeywordFixupForURIInfo(const nsACString& aStringURI,
|
|
|
|
nsDefaultURIFixupInfo* aFixupInfo,
|
|
|
|
nsIInputStream** aPostData);
|
|
|
|
bool PossiblyByteExpandedFileName(const nsAString& aIn);
|
|
|
|
bool PossiblyHostPortUrl(const nsACString& aUrl);
|
|
|
|
bool MakeAlternateURI(nsIURI* aURI);
|
|
|
|
bool IsLikelyFTP(const nsCString& aHostSpec);
|
|
|
|
bool IsDomainWhitelisted(const nsAutoCString aAsciiHost,
|
|
|
|
const uint32_t aDotLoc);
|
2000-11-09 00:00:37 +03:00
|
|
|
};
|
|
|
|
|
2014-04-25 02:42:00 +04:00
|
|
|
class nsDefaultURIFixupInfo : public nsIURIFixupInfo
|
|
|
|
{
|
|
|
|
public:
|
2015-02-13 22:36:37 +03:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIURIFIXUPINFO
|
2014-04-25 02:42:00 +04:00
|
|
|
|
2015-02-13 22:36:37 +03:00
|
|
|
explicit nsDefaultURIFixupInfo(const nsACString& aOriginalInput);
|
2014-04-25 02:42:00 +04:00
|
|
|
|
2015-02-13 22:36:37 +03:00
|
|
|
friend class nsDefaultURIFixup;
|
2014-04-25 02:42:00 +04:00
|
|
|
|
|
|
|
protected:
|
2015-02-13 22:36:37 +03:00
|
|
|
virtual ~nsDefaultURIFixupInfo();
|
2014-04-25 02:42:00 +04:00
|
|
|
|
|
|
|
private:
|
2015-02-13 22:36:37 +03:00
|
|
|
nsCOMPtr<nsISupports> mConsumer;
|
|
|
|
nsCOMPtr<nsIURI> mPreferredURI;
|
|
|
|
nsCOMPtr<nsIURI> mFixedURI;
|
|
|
|
bool mFixupChangedProtocol;
|
|
|
|
bool mFixupCreatedAlternateURI;
|
|
|
|
nsString mKeywordProviderName;
|
|
|
|
nsString mKeywordAsSent;
|
|
|
|
nsAutoCString mOriginalInput;
|
2014-04-25 02:42:00 +04:00
|
|
|
};
|
2000-11-09 00:00:37 +03:00
|
|
|
#endif
|