161 Commits

Author SHA1 Message Date
Eric Seidel
2f3c23ed01 Fix dart:sky.internals to work in SkyView
R=ianh@google.com
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/1156203003
2015-05-26 16:01:25 -07:00
Eric Seidel
8aa3caf350 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
2015-05-22 12:59:21 -07:00
Collin Jackson
1408fcff9a Don't start the Observatory when testing Sky viewer 2015-05-21 21:03:34 -07:00
Eric Seidel
827e621238 Teach sky_viewer about the new main.dart hotness
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1147413003
2015-05-21 12:46:36 -07:00
yzshen
e3fe2a2fcc Remove some InterfacePtr<> methods which directly deal with message pipe handles.
Users should use the corresponding methods dealing with
InterfacePtrInfo<>.

BUG=None
TEST=None
R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/1118843003
2015-05-04 14:47:01 -07:00
Mitch Rudominer
8c084e1db9 Replaces |shell_handle| with |application_request| as the name of the parameter to MojoMain().
BUG=468496
R=viettrungluu@chromium.org, viettrungluu

Review URL: https://codereview.chromium.org/1058163002
2015-04-03 08:22:46 -07:00
Scott Violet
bb67d0a822 Plumbs through android supplying multipe touch points
Makes sky and conversions honor pointer values correctly.

R=abarth@chromium.org, erg@chromium.org, qsr@chromium.org

Review URL: https://codereview.chromium.org/1029753002
2015-03-24 09:13:10 -07:00
Scott Violet
e39bb038c0 Cleans up events to just the parts we're actually using
Also unifies mouse and touch into a single event type.

R=abarth@chromium.org, erg@chromium.org

Review URL: https://codereview.chromium.org/1033513003
2015-03-23 14:33:21 -07:00
Adam Barth
6a794823bc Remove pauseAnimationsForTesting
This code is unused and it hooks into the DocumentLifecycle in sketchy ways.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1020053002
2015-03-19 19:32:03 -07:00
Eric Seidel
a5ab3630e9 Remove the last bits of the Sky Inspector
Unclear what if any of this we will want in the Dart world.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/993203002
2015-03-11 10:13:25 -07:00
Dave Moore
a5904449e2 Update from https://crrev.com/319330
- New chromium clang rules require explicit external destructors so
  system/lib added for MessagePipe, DataPipe and SharedBuffer
- New chromium clang rules require override and no virtual in
  declarations, so many files updated.
- cc_strip_video patch updated.

BUG=
R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/988693005
2015-03-10 15:23:04 -07:00
Hans Muller
d821faf18c Fix build: ServiceRegisty's Mojo module changed.
TBR=sky

Review URL: https://codereview.chromium.org/981143005
2015-03-06 15:46:30 -08:00
Scott Violet
517379cf6d Makes DocumentView not assume it's getting services from the embedder
It's legal for the person embedding to supply null.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/979223003
2015-03-05 10:42:47 -08:00
Scott Violet
74fe1ddecd Fixes ViewManagerClient name in sky
It needs to be mojo::ViewManagerClient; none-the-less we should use
the value from the header so we're insulated from whatever the name
happens to be.

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

Review URL: https://codereview.chromium.org/978603002
2015-03-03 14:02:56 -08:00
Aaron Boodman
88a3004d36 Simple multi-url support for mojo apps.
This patch makes it so that querystrings are no longer considered part of a mojo application's identity.

So if you connect to http://a?foo, then http://a?bar, you'll end up talking to the same application, just two different connections.

The URL of each connection is sent to the app via a new param in AcceptConnection().

This patch also adds some app tests that exercise http app loading, which wasn't tested before.

R=qsr@chromium.org

Review URL: https://codereview.chromium.org/943053003
2015-03-02 10:05:31 -08:00
Hans Muller
49e78ed61c Moved service_registry from services to mojo/services/service_registry
It needs to be in a conventional public location to be available to consumer repos.

R=tonyg@chromium.org

Review URL: https://codereview.chromium.org/968493004
2015-02-27 16:36:41 -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
Adam Barth
e55e0605e6 Share sky::PlatformImpl bettween sky_viewer and SkyShell
This should let SkyShell load images.

