Commit Graph
2909 Commits
Author SHA1 Message Date
Jim Chen 813eafff12 Bug 1319496 - 3. Convert prompts to BundleEventListener; r=sebastian
Convert prompts to use BundleEventListener and GeckoBundle.

DefaultDoorHanger.setOptions accepts a JSONObject argument, but if we
converted it to GeckoBundle, it would involve a lot of extra changes in
the other doorhanger code. So this patch adds GeckoBundle.fromJSONObject
and converts JSONObject to GeckoBundle within
DefaultDoorHanger.setOptions. In the future, another patch would convert
all doorhanger code to use GeckoBundle instead of JSONObject.
2016-11-29 12:25:53 -05:00
Tomislav Jurin cfdbbaa31e Bug 1316005 - fixed unused methods, made methods use actual signature and added @Override; r=sebastian 2016-11-24 22:30:04 +01:00
Sebastian Kaspari f5730e87ef Bug 1301468 - Add activity stream session for new tab panel. r=ahunt
MozReview-Commit-ID: 45yMkb3bJfS
2016-11-23 17:24:31 +01:00
Sebastian Kaspari 3d04ce63ec Bug 1301468 - Add telemetry to AS context menu (following the pattern of existing probes). r=ahunt
MozReview-Commit-ID: 91E0c9rPSbB
2016-11-23 17:10:04 +01:00
Sebastian Kaspari b01e0d41f4 Bug 1301468 - AS Top Sites: Add telemetry for showing context menu. r=ahunt
MozReview-Commit-ID: 9OzR2NjUnZJ
2016-11-23 16:59:13 +01:00
Sebastian Kaspari 13cd5d6629 Bug 1301468 - AS Highlights: Add LOAD_URL telemetry. r=ahunt
MozReview-Commit-ID: 4iVJXkz8L61
2016-11-23 16:55:06 +01:00
Sebastian Kaspari 37bb778465 Bug 1301468 - AS Top Sites: Add LOAD_URL telemetry. r=ahunt
MozReview-Commit-ID: 2vgWB2KxPMK
2016-11-23 16:52:20 +01:00
Shan fb8bc6baee Bug 1316006 - Change implicit toString() to Arrays.toString(); r=sebastian
MozReview-Commit-ID: Cgcc8UMNpCr
2016-11-25 16:50:49 +05:30
Carsten "Tomcat" Book 2ee161bf4e merge mozilla-inbound to mozilla-central a=merge 2016-11-24 16:41:59 +01:00
Wes Kocher 43c9517dc3 Merge m-c to inbound, a=merge 2016-11-23 16:18:24 -08:00
Hamel Joshi 0988940be3 Bug 1316017 - Remove redundant nullcheck calls. r=sebastian 2016-11-16 09:12:00 -05:00
maliu eb3d60e9dd Bug 1319302 - RTL support for Firefox for Android, r=sebastian
MozReview-Commit-ID: bKzW07YBDy
2016-11-11 16:10:21 +08:00
Dylan Roeh 653d3e4ffe Bug 1318038 - Open speculative connections for URLs supplied to GeckoCustomTabsService.mayLaunchUrl() r=snorp 2016-11-23 15:50:15 -06:00
Tom Klein eacc5f6083 Bug 1310081 - 3. Add ItemDecoration to create fixed spacing items. r=sebastian
We switch to thinking of the tabs grid layout as being determined by specifying
the spacing between the items, and then allowing the items themselves to expand
to fill whatever room that leaves available, but we also allow the spacing to be
adjusted to match the span counts of the previous GridLayout implementation
(which is a good thing).

