2000-11-08 21:00:37 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
*
|
2012-05-21 11:12:37 +00:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* 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-08 21:00:37 +00:00
|
|
|
|
|
|
|
#ifndef NSDEFAULTURIFIXUP_H
|
|
|
|
#define NSDEFAULTURIFIXUP_H
|
|
|
|
|
|
|
|
#include "nsIURIFixup.h"
|
|
|
|
|
2014-04-24 22:42:00 +00:00
|
|
|
class nsDefaultURIFixupInfo;
|
|
|
|
|
2000-11-08 21:00:37 +00:00
|
|
|
/* Header file */
|
|
|
|
class nsDefaultURIFixup : public nsIURIFixup
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIURIFIXUP
|
|
|
|
|
|
|
|
nsDefaultURIFixup();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~nsDefaultURIFixup();
|
|
|
|
|
|
|
|
private:
|
|
|
|
/* additional members */
|
2003-07-02 00:39:51 +00:00
|
|
|
nsresult FileURIFixup(const nsACString &aStringURI, nsIURI** aURI);
|
|
|
|
nsresult ConvertFileToStringURI(const nsACString& aIn, nsCString& aOut);
|
2014-07-25 10:46:07 +00:00
|
|
|
nsresult FixupURIProtocol(const nsACString& aIn,
|
|
|
|
nsDefaultURIFixupInfo* aFixupInfo,
|
|
|
|
nsIURI** aURI);
|
2014-09-11 13:50:55 +00:00
|
|
|
nsresult KeywordURIFixup(const nsACString &aStringURI,
|
|
|
|
nsDefaultURIFixupInfo* aFixupInfo,
|
|
|
|
nsIInputStream** aPostData);
|
|
|
|
nsresult TryKeywordFixupForURIInfo(const nsACString &aStringURI,
|
|
|
|
nsDefaultURIFixupInfo* aFixupInfo,
|
|
|
|
nsIInputStream** aPostData);
|
2011-09-29 06:19:26 +00:00
|
|
|
bool PossiblyByteExpandedFileName(const nsAString& aIn);
|
|
|
|
bool PossiblyHostPortUrl(const nsACString& aUrl);
|
|
|
|
bool MakeAlternateURI(nsIURI *aURI);
|
|
|
|
bool IsLikelyFTP(const nsCString& aHostSpec);
|
2014-08-29 03:25:02 +00:00
|
|
|
bool IsDomainWhitelisted(const nsAutoCString aAsciiHost,
|
|
|
|
const uint32_t aDotLoc);
|
2000-11-08 21:00:37 +00:00
|
|
|
};
|
|
|
|
|
2014-04-24 22:42:00 +00:00
|
|
|
class nsDefaultURIFixupInfo : public nsIURIFixupInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIURIFIXUPINFO
|
|
|
|
|
2014-09-01 22:01:37 +00:00
|
|
|
explicit nsDefaultURIFixupInfo(const nsACString& aOriginalInput);
|
2014-04-24 22:42:00 +00:00
|
|
|
|
|
|
|
friend class nsDefaultURIFixup;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~nsDefaultURIFixupInfo();
|
|
|
|
|
|
|
|
private:
|
|
|
|
nsCOMPtr<nsISupports> mConsumer;
|
|
|
|
nsCOMPtr<nsIURI> mPreferredURI;
|
|
|
|
nsCOMPtr<nsIURI> mFixedURI;
|
2014-07-25 10:46:07 +00:00
|
|
|
bool mFixupChangedProtocol;
|
|
|
|
bool mFixupCreatedAlternateURI;
|
2014-09-11 13:50:55 +00:00
|
|
|
nsString mKeywordProviderName;
|
|
|
|
nsString mKeywordAsSent;
|
2014-04-24 22:42:00 +00:00
|
|
|
nsAutoCString mOriginalInput;
|
|
|
|
};
|
2000-11-08 21:00:37 +00:00
|
|
|
#endif
|