From 9d5c2cade8b6f0ed0536f3e29f3c9756f637a85f Mon Sep 17 00:00:00 2001 From: "peterlubczynski%netscape.com" Date: Thu, 2 Aug 2001 00:03:29 +0000 Subject: [PATCH] Move code for showing content viewer out of object frame, part of bug 93105 r=av sr=waterson --- layout/generic/nsObjectFrame.cpp | 38 +++++++++++++------------- layout/html/base/src/nsObjectFrame.cpp | 38 +++++++++++++------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 3ce4aab8f7a..454c990ee30 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -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 container; - mPresContext->GetContainer(getter_AddRefs(container)); - if (container) { - nsCOMPtr cvc(do_QueryInterface(container)); - if (cvc) { - nsCOMPtr 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 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 container; + aPresContext->GetContainer(getter_AddRefs(container)); + if (container) { + nsCOMPtr cvc(do_QueryInterface(container)); + if (cvc) { + nsCOMPtr cv; + cvc->GetContentViewer(getter_AddRefs(cv)); + if (cv) + cv->Show(); + } + } + // Register focus listener if (content) { nsCOMPtr receiver(do_QueryInterface(content)); diff --git a/layout/html/base/src/nsObjectFrame.cpp b/layout/html/base/src/nsObjectFrame.cpp index 3ce4aab8f7a..454c990ee30 100644 --- a/layout/html/base/src/nsObjectFrame.cpp +++ b/layout/html/base/src/nsObjectFrame.cpp @@ -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 container; - mPresContext->GetContainer(getter_AddRefs(container)); - if (container) { - nsCOMPtr cvc(do_QueryInterface(container)); - if (cvc) { - nsCOMPtr 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 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 container; + aPresContext->GetContainer(getter_AddRefs(container)); + if (container) { + nsCOMPtr cvc(do_QueryInterface(container)); + if (cvc) { + nsCOMPtr cv; + cvc->GetContentViewer(getter_AddRefs(cv)); + if (cv) + cv->Show(); + } + } + // Register focus listener if (content) { nsCOMPtr receiver(do_QueryInterface(content));