R=eseidel@chromium.org
BUG=https://github.com/domokit/mojo/issues/52

Review URL: https://codereview.chromium.org/959773005
2015-02-25 14:26:53 -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
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
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
James Robinson
174ea9f08e Remove last uses of InterfaceImpl<> in Sky C++ code
This switches to using StrongBinding<>s in sky's ContentHandlerImpl
and TestHarnessImpl implementations.

These are the last uses of the deprecated InterfaceImpl<> helper in
the mojo repo (more uses exist in other repos).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/934403002
2015-02-18 18:17:50 -08:00
Adam Barth
3d8ffb7f52 Make it possible to load a WebFrame from a URL
Previously, the WebFrame need to be created with a data pipe consumer handle.
This CL makes it possible to create a WebFrame with a URL and have the engine
issue the network request.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/940703002
2015-02-18 12:57:51 -08:00
Przemyslaw Pietrzkiewicz
ee1f5c2cbd Don't depend on /net for error codes in sky viewer.
This patch cuts the last dependencies of sky on /net by hardcoding the
ERR_ABORTED status code.

https://codereview.chromium.org/933973002/ is a proposed solution to
avoid the hardcoding.

BUG=456130
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/935633003
2015-02-17 19:19:47 +01:00
Przemyslaw Pietrzkiewicz
6a04218fdb Delete sky/services/inspector/server.cc.
Sky Inspector is currently not working. This patch removes the Inspector
server, which is based on net/http_server, to unblock dropping /net in
Mojo.

BUG=456130
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/931873002
2015-02-17 18:18:31 +01:00
Adam Barth
2d006b8294 Actually stop Sky from linking with V8
We don't use V8 anymore. There's no reason to link it in.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/918263003
2015-02-12 21:16:55 -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
Aaron Boodman
17a6f3ed1a Pass the final URL an app was loaded from to the app in Initialize().
R=davemoore@chromium.org

Review URL: https://codereview.chromium.org/905583002
2015-02-10 13:54:19 -08:00
Adam Barth
1f8dd823f9 sky/shell should link with sky/engine
This CL causes sky/shell to create a blink::WebView to show that sky/shell
links with sky/engine. In the process, I've made it easier to be a trivial
embedder of sky/engine by removing the requirement to implement
blink::ServiceProvider.

This CL also causes sky/shell to link with mojo/edk/system to resolve link
errors with Mojo fabric (e.g., MojoClose, MojoWriteMessage, etc). To make this
work properly, we'll need to initialize the EDK in a future CL.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/873923003
2015-02-04 19:31:17 -08:00
James Robinson
5e5c074826 De-client tracing.TraceController interface
The tracing service logically provides one service, TraceCoordinator, which can
start and stop tracing sessions. It also can connect to any number of
TraceControllers each of which can supply tracing information on demand.

Whenever an app connects to the tracing service, the tracing service attempts to
connect to that app's TraceController interface. If the app provides this
interface then tracing data will be requested whenever tracing starts. If the
app doesn't, then the pipe just closes. Thus apps that want to be traced can do
so by creating however many connections to the tracing service they want and
registering a TraceController implementation on each outgoing connection.

The shell connects in a similar fashion by connecting to the tracing service and
providing a TraceController implementation. The code looks a bit different since
the shell is special.

BUG=451319
R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/791493006
2015-02-02 16:56:34 -08:00
Adam Barth
2f39655a37 Cleanup unused #includes and declarations in PlatformImpl
These aren't needed anymore. Also, use more |override|.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/892053002
2015-02-01 13:40:42 -08:00
Adam Barth
bf14e27aca Move SharedTimer implementation into sky/engine
Now that sky/engine can talk to base directly, there's no reason to use
Platform::current to implement SharedTimer. Instead, we can just implement it
directly in SharedTimer.cpp.

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

Review URL: https://codereview.chromium.org/886263002
2015-02-01 09:35:02 -08:00
Adam Barth
db0e9021c9 Remove unused WebURLRequestExtraData class
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/890233002
2015-02-01 00:10:50 -08:00
James Robinson
e5cb39f814 Remove mojo.SurfacesService interface in favor of mojo.Surface directly
Most of the callers have been updated to the new flow already. This
updates the rest and removes the deprecated interface to simplify the
flows in preparation for de-Clienting this interface.

