From c6cacd7e34fa10a7fbe2845a38e3e302afdb1187 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Fri, 22 May 2015 12:59:21 -0700 Subject: [PATCH] Make SkyView vs. WebView controlable via url path We're currently in a transition between using main.sky and main.dart files as our main() entry point for Sky applications. This CL makes this runtime controlable by path name. If it finds a .dart in the path name it will use SkyView, otherwise it will fall back to the existing WebView codepath. SkyView does not expose a window object and much of the existing Sky Engine is not initialized when main() is run. Clients should be transitioning away from main.sky towards main.dart in the near future, however main.dart is probably not ready for general consumption at this point. R=ianh@google.com Review URL: https://codereview.chromium.org/1152313002 --- engine/src/flutter/shell/ui/engine.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/shell/ui/engine.cc b/engine/src/flutter/shell/ui/engine.cc index b16d44e673..e3df08d99b 100644 --- a/engine/src/flutter/shell/ui/engine.cc +++ b/engine/src/flutter/shell/ui/engine.cc @@ -171,13 +171,14 @@ void Engine::OnInputEvent(InputEventPtr event) { } void Engine::LoadURL(const mojo::String& url) { - // Enable SkyView here. - if (false) { + if (!WebView::shouldUseWebView(responseURL)) { sky_view_ = blink::SkyView::Create(this); sky_view_->Load(GURL(url)); return; } + LOG(WARNING) << ".sky support is deprecated, please use .dart for main()"; + // 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_)