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

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: 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..86be709f497a7840e4f39f9c74aec781e3922383 100644
--- a/sky/shell/ui/engine.cc
+++ b/sky/shell/ui/engine.cc
@@ -119,6 +119,8 @@ void Engine::OnInputEvent(InputEventPtr event) {
}
void Engine::LoadURL(const mojo::String& url) {
+ if (web_view_)
+ web_view_->close();
web_view_ = blink::WebView::create(this);
ConfigureSettings(web_view_->settings());
web_view_->setMainFrame(blink::WebLocalFrame::create(this));
@@ -126,6 +128,11 @@ void Engine::LoadURL(const mojo::String& url) {
web_view_->mainFrame()->load(GURL(url));
}
+void Engine::frameDetached(blink::WebFrame* frame) {
+ // |frame| is invalid after here.
+ frame->close();
+}
+
void Engine::initializeLayerTreeView() {
}
@@ -133,5 +140,22 @@ 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.
+ LoadURL(request->url);
abarth-chromium 2015/02/25 23:21:32 We should do this asynchronously.
+}
+
+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