mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
fall back on nsILoadGroup when nsIChannel has no nsIPrompt.
Bug 72111; r=bbaetz, sr=darin
This commit is contained in:
parent
a5c73d7696
commit
d0c4ee54ef
@ -1806,6 +1806,16 @@ nsFtpState::Init(nsIFTPChannel* aChannel,
|
||||
|
||||
mKeepRunning = PR_TRUE;
|
||||
mPrompter = aPrompter;
|
||||
if (!mPrompter) {
|
||||
nsCOMPtr<nsILoadGroup> ldGrp;
|
||||
aChannel->GetLoadGroup(getter_AddRefs(ldGrp));
|
||||
if (ldGrp) {
|
||||
nsCOMPtr<nsIInterfaceRequestor> cbs;
|
||||
rv = ldGrp->GetNotificationCallbacks(getter_AddRefs(cbs));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
mPrompter = do_GetInterface(cbs);
|
||||
}
|
||||
}
|
||||
mFTPEventSink = sink;
|
||||
mAuthPrompter = aAuthPrompter;
|
||||
mCacheEntry = cacheEntry;
|
||||
|
@ -581,10 +581,18 @@ nsGopherChannel::SendRequest(nsITransport* aTransport)
|
||||
if (pos == -1) {
|
||||
// We require a query string here - if we don't have one,
|
||||
// then we need to ask the user
|
||||
if (!mPrompter) {
|
||||
if (mLoadGroup) {
|
||||
nsCOMPtr<nsIInterfaceRequestor> cbs;
|
||||
rv = mLoadGroup->GetNotificationCallbacks(getter_AddRefs(cbs));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
mPrompter = do_GetInterface(cbs);
|
||||
}
|
||||
if (!mPrompter) {
|
||||
NS_ERROR("We need a prompter!");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
nsXPIDLString search;
|
||||
PRBool res;
|
||||
mPrompter->Prompt(NS_LITERAL_STRING("Search").get(),
|
||||
|
Loading…
Reference in New Issue
Block a user