119 Commits

Author SHA1 Message Date
Hixie
fd4e2c76d2 sky-element stocks demo: add splashes and highlights to menu items
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/961873004
2015-03-04 09:25:31 -08:00
Adam Barth
79aa3684b5 Attempt to fix the build
This CL attempts to fix clean builds by adding a missing dependency from
service_registry to service_provider.

Also, I've attempted to fix the sky tests by updating the reference to
service_registry.mojom.dart.

TBR=hansmuller@chromium.org

Review URL: https://codereview.chromium.org/968553002
2015-02-27 20:13:41 -08:00
Eric Seidel
c8912dd14c Add support for scroll and fling gestures to SkyShell.
This is not complete gesture support by far, but it's a start.
MojoShell and Chrome use a C++ GestureDetector, this code attempts
to use the Android (Java) GestureDetector instead.

We probably should not be sending gesturetap until we've decided
it's not a scroll, etc, but this implementation does not go that far.

I had to fix a bug whereby we were assuming the InputEvent.time_stamp
was in TimeDelta's internal format, which was wrong.  When we get
time_stamp from Android its in ms since boot.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/969493002
2015-02-27 16:46:19 -08:00
Adam Barth
29e3ba99e9 Make shake-to-reload actually work
We need to create a new service provider when we navigate to a new page
otherwise the new page is sad that the old page took its service provider.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/962383003
2015-02-27 16:38:40 -08:00
Adam Barth
b3b8d8cf1a Implement shake-to-reload
Apps can import this library if they wish to reload on shake.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/963303004
2015-02-27 15:31:11 -08:00
Adam Barth
e8b988e226 Expose Android sensors to via Mojo services
This CL adds a sensor_service to sky/services and wires it into SkyShell
The plan is to eventually use this data to implement shake-to-refresh.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/962043002
2015-02-27 14:37:50 -08:00
Hans Muller
d679a524b5 Added ServiceRegistry interface
ServiceRegistry enables a chain of Mojo applications to accumulate
services without wrapping and forwarding the incoming ServiceProvider
request.

Sky's DocumentView adds ViewManagerClient to the ServiceRegistry (if any)
that's provided to it via ConnectToApplication(). Sky applications can add
additional services with embedder.serviceRegistry.addServices().

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/958673002
2015-02-27 07:41:56 -08:00
Zachary Anderson
7da01c7c5e Dart: Removes name conflicts from generated bindings.
This change causes the generated abstract class having the same name as the interface to contain only the interface's method declarations. The generated Proxy class then implements the base class. In addition to implementing the interface methods, the generated Proxy class has one private field _proxyImpl, which is a MojoEventStreamListener and manages sending messages and receiving responses. Operations on the ProxyImpl (close, bind, etc.) are exposed through generated utility functions.

The generated Stub is largely as before with the difference that a class providing a service will implement the mojo interface and *have* a Stub rather than be a Stub. Where appropriate, this change also calls listen() immediately where a Stub is constructed.

BUG=
R=hansmuller@google.com, sky@chromium.org

Review URL: https://codereview.chromium.org/959993002
2015-02-26 15:16:14 -08:00
Zachary Anderson
b3b197fcf8 Dart: Renames dart:mojo_blah -> mojo:blah
This improves consistency with the convention that the dart: scheme is
only for things from the Dart standard library.

BUG=
R=erg@chromium.org

Review URL: https://codereview.chromium.org/951783004
2015-02-25 14:29:41 -08:00
Eric Seidel
ab273a8433 Make splash animations abort on scroll.
I also fixed the transform hack in material-element to clean
up after itself.

I also discovered that our namedSetter implementation did not
handle null (it crashed) while doing this.  I fixed that
and tested my fix.

