| 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 "sky/engine/core/frame/LocalFrame.h" | 9 #include "sky/engine/core/frame/LocalFrame.h" |
| 10 #include "sky/engine/core/html/parser/HTMLParserIdioms.h" | 10 #include "sky/engine/core/html/parser/HTMLParserIdioms.h" |
| 11 #include "sky/engine/core/loader/FrameLoaderClient.h" | 11 #include "sky/engine/core/loader/FrameLoaderClient.h" |
| 12 #include "sky/engine/core/rendering/RenderIFrame.h" | 12 #include "sky/engine/core/rendering/RenderIFrame.h" |
| 13 #include "sky/engine/tonic/mojo_converter.h" |
| 13 | 14 |
| 14 namespace blink { | 15 namespace blink { |
| 15 | 16 |
| 16 PassRefPtr<HTMLIFrameElement> HTMLIFrameElement::create(Document& document) | 17 PassRefPtr<HTMLIFrameElement> HTMLIFrameElement::create(Document& document) |
| 17 { | 18 { |
| 18 return adoptRef(new HTMLIFrameElement(document)); | 19 return adoptRef(new HTMLIFrameElement(document)); |
| 19 } | 20 } |
| 20 | 21 |
| 21 HTMLIFrameElement::HTMLIFrameElement(Document& document) | 22 HTMLIFrameElement::HTMLIFrameElement(Document& document) |
| 22 : HTMLElement(HTMLNames::iframeTag, document), | 23 : HTMLElement(HTMLNames::iframeTag, document), |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 PassRefPtr<DartValue> HTMLIFrameElement::takeServicesHandle(DartState*) | 73 PassRefPtr<DartValue> HTMLIFrameElement::takeServicesHandle(DartState*) |
| 73 { | 74 { |
| 74 return DartValue::Create(); | 75 return DartValue::Create(); |
| 75 } | 76 } |
| 76 | 77 |
| 77 PassRefPtr<DartValue> HTMLIFrameElement::takeExposedServicesHandle(DartState*) | 78 PassRefPtr<DartValue> HTMLIFrameElement::takeExposedServicesHandle(DartState*) |
| 78 { | 79 { |
| 79 return DartValue::Create(); | 80 return DartValue::Create(); |
| 80 } | 81 } |
| 81 | 82 |
| 82 void HTMLIFrameElement::embedViewManagerClient(DartValue* client) { | 83 void HTMLIFrameElement::embedViewManagerClient(RefPtr<DartValue> client) |
| 84 { |
| 83 if (!m_contentView) | 85 if (!m_contentView) |
| 84 return; | 86 return; |
| 85 | 87 |
| 86 // TODO(dart) | 88 m_contentView->Embed(mojo::MakeProxy<mojo::ViewManagerClient>( |
| 87 // mojo::MessagePipeHandle handle; | 89 DartConverter<mojo::ScopedMessagePipeHandle>::FromDart(client->dart_value(
)))); |
| 88 // if (gin::ConvertFromV8(client.isolate(), client.v8Value(), &handle)) | |
| 89 // m_contentView->Embed(mojo::MakeProxy<mojo::ViewManagerClient>(mojo::MakeS
copedHandle(handle))); | |
| 90 } | 90 } |
| 91 | 91 |
| 92 void HTMLIFrameElement::navigateView() | 92 void HTMLIFrameElement::navigateView() |
| 93 { | 93 { |
| 94 if (!m_contentView) | 94 if (!m_contentView) |
| 95 return; | 95 return; |
| 96 | 96 |
| 97 String urlString = stripLeadingAndTrailingHTMLSpaces(getAttribute(HTMLNames:
:srcAttr)); | 97 String urlString = stripLeadingAndTrailingHTMLSpaces(getAttribute(HTMLNames:
:srcAttr)); |
| 98 if (urlString.isEmpty()) | 98 if (urlString.isEmpty()) |
| 99 urlString = blankURL().string(); | 99 urlString = blankURL().string(); |
| 100 | 100 |
| 101 KURL url = document().completeURL(urlString); | 101 KURL url = document().completeURL(urlString); |
| 102 | 102 |
| 103 mojo::MessagePipe exposedServicesPipe; | 103 mojo::MessagePipe exposedServicesPipe; |
| 104 m_exposedServices = exposedServicesPipe.handle0.Pass(); | 104 m_exposedServices = exposedServicesPipe.handle0.Pass(); |
| 105 | 105 |
| 106 m_contentView->Embed(mojo::String::From(url.string().utf8().data()), | 106 m_contentView->Embed(mojo::String::From(url.string().utf8().data()), |
| 107 mojo::GetProxy(&m_services), | 107 mojo::GetProxy(&m_services), |
| 108 mojo::MakeProxy<mojo::ServiceProvider>(exposedServicesPipe.handle1.Pass(
))); | 108 mojo::MakeProxy<mojo::ServiceProvider>(exposedServicesPipe.handle1.Pass(
))); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } | 111 } |
| OLD | NEW |