MozReview-Commit-ID: L3fgjacMu2d
2016-09-21 22:51:27 -05:00
Phil Ringnalda bf34d7ef12 Merge m-i to m-c, a=merge
MozReview-Commit-ID: EDVoIcyWOhi
2016-11-22 20:03:03 -08:00
Jim Chen d1377edb4e Bug 1319173 - Follow-up to fix crash; r=me 2016-11-22 14:09:42 -05:00
Jim Chen 737caa5be9 Bug 1319173 - Register MediaPlayerManager events later; r=sebastian
Wait to register MediaPlayerManager events until we have a GeckoApp
EventDispatcher, because we only have an EventDispatcher after we create
the GeckoView in onCreate.
2016-11-22 13:39:54 -05:00
maliu 3fac2d24ff Bug 1311480 - Add support to query client with order by name alphabetically, r=Grisha
MozReview-Commit-ID: 7bN7Vh3TqHU
2016-11-16 14:03:31 +08:00
Sebastian Kaspari 482e210e1e Bug 1318560 - ColorProcessor: Handle ArrayIndexOutOfBoundsException from Palette library. r=gbrown,maliu
MozReview-Commit-ID: GwYj1SRNytN
2016-11-21 18:00:01 +01:00
Nick Alexander cc437a6158 Bug 1255914 - Part 2: mostly back out multiDex (changeset 6972bef6693c). r=sebastian
Since we're Proguarding the automation build now, we shouldn't need to
multiDex anymore -- even in beta.

MozReview-Commit-ID: 6Yc73Vi9Fhd
2016-11-13 14:43:00 -08:00
Sebastian Hengst 0bd788752e Backed out changeset 38cde1f5d020 (bug 1235431) for failing mochitest test_openWindow.html on Android. r=backout on a CLOSED TREE 2016-11-22 18:01:59 +01:00
Carsten "Tomcat" Book fe2ded117c Merge mozilla-central to mozilla-inbound 2016-11-22 16:28:50 +01:00
Dylan Roeh ef2c08afb4 Bug 1235431 - Implement windowClient.focus() for Fennec. r=catalinb 2016-11-14 17:22:13 -06:00
Tom Klein 635f5af40b Bug 1310081 - 2. Refactor TabsListTouchHelperCallback to support any swipe alpha function. r=sebastian
MozReview-Commit-ID: HqKwdpArcMm
2016-09-12 11:01:08 -05:00
Tom Klein af241f9d3a Bug 1310081 - 1. Make the tabs list grid view a RecyclerView. r=sebastian
Our previous GridLayout settings gave extra horizontal space to the padding
between items, but GridLayoutManager by default simply left aligns fixed width
items in their column, so the item's width has been changed to fill_parent
and the item title has been switched to fixed width (since otherwise it looks
broken when it expands to an item width larger than the thumbnail width).  The
drawback is that clicking on the extra width part of an item activates the tab,
even though it would seem from what's being displayed that the item should end
at the vertical edge of the thumbnail - that will be fixed in a future commit.

Both the list and grid tabs panel views are now RecyclerViews, so move
TabsLayoutRecyclerAdapter.java to TabsLayoutAdapter.java.

