Index: sky/shell/ui/engine.cc |
diff --git a/sky/shell/ui/engine.cc b/sky/shell/ui/engine.cc |
index e8b6560e8acb863017db49d69f5643281ba4bb60..9333a41562f06f4095d91f98c42bfc94126de604 100644 |
--- a/sky/shell/ui/engine.cc |
+++ b/sky/shell/ui/engine.cc |
@@ -119,13 +119,21 @@ void Engine::OnInputEvent(InputEventPtr event) { |
} |
void Engine::LoadURL(const mojo::String& url) { |
- web_view_ = blink::WebView::create(this); |
+ // Something bad happens if you try to call WebView::close and replace |
+ // the webview. So for now we just load into the existing one. :/ |
+ if (!web_view_) |
+ web_view_ = blink::WebView::create(this); |
ConfigureSettings(web_view_->settings()); |
web_view_->setMainFrame(blink::WebLocalFrame::create(this)); |
UpdateWebViewSize(); |
web_view_->mainFrame()->load(GURL(url)); |
} |
+void Engine::frameDetached(blink::WebFrame* frame) { |
+ // |frame| is invalid after here. |
+ frame->close(); |
+} |
+ |
void Engine::initializeLayerTreeView() { |
} |
@@ -133,5 +141,23 @@ void Engine::scheduleVisualUpdate() { |
animator_->RequestFrame(); |
} |
+blink::ServiceProvider* Engine::services() { |
+ return this; |
+} |
+ |
+mojo::NavigatorHost* Engine::NavigatorHost() { |
+ return this; |
+} |
+ |
+void Engine::RequestNavigate(mojo::Target target, |
+ mojo::URLRequestPtr request) { |
+ // Ignoring target for now. |
+ base::MessageLoop::current()->PostTask(FROM_HERE, |
+ base::Bind(&Engine::LoadURL, GetWeakPtr(), request->url)); |
+} |
+ |
+void Engine::DidNavigateLocally(const mojo::String& url) { |
+} |
+ |
} // namespace shell |
} // namespace sky |