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

Unified Diff: sky/shell/ui/engine.cc

Issue 952273003: Make WebView::close not crash and start to fix navigation in SkyShell (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fixed 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/shell/ui/engine.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « sky/shell/ui/engine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698