From d79cb9d7348f7e2dcc29d07eb87483b26d27355d Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Thu, 23 Oct 2014 14:56:44 -0700 Subject: [PATCH] Make skydb load examples/home.sky by default. I had to also register for the text/plain mime-type which turned out to be harder than expected. Mostly due to my confusion with mojo_shell using last-argument-wins argument parsing. R=ianh@google.com Review URL: https://codereview.chromium.org/672363002 --- engine/src/flutter/examples/home.sky | 2 ++ engine/src/flutter/tools/debugger/prompt/prompt.cc | 8 ++++++-- engine/src/flutter/tools/skydb | 9 ++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/examples/home.sky b/engine/src/flutter/examples/home.sky index 3a447fd3db..5cfbaecab4 100644 --- a/engine/src/flutter/examples/home.sky +++ b/engine/src/flutter/examples/home.sky @@ -1,7 +1,9 @@ #!mojo mojo:sky +

about:blank

Welcome to Sky!

+
diff --git a/engine/src/flutter/tools/debugger/prompt/prompt.cc b/engine/src/flutter/tools/debugger/prompt/prompt.cc index 3b486045e6..d411c82618 100644 --- a/engine/src/flutter/tools/debugger/prompt/prompt.cc +++ b/engine/src/flutter/tools/debugger/prompt/prompt.cc @@ -45,13 +45,17 @@ class Prompt : public mojo::ApplicationDelegate { app->ConnectToService("mojo:sky_viewer", &tracing_); if (app->args().size() > 1) url_ = app->args()[1]; + else { + url_ = "https://raw.githubusercontent.com/domokit/mojo/master/sky/" + "examples/home.sky"; + } } virtual bool ConfigureIncomingConnection( mojo::ApplicationConnection* connection) override { connection->ConnectToService(&debugger_); - if (!url_.empty()) - Reload(); + std::cout << "Loading " << url_ << std::endl; + Reload(); ScheduleWaitForInput(); return true; } diff --git a/engine/src/flutter/tools/skydb b/engine/src/flutter/tools/skydb index 406e482609..caa8f8093f 100755 --- a/engine/src/flutter/tools/skydb +++ b/engine/src/flutter/tools/skydb @@ -13,11 +13,18 @@ CONFIG_DIRECTORY = 'Debug' MOJO_SHELL_PATH = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir, os.pardir, BUILD_DIRECTORY, CONFIG_DIRECTORY, 'mojo_shell')) +SUPPORTED_MIME_TYPES = [ + 'text/html', + 'text/plain', +] + def main(args): + content_handlers = ['%s,%s' % (mime_type, 'mojo://sky_viewer/') + for mime_type in SUPPORTED_MIME_TYPES] shell_command = [ MOJO_SHELL_PATH, '--v=1', - '--content-handlers=text/html,mojo://sky_viewer/', + '--content-handlers=%s' % ','.join(content_handlers), '--url-mappings=mojo:window_manager=mojo:sky_debugger', 'mojo:window_manager', ]