MozReview-Commit-ID: CBrxw1HfRcP
2016-09-12 11:21:51 -05:00
James Cheng ff8e137f02 Bug 1317239 - Part2 - Config the video decoder with adaptive playback feature if it is supported. r=jolin
MozReview-Commit-ID: FORF2NNxgUH
2016-11-23 14:12:05 +08:00
Sebastian Kaspari 60e4ae57ec Bug 1315076 - IconDownloader: Catch exceptions inside tryDownloadRecurse() and close connection if needed. r=Grisha
MozReview-Commit-ID: E6HUKrX37cH
2016-11-22 14:12:16 +01:00
Sebastian Kaspari 551a3e250e Bug 1268414 - Remove UnusedResourcesUtil.TEMPORARY_UNUSED_WHILE_MIGRATING_GRADLE and related resources. r?
MozReview-Commit-ID: 2VMQrRvvMi3
2016-11-17 15:45:31 +08:00
Swaroop Rao bc72bae666 Bug 1316015 - Fixed by replacing '==' & '!=' float comparisons with FloatUtils.fuzzyEquals(). r=sebastian
MozReview-Commit-ID: 2daF8XCHo0o
2016-11-17 11:39:56 -05:00
Swaroop Rao cdf358b875 Bug 1315980 - Changed ExtendedJSONObject to implement Cloneable and the clone() method to throw CloneNotSupportedException. Changed inner class in ResizablePathDrawable to implement Cloneable. r=sebastian
MozReview-Commit-ID: AIxAp1zlN2J
2016-11-17 10:37:41 -05:00
Swaroop Rao e7a9734129 Bug 1316013 - Fixed by removing variables and building them as part of the Log statement (which never gets called because DEBUG is set to FALSE). r=sebastian
MozReview-Commit-ID: 7nWeXG50KLQ
2016-11-16 09:12:36 -05:00
Swaroop Rao 33d4a81f73 Bug 1316004 - Fixed by putting the offending statement in an else block; r=sebastian
MozReview-Commit-ID: 6eTso4djFGF
2016-11-11 21:28:12 -05:00
Swaroop Rao 52e3f8fe6d Bug 1316002: Fixed '==' comparison of strings; r=sebastian
MozReview-Commit-ID: ERo8gOjsXB8
2016-11-11 15:08:55 -05:00
Kilik Kuo ea83963b68 Bug 1307818-[P3] Notify correct batched-keystatuses-changed information in API V23+. r=jchen
MozReview-Commit-ID: CYQ7BoJim7W
2016-11-16 22:10:43 +08:00
Kilik Kuo 4a06d362fc Bug 1307818-[P2] Setup MediaCrypto for both in-process and out-of-process decode. r=cpearce,jchen
MozReview-Commit-ID: Ehbm2u8LeLg
2016-11-16 22:10:01 +08:00
Kilik Kuo 3b5c6aeb86 Bug 1307818-[P1] Provide drmStubId for CDMProxy and instantiate {Local,Remote}MediaDrmBridge. r=cpearce,jchen
MozReview-Commit-ID: EFPn4DOZq4D
2016-11-16 22:09:34 +08:00
Dylan Roeh f456503274 Bug 1317198 - Check if a tab is null before trying to get its id in GeckoApp.onPause() r=sebastian 2016-11-16 09:07:27 -06:00
Andrzej Hunt 6f276e44eb Bug 1317631 - Post: add more cursor position sanity checks r=sebastian
MozReview-Commit-ID: 7CBnLZDkExI
2016-11-15 17:03:03 +08:00
Andrzej Hunt 4fbcaa310a Bug 1317631 - Only handle clicks for highlights r=sebastian
This avoids us trying to obtain an invalid cursor position, since
the cursor only maps to highlights items (and not the headers).

MozReview-Commit-ID: 1NtJuvDRa5r
2016-11-15 17:01:46 +08:00
Tom Klein 0279ab60e9 Bug 1302936 - Ignore tab clicks when the tab has already been removed. r=sebastian
MozReview-Commit-ID: K0eUnMHI9j1
2016-11-12 09:09:17 -06:00
James Willcox 38db513bfd Bug 1314974 - Make GeckoView on Android work again r=jchen 2016-11-14 14:55:29 -06:00
Jim Chen 0f80faec13 Bug 1307820 - Implement per-GeckoView messaging; r=snorp r=sebastian
Bug 1307820 - 1a. Move GeckoApp EventDispatcher to GeckoView; r=snorp

Make it a GeckoView-specific EventDispatcher instead of
GeckoApp-specific, so that GeckoView consumers can benefit from a
per-view EventDispatcher. In addition, a few events like Gecko:Ready are
moved back to the global EventDispatcher because that makes more sense.

Bug 1307820 - 1b. Don't use GeckoApp EventDispatcher during inflation; r=snorp

During layout inflation, we don't yet have GeckoView and therefore the
GeckoView EventDispatcher, so we should not register events until later,
typically during onAttachedToWindow.

Bug 1307820 - 2. Introduce GeckoBundle; r=snorp

The Android Bundle class has several disadvantages when used for holding
structured data from JS.

The most obvious one is the differentiation between int and double,
which doesn't exist in JS. So when a JS number is converted to either a
Bundle int or double, we run the risk of making a wrong conversion,
resulting in a type mismatch exception when Java uses the Bundle. This
extends to number arrays from JS.

