| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "sky/engine/config.h" | 5 #include "sky/engine/config.h" |
| 6 #include "sky/engine/core/html/HTMLIFrameElement.h" | 6 #include "sky/engine/core/html/HTMLIFrameElement.h" |
| 7 | 7 |
| 8 #include "gen/sky/core/HTMLNames.h" | 8 #include "gen/sky/core/HTMLNames.h" |
| 9 #include "mojo/edk/js/handle.h" | 9 #include "mojo/edk/js/handle.h" |
| 10 #include "sky/engine/core/frame/LocalFrame.h" | 10 #include "sky/engine/core/frame/LocalFrame.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 HTMLIFrameElement::~HTMLIFrameElement() | 28 HTMLIFrameElement::~HTMLIFrameElement() |
| 29 { | 29 { |
| 30 if (m_contentView) | 30 if (m_contentView) |
| 31 m_contentView->RemoveObserver(this); | 31 m_contentView->RemoveObserver(this); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void HTMLIFrameElement::insertedInto(ContainerNode* insertionPoint) | 34 void HTMLIFrameElement::insertedInto(ContainerNode* insertionPoint) |
| 35 { | 35 { |
| 36 HTMLElement::insertedInto(insertionPoint); | 36 HTMLElement::insertedInto(insertionPoint); |
| 37 if (insertionPoint->inDocument()) { | 37 if (insertionPoint->inDocument()) { |
| 38 if (LocalFrame* frame = document().frame()) | 38 if (LocalFrame* frame = document().frame()) { |
| 39 m_contentView = frame->loaderClient()->createChildFrame(); | 39 m_contentView = frame->loaderClient()->createChildFrame(); |
| 40 m_contentView->AddObserver(this); |
| 41 } |
| 40 navigateView(); | 42 navigateView(); |
| 41 } | 43 } |
| 42 } | 44 } |
| 43 | 45 |
| 44 void HTMLIFrameElement::removedFrom(ContainerNode* insertionPoint) | 46 void HTMLIFrameElement::removedFrom(ContainerNode* insertionPoint) |
| 45 { | 47 { |
| 46 HTMLElement::removedFrom(insertionPoint); | 48 HTMLElement::removedFrom(insertionPoint); |
| 47 if (m_contentView) | 49 if (m_contentView) |
| 48 m_contentView->Destroy(); | 50 m_contentView->Destroy(); |
| 49 } | 51 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 urlString = blankURL().string(); | 90 urlString = blankURL().string(); |
| 89 | 91 |
| 90 KURL url = document().completeURL(urlString); | 92 KURL url = document().completeURL(urlString); |
| 91 | 93 |
| 92 mojo::MessagePipe exposedServicesPipe; | 94 mojo::MessagePipe exposedServicesPipe; |
| 93 m_exposedServices = exposedServicesPipe.handle0.Pass(); | 95 m_exposedServices = exposedServicesPipe.handle0.Pass(); |
| 94 | 96 |
| 95 m_contentView->Embed(mojo::String::From(url.string().utf8().data()), | 97 m_contentView->Embed(mojo::String::From(url.string().utf8().data()), |
| 96 mojo::GetProxy(&m_services), | 98 mojo::GetProxy(&m_services), |
| 97 mojo::MakeProxy<mojo::ServiceProvider>(exposedServicesPipe.handle1.Pass(
))); | 99 mojo::MakeProxy<mojo::ServiceProvider>(exposedServicesPipe.handle1.Pass(
))); |
| 98 m_contentView->AddObserver(this); | |
| 99 } | 100 } |
| 100 | 101 |
| 101 } | 102 } |
| OLD | NEW |