This runs great on a Nexus 5, but poorly on an Nexus 10.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/956753002
2015-02-24 17:20:18 -08:00
Adam Barth
c149c2802d Implement quantum ink splashes
These aren't 100% correct, but they look somewhat reasonable.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/954023002
2015-02-24 15:41:52 -08:00
Adam Barth
d8b20c7f2b Make the stock app demo list view prettier
This CL makes the list view in the stocks app more consistent with the material
spec by using a colored circle instead of color-coding the percentage change.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/932103004
2015-02-24 15:41:35 -08:00
Eric Seidel
4b1def112b Add ViewConfiguration and make our scrollbar size match Android
Turns out scrollbars are very inconsistent throughout Android apps.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/955653005
2015-02-24 14:23:54 -08:00
Adam Barth
f58bd3e40d Add a shadow to the sky-drawer
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/950353003
2015-02-24 11:33:26 -08:00
Adam Barth
f21b435d05 Make the stocks drawer look more realistic
The menu items don't quite make sense for this app, but they're closer in
visual styling.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/951413002
2015-02-24 10:48:23 -08:00
Adam Barth
17569631d9 Factor sky-toolbar into a componet and use a proper material shadow
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/953903004
2015-02-24 10:47:01 -08:00
Hans Muller
36e4b84dc0 Make Sky embedder.connection deal with null handles
Also: gratuitous simplication of ApplicationConnection.requestService().

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/954653002
2015-02-24 07:27:11 -08:00
Adam Barth
26460f8130 Update Sky widgets to have more material design
This CL updates the Sky widgets to be closer to the material design spec.
There's still a long way to go, but this CL is a start.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/951823002
2015-02-23 23:59:57 -08:00
Adam Barth
9ca8293ed4 Add <sky-icon> to access material design widgets
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/947383002
2015-02-23 17:26:19 -08:00
Scott Violet
15d7cd9b47 Gets HTMLIFrameElement::embedViewManagerClient to work with dart
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/948943002
2015-02-23 15:29:22 -08:00
Adam Barth
7c498977dc Remove outdated examples and framework pieces
None of this code runs in the current Sky. Some of it never ran.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/951673003
2015-02-23 15:09:36 -08:00
Adam Barth
bc9b3e319e Fix subtle bugs in sky-scrollable
Previously the scrollbar wasn't constrained to the scrollable element and we
had messed up the math on the fling curve.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/947303003
2015-02-23 14:20:52 -08:00
Adam Barth
798b67fe0c Fix typos in sky-drawer and sky-scrollable
Now that I can test these with a touch device, I found a few runtime errors
that are fixed in this CL.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/948073002
2015-02-23 10:12:34 -08:00
Adam Barth
e2c18721ff Port sky-drawer to Dart
Also, port the "appish" example to exercise the drawer.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/942413002
2015-02-23 08:30:58 -08:00
Adam Barth
b6f511c6a9 Port Sky widgets demo to Dart
This CL updates sky-box, sky-button, sky-checkbox, sky-input, and sky-radio to
work in Dart. We don't have a data binding system yet, so there's a bit more
plumbing in the code.

This CL adds support for sky-element@attributes, which lets you specify which
attributes your element supports. We use this information to synthesize getters
and setters for those attributes and to dispatch to mumbleChanged methods when
the attributes change.

I've also wrapped the widgets demo itself in a sky-scrollable so the whole
thing scrolls.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/946813005
2015-02-23 08:30:36 -08:00
Hans Muller
2cbb091137 Added an ApplicationConnection for the OnEmbed() SPs to Sky embedder
I also made the singleton embedder's fields static, so that they're lazily computed.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/945143003
2015-02-23 07:28:42 -08:00
Adam Barth
fe31fd0e4c Port sky-scrollable to Dart
This CL ports sky-scrollable to the new sky-element.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/950603002
2015-02-21 09:56:22 -08:00
Adam Barth
085b988e6a Make it possible for sky-element to register any tag name
... instead of hard-coding "example".

We do this by adding a custom constructor for Element that gets the |tagName|
property off the instance.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/943153002
2015-02-21 08:02:32 -08:00
Adam Barth
16db84fde1 Add a basic sky-element custom element
After this CL, you can use <sky-element> to describe custom elements. The
current iteration is very basic and is hardcoded to "example", but its a start.

This CL renames the |init| function to |_init| to prevent importers from
calling it directly. Also, we now pass the <script> element to |_init| to give
some context.

R=ojan@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/950493003
2015-02-20 21:45:36 -08:00
Hans Muller
3663c45619 Added Sky Mojo embedder singleton, restored network test
Currently the embedder is just an encapsulation of the Mojo shell. Exposing an ApplicationConnection that encapsulates the ViewManager Embed SPs is next.

