in create(), only register listener if anchorHandle exits.
in opposite side, only unregister listener in same condition.
MozReview-Commit-ID: HHN23YcmwS
--HG--
extra : rebase_source : bdaa3e7b2a56e8e8d6a7776ff7caf3581e99ff09
getUrlFromAboutReader can return null. There have been crashes caused by not checking this
result in the past. stripAboutReaderFromUrl is a safer version which returns the input URL
if necessary, and is probably what should be used in new code, hence we can make this method
private.
MozReview-Commit-ID: Lg7QWrpSE8F
--HG--
extra : histedit_source : 0964ebab8e9d66e65fc9c3a296031f720219f529
In some of these cases we're duplicating the work of stripAboutReaderUrl. In the other cases
there is no effective difference, however switching to stripAboutReaderUrl allows us
to make getUrlFromAboutReader private, which should help prevent future errors.
MozReview-Commit-ID: BLeQkve2XIs
--HG--
extra : histedit_source : 1818137ef447b70ca49a783a85cb1a198415df77
The same URL could be picked as highlight from history and from bookmarks.
MozReview-Commit-ID: 5vBHluZKfAN
--HG--
extra : rebase_source : 1fee3b2532670d0b9d472518f3648ee5b5bebb8e
This query resembles how the Activity Stream add-on for desktop Firefox selectes highlights[1].
The desktop version uses the 'rev_host' (reversed host) column to filter the results based
on a blacklist and group results by hostname. This has been omitted here (See bug 1298785 and
bug 1298786).
Additionally the desktop version uses a block list to filter "highlights" that have been removed
manually by the user. This is not added here until needed from the UI side (see bug 1298783).
[1] 9eb9f451b5/addon/PlacesProvider.js (L578)
MozReview-Commit-ID: 9TyIaK21MNJ
--HG--
extra : rebase_source : d6debec1c16b1a1667b0c10fe49e4fcc1dc11bfd
This patch:
- moves padding, so that the topsites pagers uses the full screen width (otherwise
topsites cards start disappearing where the padding starts when scrolling,
which looks odd)
- Adjusts background colour for AS.
- Removes redundant TopSites title
- Adds a divider to the bottom of topsites / above Highlights.
MozReview-Commit-ID: 181COuLECtC
--HG--
extra : rebase_source : d3053e4c0ea31ecb250ddae4448172e4dbaf1e3e
This has the side effect of enabling click support for topsites.
MozReview-Commit-ID: DW7WX4QDO6n
--HG--
extra : histedit_source : 841fa42364397965d237c36540afc20a86bb2922
I think originally I wanted to fiddle the Loaders from the Adapter, but we don't do that
so this code is unused/unnecessary. We should also make sure we only ever create one adapter,
which we can do by initalising it in the constructor.
MozReview-Commit-ID: MCNBXll1ZX
--HG--
extra : histedit_source : 379bcb165906ab3d79d1676617b19589e3add652%2C4a2d8c786192614a798820a641c2368cffb307ac
Icons loaded from memory have already gone through the resizing process and have either
the requested size or are resized up to a limit. Without this check a small icon
could be resized multiple times until it matches the target size; even though the icon
is too small. In addition to that we would recycle a bitmap that might still be in use.
MozReview-Commit-ID: K51aBhBcAnj
--HG--
extra : rebase_source : 771c0a88b69e5d3688293ddf27955e01717c8931
The FaviconGenerator is the last class in the old favicons package. As this class is only used by the IconGenerator
let's move the code inside the new class and remove FaviconGenerator.
MozReview-Commit-ID: 7NsJRGdoUWv
--HG--
extra : rebase_source : 703b80560f47220d094de0049cd9b92f8cd524eb
The decoders are used by the code in the icons package exclusively. Let's move it
to the new package now.
MozReview-Commit-ID: AAybHpeA71V
--HG--
rename : mobile/android/base/java/org/mozilla/gecko/favicons/decoders/FaviconDecoder.java => mobile/android/base/java/org/mozilla/gecko/icons/decoders/FaviconDecoder.java
rename : mobile/android/base/java/org/mozilla/gecko/favicons/decoders/ICODecoder.java => mobile/android/base/java/org/mozilla/gecko/icons/decoders/ICODecoder.java
rename : mobile/android/base/java/org/mozilla/gecko/favicons/decoders/IconDirectoryEntry.java => mobile/android/base/java/org/mozilla/gecko/icons/decoders/IconDirectoryEntry.java
rename : mobile/android/base/java/org/mozilla/gecko/favicons/decoders/LoadFaviconResult.java => mobile/android/base/java/org/mozilla/gecko/icons/decoders/LoadFaviconResult.java
extra : rebase_source : 3166604d46fcd4736404cc1aa69a98dfbd736072
Most of the code in the favicons package is now obsolete and can be
removed. Most of this code still exists in the icons package (in smaller
chunks).
MozReview-Commit-ID: 6J4pgd5doNt
--HG--
extra : rebase_source : fa04223a758483d8440167fb63fe852ea3bde3f8
WebActivities API has removed by bug 1284455, so we should remove Android backend.
MozReview-Commit-ID: IOYs1bM2u06
--HG--
extra : rebase_source : c6c701159817fe8595c20205c2fc3a2253ffd39f
This patch replaces the old favicon code with the new icon code
in the UI code.
MozReview-Commit-ID: 2YdDpYUhb0M
--HG--
extra : rebase_source : 1c07eebdd4d9d873040a60a19b2aa30efc712cb7
This patch does multiple things:
1) It restructures the icon code to follow a preparer, loader, processor pattern.
Instead of very long procedures we now have a lot of small components. This patch
includes 90+ tests for those components.
2) It replaces the database storage with the disk lru cache. We still keep the
tables around because we will still load from it as fallback to avoid needing
to migrate all data.
This patch is pretty big but a lot of it is moving code around and breaking it
into smaller chunks. A later commit will remove now obsolete components.
By creating a consistent mapping page URL -> icon URL -> icon data this change
fixes the linked bugs (bug 1269821 and bug 1271634).
MozReview-Commit-ID: 1nkrZn286Gv
--HG--
extra : rebase_source : e8d2902dc8553e43297e9e3f0fd96bf04f28ba3a
To avoid having to mess around with the HomePanel configuration machinery, we simply
override the class being loaded for top_sites in HomeAdapter: this is hacky, but
provides a simple temporary solution for showing ActivityStream as a homepanel.
MozReview-Commit-ID: Ga9qUTP3xxA
--HG--
extra : rebase_source : 004e5648ccf74d70f56e66c3ae228bb8071e9756
extra : source : e2d2895a0e678b58336f66fdae01efcd6264954e
This will allow us to more easily switch ActivityStream from being a HomePanel to being a complete
HomePager replacement - this could potentially be extended to read from a preference, but hardcoding
is probably sufficient for now.
MozReview-Commit-ID: HxQg5bOTmdh
--HG--
extra : rebase_source : 99048a0477214c2030cd9072a3e50bb041a18fff
extra : source : 41e5922460ccb2ded3d4e00975eb45f15c1ac4a0
We can keep the general ActivityStream code in the ActivityStream class/widget, allowing
reuse inside a HomePanel (for use in the HomePager). ActivityStreamHomeScreen then
wraps this for use as a HomePager replacement (which is the long-term goal for AS).
MozReview-Commit-ID: 1aWBh1YyARY
--HG--
extra : rebase_source : 8101f445b2aa106a2e06afc097247e849338b95e
extra : source : 155d6001460854ebff20bd1287fcb11c055cea66
Use application context for delayed callbacks to prevent leaking the
BrowserApp instance. Also, use application context for accessing
Distribution, to prevent leaking old BrowserApp instances, and to avoid
using a destroyed Context. Finally, attach AudioFocusAgent to the
application context instead of the BrowserApp context to avoid leaking
BrowserApp.
Unregister certain events in BrowserApp and GeckoApp to prevent
BrowserApp from leaking. Also, properly unregister event listeners in
PageActionLayout to prevent BrowserApp leaks, because
PageActionLayout.onDestroy never got called before.
Move registration of AccessibilityManager listeners to GeckoApplication,
and change all Context references to the application context, so that
GeckoAccessibility doesn't leak old BrowserApp instances as new
BrowserApp instances are created.
The patches in bug 1075476 refactored our notificaiton code to use broadcasts instead of
bringing the app to the front. However notification actions created via Notifications.jsm
still used activity intents (without any activity listening).
MozReview-Commit-ID: 7ZFMkgBitqw
--HG--
extra : rebase_source : 624538827df97f05657aaf99bc935c9fa7c5d785
- Introduce a new BatchingUploader class to handle storing records and keep track of batches/payloads
- Refactor upload runnable and upload delegate into their own classes
- Introduce Last-Modified and X-I-U-S handling into non-batching mode
MozReview-Commit-ID: 3JLExwQvYzM
--HG--
extra : rebase_source : 4a6a2db595fe72473b033acd4f3180fa799319d4
We only require the CirclePageIndicator, hence I've only imported that portion
of the library. The two resource files have been trimmed to only include values
that are relevant to the CirclepageIndicator.
MozReview-Commit-ID: EPyIf7OJHpe
--HG--
extra : rebase_source : b0a0fac13b619add96ec9d89281f5cec2ca6d51c
This uses a ViewPager, with each page containing a grid managed by a separate RecyclerView.
One main adapter splits the data into appropriately sized groups for each RecyclerView
to handle.
MozReview-Commit-ID: 9XGuw0NckD4
--HG--
rename : mobile/android/base/resources/layout/activity_stream_card_top_sites_item.xml => mobile/android/base/resources/layout/activity_stream_topsites_card.xml
extra : rebase_source : cc6ad23ae223b01ab59071d986ab4ad2d41c929c
We'll need this workaround for all the other CardView's we use.
MozReview-Commit-ID: 1B96Y2ZNKrY
--HG--
extra : rebase_source : e32e410045349f3afb7d5766b6dbb2cd80c0fc34
ActivityStream's topsites won't support pinned sites for now,
this allows us to use a simpler query that only retrieves topsites
without the complexity of a temporary table to merge pinned sites.
This results in some duplication between the old and new topsites
queries, however eventually we're going to want to get rid
of one of these queries (we don't know whether ActivityStream will
support pinned sites in the future yet, so we definitely want to keep
the pinned query for now - it's also needed for the old topsites panel).
MozReview-Commit-ID: AQyzXHGl3Cf
--HG--
extra : rebase_source : 6830c50d30a326dc7080ce720d4c1890dbab8e32
Retrieving the doorhanger during onAttachedToWindow seems to be unreliable, resulting in NPE's when
it doesn't work (the only logical explanation would be that onCreate hasn't been called yet, meaning
we don't have a layout yet). We should instead findViewById() it during onCreate, where the layout
is guaranteed to exist.
Since we show the overlay on all devices now, we can make it visible by default, whereas in the past
we had a condition to only enable it on > 2.3 devices.
MozReview-Commit-ID: 1DGVAPSX0mi
--HG--
extra : rebase_source : 025eb790e3b6c2d27ce10e04d624eb19b889d88d
This patch adds the known and widely used disk LRU cache library by Jake Wharton [1].
It's a standalone version of the disk LRU cache found in the AOSP tree.
The goal is to use a flat file disk cache to avoid the overhead of storing blobs
in a database [2] (and some bugs like bug 1108084).
[1] https://github.com/JakeWharton/DiskLruCache
[2] https://wiki.mozilla.org/Performance/Avoid_SQLite_In_Your_Next_Firefox_Feature
MozReview-Commit-ID: 2ayN7SYVe4W
--HG--
extra : rebase_source : d24907e9ab5563999754bb1f554ed31e5c90d47d
Add dispatch() methods to EventDispatcher that allow Java code to
dispatch events to Bundle listeners (currently either UI or background
thread listeners).
Some resource data is for Fennec/XUL era. Since these files is unused now, we should remove these from our package.
MozReview-Commit-ID: Dsx3qrSD01h
--HG--
extra : rebase_source : 66b416bcf7933327242bf6b74b88f81d5aac123a
Make the GeckoAppShell.cameraCallbackBridge callback use the new native
JNI bindings. Also refactor the relevant code in GeckoAppShell and
CameraStreamImpl.
Get rid of LayerView.Compositor.getSurface and just pass in the surface
when creating or resuming the compositor. That also lets us get rid of
some synchronization required for getSurface.
Now that nsWindow doesn't own LayerViewSupport, we shouldn't be using
WindowEvent for LayerViewSupport calls. This patch converts the calls
that dispatch to proxy to dispatch directly to Gecko. For
SyncResumeResizeCompositor, it used a proxy to call OnResumedCompositor
on the Gecko thread; this patch makes SyncResumeResizeCompositor post an
event to call OnResumedCompositor directly, without going through the
proxy.
Right now we report Java exception stacks through two code paths:
- GeckoAppShell.reportJavaCrash for exceptions caught by Java code
- jni::HandleUncaughtException for exceptions caught by native code
This patch combines the code for reporting the Java stack trace into
ReportException, to make it easier to add new features such as reporting
OOM exceptions.
We used to only handle certain exceptions in native code, and otherwise
forward the exception to Java handling code. Handling exceptions in
native code gives us better native stack traces in crash reports, so
this patch makes us always handle uncaught Java exceptions in native
code if possible, and only forward to Java as a fallback.
Bug 1058438 moved disabled hosts to the permission manager which are already cleared by these modules.
MozReview-Commit-ID: InprrYLvjMR
--HG--
extra : rebase_source : 806c2542cbab953b74ad82611501ecac32400930
- Add `envType` to BaseContext.
- Pass an explicit envType to all `registerSchemaAPI` invocations.
- The factories passed to `registerSchemaAPI` will be split up later, so
that content scripts (`content_child`) and addon pages can share
common implementations.
- The factories that implement the addon API will also be split up,
to separate code running in the main process (`addon_parent`) from
code running in a child process (`addon_child`).
- Remove the use of a hardcoded list of `namespaces` from ProxyContext.
Now `envType` is used to specify whether an API should be activated.
MozReview-Commit-ID: Jiff8HIwG92
--HG--
extra : rebase_source : 946a3c0009a4e3223c2d10044b3099a94c845394
Because of the smart folders and section headers, the adapter position needs to be appropriately adjusted when trying to access the corresponding cursor item.
MozReview-Commit-ID: n3FvcsYJ5T
--HG--
extra : rebase_source : 366dadb7abde5283a93fb1d62cff3ff4e3bba28b
Moving all vertically listed items into one RecylerView avoids the layouting issues encountered
with nested RVs. This results in a slightly more complex adapter, however overall this still
seems simpler than having to hack around the RecyclerView height measurements. (This also
makes the layout itself simpler, which hopefully means better performance too.)
MozReview-Commit-ID: HFS9q5JNYpY
--HG--
rename : mobile/android/base/java/org/mozilla/gecko/home/activitystream/MainRecyclerAdapter.java => mobile/android/base/java/org/mozilla/gecko/home/activitystream/StreamRecyclerAdapter.java
extra : rebase_source : a8914cade238e031f171718914dbd67e8f81fba1