Chromium Code Reviews| Index: sky/engine/core/html/HTMLIFrameElement.cpp |
| diff --git a/sky/engine/core/html/HTMLIFrameElement.cpp b/sky/engine/core/html/HTMLIFrameElement.cpp |
| index 29b0908cced9a23bf9767949d267f86f4c51d62c..30721b78c65c0ddbffc594b0709129e3a3aa17c8 100644 |
| --- a/sky/engine/core/html/HTMLIFrameElement.cpp |
| +++ b/sky/engine/core/html/HTMLIFrameElement.cpp |
| @@ -26,6 +26,8 @@ HTMLIFrameElement::HTMLIFrameElement(Document& document) |
| HTMLIFrameElement::~HTMLIFrameElement() |
| { |
| + if (m_contentView) |
| + m_contentView->RemoveObserver(this); |
| } |
| Node::InsertionNotificationRequest HTMLIFrameElement::insertedInto(ContainerNode* insertionPoint) |
| @@ -39,9 +41,8 @@ Node::InsertionNotificationRequest HTMLIFrameElement::insertedInto(ContainerNode |
| void HTMLIFrameElement::removedFrom(ContainerNode* insertionPoint) |
| { |
| HTMLElement::removedFrom(insertionPoint); |
| - if (insertionPoint->inDocument()) { |
| - // TODO(mpcomplete): Tear down the mojo View. |
| - } |
| + if (m_contentView) |
| + m_contentView->Destroy(); |
| } |
| RenderObject* HTMLIFrameElement::createRenderer(RenderStyle* style) |
| @@ -67,6 +68,8 @@ void HTMLIFrameElement::createView() |
| KURL url = document().completeURL(urlString); |
| m_contentView = parentFrame->loaderClient()->createChildFrame(url); |
| + if (m_contentView) |
| + m_contentView->AddObserver(this); |
|
esprehn
2014/11/17 23:19:41
Why do we need to be an observer?
Matt Perry
2014/11/18 16:28:45
I'm just guarding against the possibility that the
esprehn
2014/11/18 17:53:42
I guess what I mean is, don't we need to implement
Matt Perry
2014/11/18 18:09:17
Ah, yes. OnViewDestroyed, line 53. I had implement
|
| } |
| } |