R=abarth@chromium.org, zra@google.com

Review URL: https://codereview.chromium.org/948463003
2015-02-20 15:07:29 -08:00
Adam Barth
ec0a8e615c Sky should expose services provided to/by embedder
These now appear on internals as takeServicesProvidedToEmbedder and
takeServicesProvidedByEmbedder. When you call these functions, you get back the
raw int that represents the handle. We'll need to wrap them up inside the Dart
VM with the appropriate types. We can create a nice wrapper for that in a
future CL.

R=hansmuller@google.com, hansmuller@chromium.org

Review URL: https://codereview.chromium.org/944733002
2015-02-19 21:16:04 -08:00
Hans Muller
63dd3c3f5a Dart Bindings: ApplicationConnection
Replaced the Dart ServiceProvider class with a version
of ApplicationConnection that can both provide services
and connect to (request) them. ApplicationConnection
objects are returned by the Application ConnectToApplication()
method and they're passed to the Application AcceptConnection()
method.

R=zra@google.com

Review URL: https://codereview.chromium.org/934253003
2015-02-18 14:17:54 -08:00
Adam Barth
d1d6e4436d Make sky/tests/services/event-sender.sky pass
This CL ports sky/framework/shell.sky to Dart and makes event-sender.sky. I've
also removed a number of not-that-interesting tests for the JS Mojo bindings.

R=eseidel@chromium.org, rafaelw@chromium.org

Review URL: https://codereview.chromium.org/922123002
2015-02-13 13:52:08 -08:00
Adam Barth
f2d2e80e59 Merge the Sky Engine changes from the SkyDart branch
This CL flips the switch to make Sky use Dart.

TBR=eseidel@chromium.org
BUG=454613

Review URL: https://codereview.chromium.org/922893002
2015-02-12 15:06:03 -08:00
Scott Violet
089066f249 Adds src to the list of attributes known for iframes
This way I stop getting warnings about an unknown attribute.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/899133002
2015-02-04 15:38:59 -08:00
Adam Barth
60ede21534 Add fling support to sky-drawer
For some reason, the fling looks correct when we don't divide by the device
pixel ratio when converting from mojo::Event to blink::WebInputEvent. Maybe the
gesture detector is confused somehow about physical / logical pixels?

R=eseidel@chromium.org, esprehn@chromium.org

Review URL: https://codereview.chromium.org/885213002
2015-01-29 22:07:13 -08:00
Adam Barth
36e9c3e46e Implement PointerEvent#dx
In this CL, the event handler keeps track of the delta from the previous
pointer position so authors don't have to.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/887793002
2015-01-29 13:23:45 -08:00
Adam Barth
16c4b41391 This CL adds an "appish" example to the Sky examples, including a drawer widget.
R=eseidel@chromium.org, esprehn@chromium.org

Review URL: https://codereview.chromium.org/886723002
2015-01-29 11:21:39 -08:00
Hans Muller
acdacb9214 Upgrade Sky's use of the JS bindings
BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/875713003
2015-01-28 11:27:33 -08:00
Adam Barth
63b6ffb281 Normalize import paths for Sky modules
This CL simplifies the sky_server to only map the build directory into /gen,
which will make the deploy script simpler. This CL updates all the imports to
use the /gen prefix when referring to generated files.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/881093003
2015-01-27 17:04:40 -08:00
Adam Barth
a251a157a7 The scrollbar in sky-scrollable should fade in and out
Also, move the vbar after the scrollable div so that it draws on top.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/879003002
2015-01-27 11:11:49 -08:00
Adam Barth
c3fc9e9663 Add wheel support to sky-scrollable
This CL plumbs wheel events through Sky again and uses them in sky-scrollable.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/876853005
2015-01-27 09:58:22 -08:00
Adam Barth
73d3d84b27 Add a scrollbar to sky-scrollable
Ideally the scrollbar would animate out when you stop scrolling, but we're not
quite that good yet.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/882583002
2015-01-26 21:37:25 -08:00
James Robinson
dddf8f294f Remove Client relationship between mojo.Shell/mojo.Application
Instead of mojo.Shell and mojo.Application being clients of each other
they are now separate interfaces. An implementation of mojo.Application
receives a handle to the shell in its Initialize call, as described in
this doc:

