37534 Commits

Author SHA1 Message Date
James Robinson
91f69b02ba Move mojom definitions of URL{Request,Response} into SDK
This moves the definition of the mojom URLRequest and URLResponse
objects into the SDK at //mojo/public/interfaces/network/. These are
used directly by the shell and have a special place in the system. This
patch does the minimal amount of import/include updating to get tests
passing but doesn't fully update everything - in particular it
doesn't update all the C++ code that #includes url_loader.mojom.h for
the URLRequest or URLResponse definitions to #include the more specific
mojom.h files, or the equivalent in other languages. I'll do that in a
follow-up to minimize churn.

R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/1129063008
2015-05-27 17:07:51 -07:00
Adam Barth
da02cd53bb Introduce RenderNodeWithChildMixin
R=ianh@google.com

Review URL: https://codereview.chromium.org/1156013003
2015-05-27 14:31:08 -07:00
Hixie
37d689c4e8 [Effen] port fn and stock to RenderNode, part 1 of many
This gets things off the ground barely enough to show some pixels.
These are not pixels that are actually part of the stock app, but
it's a start.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1157033006
2015-05-27 13:36:01 -07:00
Ian Fischer
e3f337f934 Make skydb --gdb work on mac.
R=eseidel@chromium.org
TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1155583006
2015-05-27 13:16:42 -07:00
Adam Barth
1f16cbca7d Add support for testing content in SkyView
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1160763004
2015-05-27 13:14:08 -07:00
Eric Seidel
a328df8634 Make it possible to draw Text in the new window/document-less world
I had to add back document.createText() since new Text()
does not work in the new world yet.

LayoutRoot is a new Dart-exposed class which holds the Frame and
all associated machinery, sufficient to trigger a restyle
and layout of the subtree.

This is all kinda hacky and I'm sure likely to cause many
crashes if folks call random methods on these disconnected
trees.

But this makes it at least possible to paint text for now
and we can improve this in the coming days.

This really should have Adam's review.  It's hugely hacky
but I'd like to negotiate out with him the timeline on
which we should fix some of these hacks.

R=ianh@google.com
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/1148253003
2015-05-27 11:05:42 -07:00
Eric Seidel
dc82febb38 Add support for Mac vs. Linux sky_server builds
I also made sky_server get pulled down via DEPS
since thats how all the rest of our google storage-based
binaries work.

R=jamesr@chromium.org, jackson@google.com
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/1150033006
2015-05-27 10:42:33 -07:00
Collin Jackson
9d9486d20e Speed up shelldb by skipping unnecessary copies of APK to device
Right now I'm storing a SHA1 in a folder in /sdcard since
that seems likely to work on non-rooted devices, but
I haven't tested it.

This cuts build times from 6.5 seconds to 1.5 seconds for
me. You can save another 0.5sec by passing the --no_install
flag to avoid the SHA1 check altogether if you're sure
that nothing has changed.

R=eseidel@chromium.org, eseidel, hixie

Review URL: https://codereview.chromium.org/1149113005
2015-05-26 17:51:19 -07:00
Eric Seidel
64637bf47f 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
Collin Jackson
e47db7ae1d Sky shelldb should restart app when using --no_install and forward observatory port
R=eseidel@chromium.org, eseidel

Review URL: https://codereview.chromium.org/1156993004
2015-05-26 11:16:08 -07:00
Eric Seidel
8a32e93506 Fix android build
TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1147153005
2015-05-22 13:11:39 -07:00
Eric Seidel
c6cacd7e34 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
John McCutchan
12b9f613f2 Remove deploy_sdk.py and mojo_demo.py
BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1143333006
2015-05-22 06:52:35 -07:00
Adam Barth
b435fe37f2 Make hit testing work in layout2.dart
This CL makes simple_render_tree.dart interactive by making the hit testing
system work. I've also added a mechanism for requesting an animation frame.

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

