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
This commit is contained in:
Eric Seidel
2015-05-22 12:59:21 -07:00
parent 12b9f613f2
commit c6cacd7e34

View File

@@ -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_)