Hi Lionel,<br><br>we are more or less understanding each other :) I think there are really three possible steps<br><br>1 A WebView with an html5/javascript based sugar-toolkit<br>2 Support for web activities along with native ones, inside a native shell<br>
3 Fully html5 sugar<br><br>My feeling is that we should target step 2 directly, because 1 -> 2 will waste too much work. The datastore and collaboration implementation is going to be pretty different, depending if we use Chromium or Webkit embedding. Consider also that a better way to communicate then "console-message" is not going to come for free.<br>
<br>I also think doing 2 directly doesn't add much bootstrapping work. It's going to be a *lot* more complicated to implement the html UI stuff than to implement the bits of bridging I described. <br>The only real advantage I see with doing step 1 first is that it would give us more time to migrate Browse to the same backend. Admittedly having to ship both Chromium and Webkit would be pretty bad.<br>
<br>I don't want to be stuck in our own html based framework. I explained in
 my first email why I think we should jump on one of the existing webapp
 frameworks train.<br>
<br>Anyway I'm satisfied that we know what are the alternatives now. And we have a pretty decent idea of what they involve. I think when Simon is back we should meet and decide which direction to take. It also somewhat depends on who is interested to help out with this and what they would like to work on.<br>
<br>In the meantime people can start hacking on the UI stuff :)<br><br><div class="gmail_quote">On 12 April 2013 22:36,  <span dir="ltr"><<a href="mailto:lionel@olpc-france.org" target="_blank">lionel@olpc-france.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="#0563C1" vlink="#954F72" lang="FR"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi Daniel,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">Impressive idea with a cool architecture. BTW, to be honest I think it’s… too complex.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">Why not just create a standard Python activity template that call the WebKit WebView? Like we do today.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">But maybe I miss something or maybe we don’t speak of the same thing?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">When I wrote the GSoC proposal, I think to a two steps process.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">What I call the “first step” is just to create an activity template with a full screen WebView control and a Sugar to JavaScript.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">So it’s like my work on Enyo today but:<u></u><u></u></span></p><p><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><span>-<span style="font:7.0pt "Times New Roman"">          </span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">With a better way than “console-message” to communicate between JavaScript & Sugar,<u></u><u></u></span></p>
<p><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><span>-<span style="font:7.0pt "Times New Roman"">          </span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">With a JavaScript/CSS framework to reproduce in HTML5 the Sugar Look&Feel and sugar.graphics stuff,<u></u><u></u></span></p>
<p><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><span>-<span style="font:7.0pt "Times New Roman"">          </span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">With a JavaScript framework that allow calling all Sugar features (telepathy, data store, l10n, drag&drop, …).<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">We could probably do all these things without lot of change on current Sugar implementation and current Sugar activity way of working. In my mind, this could work even on Sugar 0.96-0.98 without any change!<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">Except if I’m wrong, what you’re currently describe is the “second step”: upgrading Sugar to support directly HTML5 activities.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">In this second step we could imagine that Sugar will be very different than today (may be an Android layer or a Chromium layer) and that no current Python activities will work on it. BTW HTML5 activities built with the “first step framework” should be very easy to adapt: just need to change the JavaScript framework implementation to use natives features instead of Sugar Python features (for example: call HTML5 storage instead of Datastore storage) and remove the XO Manifest/Package. I do like your architecture proposal for this second step but it’s difficult to me to think to this second step without we’ve got a more precise view of the first step.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">                Lionel.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">De :</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> Daniel Narvaez [mailto:<a href="mailto:dwnarvaez@gmail.com" target="_blank">dwnarvaez@gmail.com</a>] <br>
<b>Envoyé :</b> jeudi 11 avril 2013 21:52<br><b>À :</b> <a href="mailto:sugar-devel@lists.sugarlabs.org" target="_blank">sugar-devel@lists.sugarlabs.org</a><br><b>Cc :</b> Lionel Laské<br><b>Objet :</b> Chromium integration inside the sugar shell (was Re: Kicking off HTML5 activities work)<u></u><u></u></span></p>
<div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Hello,<br><br>I spent some time today thinking and experimenting with Chromium integration and I have a more detailed plan to propose now.<br>
<br>There is an important premise to be made. In both Chromium and Firefox OS, application's installation is very much in the hands of the web browser. It happens as the result of a user clicking on a button, inside a web store. Chromium is a bit more flexible but the other possibilities are basically just developer tools.<br>
I think this limits our possibilities a lot. We need to use the browser applications management, rather then installing applications ourselves and then launching them with some command line option. Of course Chromium is open source and we could develop the stuff which is missing. But, in my opinion it's just too much work and it's going to be a pain to maintain in the future, core developers are not going to care about it, given it's not important for their products.<br>
<br>That said, I think I mostly figured out a plan to integrate with Chromium web apps management, without having to write a lot of code.<br><br>* Chromium is started up with the sugar session, using the --no-startup-window, to make it invisible. The sugar extension has a "background" permission, which will keep it running even with no windows.<br>
* The extension runs a python script, using chrome.runtime.connectNative. Communication uses json-rpc wrapped in the message protocol supported by the extension. The python script fetches the list of installed activities (as exposed by chrome.management.getAll) and listen to changes.<br>
* The python script exposes a dbus service, allowing the sugar shell to get the list of installed applications and to display icons for them in the home. We use GIOChannel to read stdin, so that we don't block and integrate with the glib mainloop.<br>
* When the user click on an icon, a LaunchApplication is called on the dbus service, which proxies it to the extension, which launches the application. We will probably need a trivial patch to chromium to start it without UI. There is already a define for chromeos, but it's a compile time thing (in extension_prefs.cc, GetLaunchContainer).<br>
* The shell notices that a new window has been opened and associates it with the application information. This allows to activate and close the activity as necessary.<br>* Uninstalling an activity works in the same way as launching. Shell -> python script -> extension.<br>
* Implementation of collaboration and datastore libraries could also be based on the python script messaging.<br><br>I implemented (badly) a good part of this and I didn't find fundamental problems with it. Except for one, which is not specific to this plan. Sugar supports multiple instances of the same activity, web application frameworks doesn't. How are we going to deal with that? I haven't thought much about it yet, but it seems something we want to be very clear about.<u></u><u></u></p>
</div></div></div></div></blockquote></div><br><br clear="all"><br>-- <br>Daniel Narvaez<br>