Move code for showing content viewer out of object frame, part of bug 93105 r=av sr=waterson

git-svn-id: svn://10.0.0.236/trunk@100156 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterlubczynski%netscape.com
2001-08-02 00:03:29 +00:00
parent ba40ce17ff
commit f45f689ab5
2 changed files with 38 additions and 38 deletions

View File

@@ -426,25 +426,7 @@ nsObjectFrame::Init(nsIPresContext* aPresContext,
return rv;
mPresContext = aPresContext; // weak ref
// This is way of ensure the previous document is gone. Important when reloading either
// the page or refreshing plugins. In the case of an OBJECT frame,
// we want to flush out the prevous content viewer which will cause the previous document
// and plugins to be cleaned up. Then we can create our new plugin without the old instance
// hanging around.
nsCOMPtr<nsISupports> container;
mPresContext->GetContainer(getter_AddRefs(container));
if (container) {
nsCOMPtr<nsIDocShell> cvc(do_QueryInterface(container));
if (cvc) {
nsCOMPtr<nsIContentViewer> cv;
cvc->GetContentViewer(getter_AddRefs(cv));
if (cv)
cv->Show();
}
}
PRBool bImage = PR_FALSE;
//Ideally should be call to imlib, when it is available
@@ -3122,6 +3104,24 @@ NS_IMETHODIMP nsPluginInstanceOwner::Init(nsIPresContext* aPresContext, nsObject
nsCOMPtr<nsIContent> content;
mOwner->GetContent(getter_AddRefs(content));
// This is way of ensure the previous document is gone. Important when reloading either
// the page or refreshing plugins. In the case of an OBJECT frame,
// we want to flush out the prevous content viewer which will cause the previous document
// and plugins to be cleaned up. Then we can create our new plugin without the old instance
// hanging around.
nsCOMPtr<nsISupports> container;
aPresContext->GetContainer(getter_AddRefs(container));
if (container) {
nsCOMPtr<nsIDocShell> cvc(do_QueryInterface(container));
if (cvc) {
nsCOMPtr<nsIContentViewer> cv;
cvc->GetContentViewer(getter_AddRefs(cv));
if (cv)
cv->Show();
}
}
// Register focus listener
if (content) {
nsCOMPtr<nsIDOMEventReceiver> receiver(do_QueryInterface(content));