There is one more gotcha when using arrays. When we receive an empty
array from JS, there is no way for us to determine the type of the
array, because even empty arrays in Java have types. We are forced to
pick an arbitrary type like boolean[], which can easily result in a type
mismatch exception when using the array on the Java side.

In addition, Bundle is fairly cumbersome, and we cannot access the inner
structures of Bundle from Java or JNI, making it harder to use.

With these factors in mind, this patch introduces GeckoBundle as a
better choice for Gecko/Java communication. It is almost fully
API-compatible with the Android Bundle; only the Bundle array methods
are different. It resolves the numbers problem by performing conversions
if necessary, and it is a lot more lightweight than Bundle.

Bug 1307820 - 3. Convert BundleEventListener to use GeckoBundle; r=snorp

Convert BundleEventListener from using Bundle to using GeckoBundle.
Because NativeJSContainer still only supports Bundle, we do an extra
conversion when sending Bundle messages, but eventually, as we eliminate
the use of NativeJSContainer, that will go away as well.

Bug 1307820 - 4. Introduce EventDispatcher interfaces; r=snorp

Introduce several new XPCOM interfaces for the new EventDispatcher API,
these interfaces are mostly mirrored after their Java counterparts.

* nsIAndroidEventDispatcher is the main interface for
  registering/unregistering listeners and for dispatching events from
  JS/C++.

* nsIAndroidEventListener is the interface that JS/C++ clients implement
  to receive events.

* nsIAndroidEventCallback is the interface that JS/C++ clients implement
  to receive responses from dispatched events.

* nsIAndroidView is the new interface that every window receives
  that is specific to the window/GeckoView pair. It is passed to chrome
  scripts through window arguments.

Bug 1307820 - 5. Remove EventDispatcher references from gfx code; r=snorp

EventDispatcher was used for JPZC, but NPZC doesn't use it anymore.

Bug 1307820 - 6. General JNI template improvements; r=snorp

This patch includes several improvements to the JNI templates.

* Context::RawClassRef is removed to avoid misuse, as Context::ClassRef
  should be used instead.

* Fix a compile error, in certain usages, in the DisposeNative overload
  in NativeStub.

* Add Ref::IsInstanceOf and Context::IsInstanceOf to mirror the
  JNIEnv::IsInstanceOf call.

* Add Ref::operator* and Context::operator* to provide an easy way to
  get a Context object.

* Add built-in declarations for boxed Java objects (e.g. Boolean,
  Integer, etc).

* Add ObjectArray::New for creating new object arrays of specific types.