Chromium caller updated to not use this interface here:
https://codereview.chromium.org/869343004/

R=sky@chromium.org
BUG=451319

Review URL: https://codereview.chromium.org/882083003
2015-01-30 13:02:48 -08:00
Adam Barth
e962904c7a Remove TRACE_EVENT indirection through blink::Platform
Normal trace events already go directly to base. This CL removes the remaining
trace events that were still indirected through blink::Platform. These were
just the half-finished inspector timeline trace events, which currently aren't
actually hooked up to anything.

This CL also removes the redunant "convertable to trace format" wrappers and
moves their one remaining use over to just using the version in base directly.

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

Review URL: https://codereview.chromium.org/889823002
2015-01-30 08:47:46 -08:00
Adam Barth
65a50f6c81 Remove unused trace sampling states
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/893503002
2015-01-29 22:08:19 -08:00
Adam Barth
fa57fe2819 WTF should get time from base directly
There's no reason to bounce through several indirections to get the current
time.  We can just call into base directly now.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/887883002
2015-01-29 22:08:02 -08:00
Adam Barth
05137682c6 Don't spam the log for gesture events
We don't convert all the gesture events to WebInputEvents. We don't need to
spam the log about it.

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

Review URL: https://codereview.chromium.org/877733004
2015-01-29 22:07:39 -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
910cd08c89 Recognize gestures from mice
After this CL, we first convert from mojo::Event to blink::WebInputEvent before
feeding the event to the gesture recognizer. That means we process touch and
mouse events in the same way (because they are both represented as pointer
events). As a result, we now recognize scroll and fling gestures from mice.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/888773002
2015-01-29 15:41:04 -08:00
Adam Barth
77e5182631 Move gesture recognition from WindowManagerApp to Sky
In order to have a high-quality gesture system, we need to know many details
about the fine-grained structure of applications. For example, different parts
of the view might be interested in recognizing different gestures and when you
recognize a certain gesture depends on the set of possible gestures.

This CL is a first step towards implementing
https://github.com/domokit/mojo/blob/master/sky/specs/gestures.md by moving the
gesture recognition into Sky where finer-grained information will be available.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/868463010
2015-01-29 14:52:15 -08:00
Eric Seidel
09c29db6b0 Plumb ViewportMetrics change notifications around the world and back.
This fixes the race which is seen where mojo_shell will sometimes
launch with the wrong viewport metrics since the DisplayManager
will happily respond to GetViewportMetrics with default values
before the NativeViewport has fully booted and told it what the
actual values are.

I considered making DisplayManager hang until the NativeViewport
was ready, but I decided that it does make sense for the
ViewportMetrics (device pixel ratio, mostly) to change for a
view if it were to move between displays (as exists on desktop
OSes today).

R=abarth@chromium.org, sky@chromium.org

Review URL: https://codereview.chromium.org/880743002
2015-01-28 13:43:31 -08:00
Adam Barth
645a6a9d12 Remove dead code related to compositing from Sky
R=esprehn@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/865153004
2015-01-27 14:38:56 -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
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
Elliott Sprehn
50e7a7c0a0 Rename scheduleAnimation() to scheduleVisualUpdate().
It causes a full screen raster right now, lets name it for what it does.
This also matches the name used in PageAnimator.

Merge WebWidgetClient into WebViewClient.

They're always the same thing in sky. I also removed all the methods that
don't do anything in sky.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/880713003
2015-01-26 16:09:40 -08:00
Elliott Sprehn
10f5a4043d Merge WebWidgetClient into WebViewClient.
They're always the same thing in sky. I also removed all the methods that
don't do anything in sky.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/880643007
2015-01-26 15:55:08 -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
5e68175437 Fix ASSERT in Sky when dragging outside the window on linux
We don't seem to receive mojo::EVENT_TYPE_MOUSE_EXITED when the mouse exits our
mojo::View. We should find out if that's a bug with the Mojo event system, but
for now this CL adds a fake cancel event the next time the mouse goes down to
at least keep the state machine on the right track.

BUG=https://github.com/domokit/mojo/issues/40
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/879543004
2015-01-26 10:53:51 -08:00