Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: sky/engine/core/html/HTMLIFrameElement.cpp

Issue 912183002: Adds support for embedViewManagerClient() to IFrame. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 ScriptValue HTMLIFrameElement::takeServicesHandle(ScriptState* scriptState) 73 ScriptValue HTMLIFrameElement::takeServicesHandle(ScriptState* scriptState)
74 { 74 {
75 return ScriptValue(scriptState, gin::ConvertToV8(scriptState->isolate(), m_s ervices.PassMessagePipe().release())); 75 return ScriptValue(scriptState, gin::ConvertToV8(scriptState->isolate(), m_s ervices.PassMessagePipe().release()));
76 } 76 }
77 77
78 ScriptValue HTMLIFrameElement::takeExposedServicesHandle(ScriptState* scriptStat e) 78 ScriptValue HTMLIFrameElement::takeExposedServicesHandle(ScriptState* scriptStat e)
79 { 79 {
80 return ScriptValue(scriptState, gin::ConvertToV8(scriptState->isolate(), m_e xposedServices.release())); 80 return ScriptValue(scriptState, gin::ConvertToV8(scriptState->isolate(), m_e xposedServices.release()));
81 } 81 }
82 82
83 void HTMLIFrameElement::embedViewManagerClient(blink::ScriptValue client) {
84 if (!m_contentView)
85 return;
86
87 mojo::MessagePipeHandle handle;
88 if (gin::ConvertFromV8(client.isolate(), client.v8Value(), &handle))
89 m_contentView->Embed(mojo::MakeProxy<mojo::ViewManagerClient>(mojo::MakeScop edHandle(handle).Pass()));
abarth-chromium 2015/02/11 01:02:13 Is the Pass() needed here? It looks redundant.
hansmuller1 2015/02/11 01:09:00 Done.
90 }
91
83 void HTMLIFrameElement::navigateView() 92 void HTMLIFrameElement::navigateView()
84 { 93 {
85 if (!m_contentView) 94 if (!m_contentView)
86 return; 95 return;
87 96
88 String urlString = stripLeadingAndTrailingHTMLSpaces(getAttribute(HTMLNames: :srcAttr)); 97 String urlString = stripLeadingAndTrailingHTMLSpaces(getAttribute(HTMLNames: :srcAttr));
89 if (urlString.isEmpty()) 98 if (urlString.isEmpty())
90 urlString = blankURL().string(); 99 urlString = blankURL().string();
91 100
92 KURL url = document().completeURL(urlString); 101 KURL url = document().completeURL(urlString);
93 102
94 mojo::MessagePipe exposedServicesPipe; 103 mojo::MessagePipe exposedServicesPipe;
95 m_exposedServices = exposedServicesPipe.handle0.Pass(); 104 m_exposedServices = exposedServicesPipe.handle0.Pass();
96 105
97 m_contentView->Embed(mojo::String::From(url.string().utf8().data()), 106 m_contentView->Embed(mojo::String::From(url.string().utf8().data()),
98 mojo::GetProxy(&m_services), 107 mojo::GetProxy(&m_services),
99 mojo::MakeProxy<mojo::ServiceProvider>(exposedServicesPipe.handle1.Pass( ))); 108 mojo::MakeProxy<mojo::ServiceProvider>(exposedServicesPipe.handle1.Pass( )));
100 } 109 }
101 110
102 } 111 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698