| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 { | 63 { |
| 64 return new RenderIFrame(this); | 64 return new RenderIFrame(this); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void HTMLIFrameElement::OnViewDestroyed(mojo::View* view) | 67 void HTMLIFrameElement::OnViewDestroyed(mojo::View* view) |
| 68 { | 68 { |
| 69 DCHECK_EQ(view, m_contentView); | 69 DCHECK_EQ(view, m_contentView); |
| 70 m_contentView = nullptr; | 70 m_contentView = nullptr; |
| 71 } | 71 } |
| 72 | 72 |
| 73 ScriptValue HTMLIFrameElement::takeServicesHandle(ScriptState* scriptState) | 73 PassRefPtr<DartValue> HTMLIFrameElement::takeServicesHandle(DartState*) |
| 74 { | 74 { |
| 75 return ScriptValue(scriptState, gin::ConvertToV8(scriptState->isolate(), m_s
ervices.PassMessagePipe().release())); | 75 return DartValue::Create(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 ScriptValue HTMLIFrameElement::takeExposedServicesHandle(ScriptState* scriptStat
e) | 78 PassRefPtr<DartValue> HTMLIFrameElement::takeExposedServicesHandle(DartState*) |
| 79 { | 79 { |
| 80 return ScriptValue(scriptState, gin::ConvertToV8(scriptState->isolate(), m_e
xposedServices.release())); | 80 return DartValue::Create(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void HTMLIFrameElement::embedViewManagerClient(const ScriptValue& client) { | 83 void HTMLIFrameElement::embedViewManagerClient(DartValue* client) { |
| 84 if (!m_contentView) | 84 if (!m_contentView) |
| 85 return; | 85 return; |
| 86 | 86 |
| 87 mojo::MessagePipeHandle handle; | 87 // TODO(dart) |
| 88 if (gin::ConvertFromV8(client.isolate(), client.v8Value(), &handle)) | 88 // mojo::MessagePipeHandle handle; |
| 89 m_contentView->Embed(mojo::MakeProxy<mojo::ViewManagerClient>(mojo::MakeScop
edHandle(handle))); | 89 // if (gin::ConvertFromV8(client.isolate(), client.v8Value(), &handle)) |
| 90 // m_contentView->Embed(mojo::MakeProxy<mojo::ViewManagerClient>(mojo::MakeS
copedHandle(handle))); |
| 90 } | 91 } |
| 91 | 92 |
| 92 void HTMLIFrameElement::navigateView() | 93 void HTMLIFrameElement::navigateView() |
| 93 { | 94 { |
| 94 if (!m_contentView) | 95 if (!m_contentView) |
| 95 return; | 96 return; |
| 96 | 97 |
| 97 String urlString = stripLeadingAndTrailingHTMLSpaces(getAttribute(HTMLNames:
:srcAttr)); | 98 String urlString = stripLeadingAndTrailingHTMLSpaces(getAttribute(HTMLNames:
:srcAttr)); |
| 98 if (urlString.isEmpty()) | 99 if (urlString.isEmpty()) |
| 99 urlString = blankURL().string(); | 100 urlString = blankURL().string(); |
| 100 | 101 |
| 101 KURL url = document().completeURL(urlString); | 102 KURL url = document().completeURL(urlString); |
| 102 | 103 |
| 103 mojo::MessagePipe exposedServicesPipe; | 104 mojo::MessagePipe exposedServicesPipe; |
| 104 m_exposedServices = exposedServicesPipe.handle0.Pass(); | 105 m_exposedServices = exposedServicesPipe.handle0.Pass(); |
| 105 | 106 |
| 106 m_contentView->Embed(mojo::String::From(url.string().utf8().data()), | 107 m_contentView->Embed(mojo::String::From(url.string().utf8().data()), |
| 107 mojo::GetProxy(&m_services), | 108 mojo::GetProxy(&m_services), |
| 108 mojo::MakeProxy<mojo::ServiceProvider>(exposedServicesPipe.handle1.Pass(
))); | 109 mojo::MakeProxy<mojo::ServiceProvider>(exposedServicesPipe.handle1.Pass(
))); |
| 109 } | 110 } |
| 110 | 111 |
| 111 } | 112 } |
| OLD | NEW |