зеркало из https://github.com/mozilla/gecko-dev.git
Bug 630364 - external application handlers do not honor warning preferences. r=blassey. a=blocking-fennec
This commit is contained in:
Родитель
599a8ec0a9
Коммит
73cf0eeb7b
|
@ -56,9 +56,10 @@ nsMIMEInfoAndroid::LoadUriInternal(nsIURI * aURI)
|
|||
{
|
||||
nsCString uriSpec;
|
||||
aURI->GetSpec(uriSpec);
|
||||
|
||||
if (mozilla::AndroidBridge::Bridge())
|
||||
return mozilla::AndroidBridge::Bridge()->
|
||||
OpenUriExternal(uriSpec, mMimeType) ? NS_OK : NS_ERROR_FAILURE;
|
||||
OpenUriExternal(uriSpec, EmptyCString()) ? NS_OK : NS_ERROR_FAILURE;
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -114,12 +115,11 @@ nsMIMEInfoAndroid::GetMimeInfoForURL(const nsACString &aURL,
|
|||
PRBool *found,
|
||||
nsIHandlerInfo **info)
|
||||
{
|
||||
const nsCString &emptyC = EmptyCString();
|
||||
mozilla::AndroidBridge* bridge = mozilla::AndroidBridge::Bridge();
|
||||
nsMIMEInfoAndroid *mimeinfo = new nsMIMEInfoAndroid(emptyC);
|
||||
nsMIMEInfoAndroid *mimeinfo = new nsMIMEInfoAndroid(aURL);
|
||||
NS_ADDREF(*info = mimeinfo);
|
||||
*found = PR_TRUE;
|
||||
|
||||
mozilla::AndroidBridge* bridge = mozilla::AndroidBridge::Bridge();
|
||||
if (!bridge) {
|
||||
// we don't have access to the bridge, so just assume we can handle
|
||||
// the protocol for now and let the system deal with it
|
||||
|
@ -149,7 +149,7 @@ nsMIMEInfoAndroid::GetMimeInfoForURL(const nsACString &aURL,
|
|||
NS_IMETHODIMP
|
||||
nsMIMEInfoAndroid::GetType(nsACString& aType)
|
||||
{
|
||||
aType.Assign(mMimeType);
|
||||
aType.Assign(mType);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -341,7 +341,7 @@ nsMIMEInfoAndroid::SetPrimaryExtension(const nsACString & aExtension)
|
|||
NS_IMETHODIMP
|
||||
nsMIMEInfoAndroid::GetMIMEType(nsACString & aMIMEType)
|
||||
{
|
||||
aMIMEType.Assign(mMimeType);
|
||||
aMIMEType.Assign(mType);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -354,7 +354,7 @@ nsMIMEInfoAndroid::Equals(nsIMIMEInfo *aMIMEInfo, PRBool *aRetVal)
|
|||
nsresult rv = aMIMEInfo->GetMIMEType(type);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
*aRetVal = mMimeType.Equals(type);
|
||||
*aRetVal = mType.Equals(type);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -375,7 +375,7 @@ nsMIMEInfoAndroid::LaunchWithFile(nsIFile *aFile)
|
|||
}
|
||||
|
||||
nsMIMEInfoAndroid::nsMIMEInfoAndroid(const nsACString& aMIMEType) :
|
||||
mMimeType(aMIMEType), mAlwaysAsk(PR_TRUE),
|
||||
mType(aMIMEType), mAlwaysAsk(PR_TRUE),
|
||||
mPrefAction(nsIMIMEInfo::useHelperApp)
|
||||
{
|
||||
mPrefApp = new nsMIMEInfoAndroid::SystemChooser(this);
|
||||
|
|
|
@ -65,7 +65,7 @@ protected:
|
|||
virtual NS_HIDDEN_(nsresult) LaunchDefaultWithFile(nsIFile* aFile);
|
||||
virtual NS_HIDDEN_(nsresult) LoadUriInternal(nsIURI *aURI);
|
||||
nsCOMPtr<nsIMutableArray> mHandlerApps;
|
||||
nsCString mMimeType;
|
||||
nsCString mType;
|
||||
nsTArray<nsCString> mExtensions;
|
||||
PRBool mAlwaysAsk;
|
||||
nsHandlerInfoAction mPrefAction;
|
||||
|
|
Загрузка…
Ссылка в новой задаче