Review URL: https://codereview.chromium.org/1153543002
2015-05-21 11:22:17 -07:00
Adam Barth
224f559c4c Plumb input events into SkyView
Clients can now register a callback that gets called whenever we have an event
for the view. We'll need to update the Event class at some point, but this is a
start.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1129333005
2015-05-19 16:50:28 -07:00
Adam Barth
7c90e5e9bf Plumb display metrics into SkyView
This CL teaches SkyView the width, height, and device pixel ratio of the
display. In the future, we'll want some sort of notification system for when
these values change.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1139823010
2015-05-19 14:54:08 -07:00
John McCutchan
ad1f78f42b Have shelldb and skydb automatically download assets for you if they don't exist.
BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1131373005
2015-05-19 14:22:55 -07:00
Adam Barth
e3743e5101 Teach SkyView path to draw a circle
This CL adds a global view object that can receive a Picture and be signaled to
draw. When using SkyView, this Picture shows up on screen.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1134913003
2015-05-19 14:20:04 -07:00
Adam Barth
44c10c9f6b Teach SkyView code path to print hello, world
This CL makes the SkyView codepath smart enough to print "hello, world" to the
console. The code path is off by default but can be enabled by changing one
line of code.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1131673011
2015-05-19 13:51:12 -07:00
John McCutchan
826623c1f1 Fix skydb workflow
BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1132723010
2015-05-19 10:44:47 -07:00
John McCutchan
9f6d79df33 Suppress unnamed library analyzer spam in shelldb
Revert "Add library names to many sky libraries"

This reverts commit 1337e0a803a54ee92d6dce7f8c4a6335f7cbb9fa.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1142893007
2015-05-19 10:25:43 -07:00
John McCutchan
7a91ed422e Fix shelldb workflow
- Add a real internals.dart entry point.
- Don't run deploy_sdk from shelldb.
- Suppress native functions error from analyzer output.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1145823002
2015-05-19 10:12:41 -07:00
Adam Barth
5aa94de11a Make android directory for Android-specific bits of SkyShell
This CL prepares us to create an iOS version of SkyShell by moving the
Android-specific bits into an android directory.

R=chinmaygarde@google.com

Review URL: https://codereview.chromium.org/1139873004
2015-05-19 09:41:44 -07:00
John McCutchan
eca04d9938 Rationalize Dart mojo and sky package structure.
NOTE: This CL appears far larger than it actually is for two reasons:

1) Many files were moved around to use the Dart package directory structure.
2) Many .dart files had to have import paths updated.

- Organize mojo/public/dart so that it uses standard Dart package layout
- Organize mojo/dart/apptest so that it uses a standard Dart package layout
- Organize sky/sdk so that it uses a standard Dart package layout
- Create a mojo/testing package (used by unittests)
- Introduce the 'dart_pkg' gn rule which populates gen/Config/dart-pkg
- All internally vended Dart packages must have a corresponding dart_pkg rule
- It is now possible to use dependency_overrides: in pubspec.yaml to mix internal and external package dependencies (enables analyzer, editor, webstorm usage for internal developers).
- Package root for dart content handler ends with "packages/"
- Imports of mojo package uris no longer need the "public/dart"
- mojo/public/tools/dart_package.py is a clone of mojo/public/tools/gn/zip.py
- Sky tests no longer run 'deploy_sdk' script.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1132063007
2015-05-18 14:41:39 -07:00
Adam Barth
e8d8c1aaa8 public org.domokit.sky.shell.SkyMain.ensureInitialized()
It's useful to be able to call org.domokit.sky.shell.SkyMain.ensureInitialized() when implementing custom Android Activities. This commit makes ensureInitialized() public for this purpose.

Unrelated changes:
Added curly braces to pass PRESUBMIT check.
Add Lex Berezhny <lex@damoti.com> to AUTHORS file in order to be able to commit fixes (and pass PRESUBMIT check).

Patch by Lex Berezhny <lex@damoti.com>.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1135953004
2015-05-16 13:57:23 -07:00
Eric Seidel
5b60d0a358 Bump versionCode of SkyDemo.apk to avoid downgrade warning.
Also teach both skydb and shelldb to ignore version downgrades
I did not change sky_tool since maybe the warning makes sense
there?

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

Review URL: https://codereview.chromium.org/1138343002
2015-05-13 17:34:09 -07:00
Roozbeh Pournader
e92a3c62b5 Support hyphenation frequency in Minikin.
Three hyphenation frequencies are now supported:

kHyphenationFrequency_None, which turns off both automatic
hyphenation and soft hyphens.

kHyphenationFrequency_Normal, which has aconservative amount of
hyphenation useful as a conservative default.

kHyphenationFrequency_Full, which has a typographic-quality amount of
hyphenation useful for running text and tight screens.

Bug: 21038249
Change-Id: I2800f718c887c9389a1a059d7ec07d7fa2ca1dee
2015-05-12 14:51:36 -07:00
Colin Blundell
cff10ebf23 Dart: Adds mojom pub package.
Creates generate.dart script that installs generated .mojom.dart files into
the mojom pub package.

Updates Sky's deploy_sdk.py script to put mojom.dart files in locations where
they can be consumed by the generate.dart script once the SDK is published and
obtained via "pub get".

This CL is adapted from a patch by zra@google.com; most of the work here is his.

R=iposva@google.com

Review URL: https://codereview.chromium.org/1106383006
2015-05-07 15:23:03 +02:00
James Robinson
17c616b420 Update from https://crrev.com/327068
This rolls in //base, //build and //sandbox/linux and updates other
things to match, in particular:

*) Update build_v8.patch
*) Add junit, mockito and roboelectric to DEPS for android test rules
*) Update DEPS for grit
*) Fix up various GN files for os->target_os rename
*) Fix up a few places that were using //base/float_util to use std::isnan
*) Fix up a few places using ApiCompatibilityUtil to use Android SDK directly

as well as a few miscellaneous fixes.

Many portions based on ncbray's work in
https://codereview.chromium.org/1108173002/

R=ncbray@chromium.org
TBR=ncbray@chromium.org

Review URL: https://codereview.chromium.org/1124763003
2015-05-05 16:31:51 -07:00
yzshen
41e9b9f5b9 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
James Robinson
f041711454 Teach the mojo_shell --trace-startup flag to gather data from services
This makes passing --trace-startup to mojo_shell (or MojoShell.apk)
collect and save data from all apps/services that support tracing, not
just the shell itself.

R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/1105773002
2015-05-01 11:03:09 -07:00
Eric Seidel
d51f3d349d Add pubspec.yaml files for each of the examples/ directories
so that pub get will create a packages/ directory for each
and users of packages/sky/sky_tool can run these examples
from sky_sdk as the instructions say to.

TBR=ianh@google.com
https://github.com/domokit/mojo/issues/128

Review URL: https://codereview.chromium.org/1110283002
2015-04-28 16:26:38 -07:00
John Reck
1be122da96 Move Bitmap to a different namespace
namespace naming collision. Move minikin's
Bitmap out of android:: and into minikin::

Change-Id: I5ae3925f81b848dc79576429ab55243b96f7fed2
2015-04-27 17:23:29 +00:00
Hixie
30074007c7 shelldb: Make shelldb analyze also analyze the packages, since that's where most development is actually happening at the moment.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1101893002
2015-04-27 09:16:50 -07:00
Jim Beveridge
2cd1e6fc22 Copy of Issue 1100753003, so I can roll Mojo to Modular.
Add support for extra mojom dirs to deploy_sdk.py

TBR=blundell