* Add lvalue qualifiers to LocalRef::operator= and GlobalRef::operator=,
  to prevent accidentally assigning to rvalues. (e.g.
  `objectArray->GetElement(0) = newObject;`, which won't work as intended.)

Bug 1307820 - 7. Support ownership through RefPtr for native JNI objects; r=snorp

In addition to direct ownership and weak pointer ownership, add a third
ownership model where a native JNI object owns a RefPtr that holds a
strong reference to the actual C++ object. This ownership model works
well with ref-counted objects such as XPCOM objects, and is activated
through the presence of public members AddRef() and Release() in the C++
object.

Bug 1307820 - 8. Implement Gecko-side EventDispatcher; r=snorp

Add a skeletal implementation of EventDispatcher on the Gecko side.
Each widget::EventDispatcher will be associated with a Java
EventDispatcher, so events can be dispatched from Gecko to Java and vice
versa. AndroidBridge and nsWindow will implement
nsIAndroidEventDispatcher through widget::EventDispatcher.

Other patches will add more complete functionality such as
GeckoBundle/JSObject translation and support for callbacks.

Bug 1307820 - 9. Implement dispatching between Gecko/Java; r=snorp

Implement translation between JSObject and GeckoBundle, and use that for
dispatching events from Gecko to Java and vice versa.

Bug 1307820 - 10. Implement callback support; r=snorp

Implement callback support for both Gecko-to-Java events and
Java-to-Gecko events.

For Gecko-to-Java, we translate nsIAndroidEventCallback to a Java
EventCallback through NativeCallbackDelegate and pass it to the Java
listener.

For Java-to-Gecko, we translate EventCallback to a
nsIAndroidEventCallback through JavaCallbackDelegate and pass it to the
Gecko listener.  There is another JavaCallbackDelegate on the Java side
that redirects the callback to a particular thread. For example, if the
event was dispatched from the UI thread, we make sure the callback
happens on the UI thread as well.

Bug 1307820 - 11. Add BundleEventListener support for Gecko thread; r=snorp

Add support for BundleEventListener on the Gecko thread, so that we can
use it to replace any existing GeckoEventListener or NativeEventListener
implementations that require the listener be run synchronously on the
Gecko thread.

Bug 1307820 - 12. Add global EventDispatcher in AndroidBridge; r=snorp

Add an instance of EventDispatcher to AndroidBridge to act as a global
event dispatcher.

Bug 1307820 - 13. Add per-nsWindow EventDispatcher; r=snorp

Add an instance of EventDispatcher to each nsWindow through an
AndroidView object, which implements nsIAndroidView. The nsIAndroidView
is passed to the chrome script through the window argument when opening
the window.

Bug 1307820 - 14. Update auto-generated bindings; r=me

Bug 1307820 - 15. Update testEventDispatcher; r=snorp

Update testEventDispatcher to include new functionalities in
EventDisptcher.

* Add tests for dispatching events to UI/background thread through
  nsIAndroidEventDispatcher::dispatch.

* Add tests for dispatching events to UI/background thread through
  EventDispatcher.dispatch.

* Add tests for dispatching events to Gecko thread through
  EventDispatcher.dispatch.

Each kind of test exercises both the global EventDispatcher through
EventDispatcher.getInstance() and the per-GeckoView EventDispatcher
through GeckoApp.getEventDispatcher().
2016-11-14 21:29:50 +08:00
Wes Kocher f858d1f20c Bug 1316869 - checkstyle fixes a=me 2016-11-11 13:23:52 -08:00
Dylan Roeh c454880378 Bug 1316869 - Choose black or white title text color for custom tabs toolbar based on background color. r=sebastian 2016-11-11 09:26:31 -06:00
Andrzej Hunt 627bd52bce Bug 1315938 - Don't crash if tabs aren't initialised yet r=sebastian
getSelectedTab() specifies that it can return null "if we're doing a
session restore after a crash and Gecko isn't ready yet". This seems
to occasionally be happening, resulting in crashes.

(What isn't clear is why this would be happening more regularly in 51,
 it's possible some completely unrelated changes are either making
 the rendering of TopSites faster, causing this call to be made earlier,
 or session restore has simply gotten slower. We have also had a
 crash spike recently due to library loading issues, which would
 likely further exacerbate the whole issue.)

MozReview-Commit-ID: GLFOoXFrAkj
2016-11-08 13:07:24 +01:00
Andrzej Hunt 3b28e98533 Bug 1315717 - Add ripple feedback to AS context menu buttons on Android >= 5 r=sebastian
The circular ripple is only available on API >= 21. We can fallback to a different solution
for older devices, see following patch.

MozReview-Commit-ID: C0aBqsKsuZ5
2016-11-08 10:11:02 -05:00
Carsten "Tomcat" Book cd6ad0efcd merge mozilla-inbound to mozilla-central a=merge 2016-11-10 16:59:38 +01:00
Dylan Roeh f828a56e8c Bug 1225980 - Add a startGecko static method to GeckoService, to be used for GeckoCustomTabsService.warmup() r=rbarker 2016-11-09 11:22:45 -06:00
KuoE0 bbde67ae1f Bug 1295087 - Implement PresentationDeviceProvider for Chromecast devices on Fennec. r=schien,smaug,snorp
MozReview-Commit-ID: 78eNnvAMCsq
2016-09-23 22:13:28 +08:00
Wes Kocher 8fd5b09255 Merge m-c to inbound, a=merge 2016-11-08 14:08:34 -08:00