mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
Updated to use property object to find implementor of nsIPrompt...(bug 5418 sort of)
This commit is contained in:
parent
332f71e329
commit
fc22fc06b6
@ -1167,23 +1167,11 @@ GlobalWindowImpl::Confirm(JSContext *cx, jsval *argv, PRUint32 argc, PRBool* aRe
|
||||
nsIWebShell *rootWebShell;
|
||||
ret = mWebShell->GetRootWebShellEvenIfChrome(rootWebShell);
|
||||
if (nsnull != rootWebShell) {
|
||||
nsIWebShellContainer *rootContainer;
|
||||
ret = rootWebShell->GetContainer(rootContainer);
|
||||
if (nsnull != rootContainer) {
|
||||
#ifdef NECKO
|
||||
nsIPrompt *prompter;
|
||||
if (NS_OK == (ret = rootContainer->QueryInterface(NS_GET_IID(nsIPrompt), (void**)&prompter))) {
|
||||
ret = prompter->Confirm(str.GetUnicode(), aReturn);
|
||||
NS_RELEASE(prompter);
|
||||
}
|
||||
#else
|
||||
nsINetSupport *support;
|
||||
if (NS_OK == (ret = rootContainer->QueryInterface(kINetSupportIID, (void**)&support))) {
|
||||
*aReturn = support->Confirm(str);
|
||||
NS_RELEASE(support);
|
||||
}
|
||||
#endif
|
||||
NS_RELEASE(rootContainer);
|
||||
nsIPrompt *prompter;
|
||||
ret = rootWebShell->QueryInterface(NS_GET_IID(nsIPrompt), (void**)&prompter);
|
||||
if (NS_SUCCEEDED(ret)) {
|
||||
ret = prompter->Confirm(str.GetUnicode(), aReturn);
|
||||
NS_RELEASE(prompter);
|
||||
}
|
||||
NS_RELEASE(rootWebShell);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user