Review URL: https://codereview.chromium.org/1102883003
2015-04-24 15:03:47 -07:00
Ojan Vafai
675ce1c882 Expose minContentWidth/maxContentWidth and a callback for computing them.
This exposes the last hooks needed to implement flexbox layout. For now,
I didn't worry too much about the exact API we're exposing since this will
all change with the upcoming redesign (e.g. https://codereview.chromium.org/1093633002).

minContentWidth == the width if the element were to wrap at every wrapping point (not including border/padding)

maxContentWidth == the width if the element were to only wrap at hard wrapping points (e.g. \n inside a whitespace: pre).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1101793003
2015-04-24 13:14:41 -07:00
Zachary Anderson
53e46748dc Dart: Put generated .mojom.dart files under mojoms pacakge.
BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1092793005
2015-04-23 15:23:50 -07:00
Raph Levien
d24df3eb94 Don't include trailing newline in width for line breaking
In a paragraph with a trailing newline, the width of the newline
character was included in the line width for breaking purposes,
basically as if it were a non-breaking space. This caused a
discrepancy, where Layout.getDesiredWidth() suggested that the text
would fit in a single line, but StaticLayout would break it because of
the added width of the newline character.

The proposed fix is simply to consider newline to be a space that
disappears at the end of a line.

Bug: 20152308
Change-Id: I539574c5b8ea892c8ed6aca6c59e90ccdf74a680
2015-04-22 15:31:29 -07:00
Dave Moore
0d41d0f96e Fix check for MojoShell.apk
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1097343002
2015-04-21 20:58:18 -07:00
James Robinson
8364320dfe Teach sky_server not to serve up /.git
Sky doesn't need the git repo of the mojo repo.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1059113004
2015-04-21 16:01:17 -07:00
Hixie
975fdca798 Make sky_server include no-cache headers since we don't really want caching during development.
TBR=eseidel

Review URL: https://codereview.chromium.org/1091163003
2015-04-17 16:35:35 -07:00
James Robinson
a3f8bdecb0 Expose sky KeyboardService in android mojo_shell
R=eseidel@chromium.org, qsr@chromium.org

Review URL: https://codereview.chromium.org/1088793003
2015-04-16 17:11:15 -07:00
Ryan Macnak
c9abc3cfc4 Ensure isolates have a root library so createMirrorSystem() and spawnUri() are happy.
https://github.com/domokit/mojo/issues/98

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1088263004
2015-04-16 15:49:11 -07:00
Zachary Anderson
514c65df29 Uses mojom module names as Dart's package: import URI
At present there is a special case in Dart bindings generation which
makes the Mojo SDK and things under mojo/services portable. However,
we must not require things under mojo/services to be next to the
Mojo SDK under mojo/public/... in client repos. Further, other
collections of mojoms should also be portable.

To fix this, instead of using the path in the host repo as the
canonical package: import URI for the generated Dart code, this CL
uses the mojom module name.

BUG=https://github.com/domokit/mojo/issues/73
R=blundell@chromium.org, johnmccutchan@google.com, tonyg@chromium.org

Review URL: https://codereview.chromium.org/1071693003
2015-04-16 07:50:47 -07:00
Raph Levien
05e89cffd4 Add functions for measuring cursor positioning
New functions for computing the correspondence between cursor
position and advance, respecting grapheme boundaries.

Change-Id: I620378d5f64cd74300cd43db522adeb555825dff
2015-04-15 20:19:10 -07:00
Raph Levien
6705d6ff2a Rename "margins" to "indents"
The name "margin" conflicts with another meaning, so we're making the
name in the public api "idents" and the code consistent in naming.

Change-Id: I9170116b4d972e4b25f0f319e78376310288eb41
2015-04-15 19:12:48 -07:00
Raph Levien
201d894701 Add margins array to line widths object
In order to support layout in non-rectangular regions, the LineWidths
object needs to accept an arbitrary array of margins. This is
implemented in addition to the existing firstWidthLineCount/restWidth
mechanism for convenience, though using only arrays would have the
same expressive power.

Bug: 20182243
Change-Id: Iea96bca1a92012314ac27e617c67f306c1f1b2f2
2015-04-15 19:12:41 -07:00
Eric Seidel
8e0726b4a9 Improve commit message generation for deploy_sdk.
Hopefully this will make it slightly more clear that the sky_sdk
repository is not actually a stand-alone repository, but rather
generated by a script.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1088223003
2015-04-15 14:12:59 -07:00
Ojan Vafai
41a9d53fd4 Make changing your layout manager work.
If your layout manager changes, then you need to setNeedsLayout,
otherwise the next frame doesn't even get scheduled. We already
correctly handle going from not having layout to having one or
vice versa by doing the more drastic reattaching since that
requires changing your actual render class.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1060013005
2015-04-15 11:08:32 -07:00
Ojan Vafai
a0ef1d472a Fix getChildElements.
It was returing all element descendants instead of all element
immediate children.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1048333006
2015-04-14 16:40:58 -07:00