https://docs.google.com/document/d/1xjt_TPjTu0elix8fNdBgWmnjJdJAtqSr1XDS_C-Ct8E/edit?usp=sharing

An analogous change is made to the content handler definition.

In C++, this is handled by the mojo::ApplicationImpl class which stores
shell handle in its implementation of Initialize. Thus the only change
for most C++ applications is the meaning of the handle in MojoMain is
different, although mains that use the ApplicationRunners do the same
thing with it.  Connecting to other apps is largely the same although
instead of grabbing the ApplicationImpl's client() to talk to the shell
code must now use the ApplicationImpl::shell() getter.

In JavaScript, the initialization sequence is a bit different although
this is hidden mostly in the Application class which calls initialize()
on its subclass with the same set of parameters. Connecting to another
application looks different, especially for sky code using the shell
proxy handle exposed via internals. Hans has some ideas about how to
make this a bit nicer.

Python apps similarly need to change their startup sequence a bit. I
didn't find a common library to take care of this dance, although it's
possible I just missed it.

Other languages probably a bit of reworking - I fixed everything here
that is covered by mojob.py test but some might be missing.

This patch also uses typed handles (i.e. InterfacePtr<> or
InterfaceRequest<> or their type aliases) wherever possible instead of
ScopedMessagePipeHandle for clarity.

R=davemoore@chromium.org

Review URL: https://codereview.chromium.org/868463008
2015-01-26 17:53:08 -08:00
Adam Barth
d05380e397 sky-scrollable should use a reasonable fling curve
This CL uses the aura fling curve to ease flings. Also, I've made Event#timeStamp
use consistent units and timebase with the requestAnimationFrame timestamp. Now
both are doubles of milliseconds since the epoch.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/880473003
2015-01-26 17:34:28 -08:00
Adam Barth
7ded81cc4f Add a basic sky-scrollable element that scrolls
We still need to polish sky-scrollable, but it basically works.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/875953004
2015-01-26 13:29:38 -08:00
Adam Barth
c51ca09e15 Move sky-box,-button,-checkbox,-radio out of their directories
Instead of having a separate directory for every Sky element, we should just
put them in the general framework directory. Once the framework is more
complicated, we'll probably want to organize it a bit better, but for now there
aren't enough files to justify having so many directories.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/874303003
2015-01-26 09:20:25 -08:00
Adam Barth
3ddae5ea36 Switch KeyboardEvents over to NewEventHandler
This CL moves KeyboardEvents from the old event model to NewEventHandler. This
CL keeps the basic structure of keydown, keypress, keyup events even though
that's a bit wacky. As with pointer and gesture events, this CL removes
PlatformKeyboardEvent in favor of just using WebKeyboardEvent. I've also made
WebKeyboardEvent align more closely with Mojo's keyboard event.

The CL does change one important aspect of key event handling: on the web the
"keyCode" property of KeyboardEvent changes its meaning depending on whether
the event is a keydown or a keypress event. For the former events, keyCode is
the "virtual" (i.e., windows) key code where for the latter events, keyCode is
the character code. To be more precise, I've renamed keyCode to virtualKeyCode
and I've given it a zero (unknown key code) value during keypress events.

R=ojan@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/872233002
2015-01-25 22:46:50 -08:00
Elliott Sprehn
0275d42ac7 Add the <t> element and ignore whitespace outside it.
We now only preserve the whitespace inside a <t> element inside
the parser. This removes the known n^2 from reattaching whitespace
which should make parsing and appending nodes faster. I also
removed the dead WhitespaceMode code from the parser, and made
the dom-seralizer.sky auto indent the markup so the test output
would be readable.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/867963006
2015-01-23 16:50:00 -08:00
Adam Barth
b361c4b6c3 Switch Sky to pointer events
This CL switches Sky to a pointer events model that unifies mouse and touch
with a common event model. This implementation is just enough to make the
example widgets work. The rest of the design is in the specs, which we hope to
converge with over time.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/866213004
2015-01-23 09:38:45 -08:00