Convert the "TextSelection:*" events to use BundleEventListener /
GeckoBundle, in both ActionBarTextSelection.java and
FloatingToolbarTextSelection.java. UI events are used because the
listeners require the UI thread. The "TextSelection:Update" listeners
are removed because the event is no longer sent by ActionBarHandler.
Convert NotificationHelper events to use BundleEventListener and
GeckoBundle. UI events are used to perform notification operations, and
to keep access to mClearableNotifications to the UI thread. Also,
refactor some recently-added code in NotificationHelper.
Convert "Doorhanger:Add" and "Doorhanger:Remove" to bundle events. UI
events are used because the listener performs UI operations. As part of
the refactoring, DoorHangerConfig was refactored to use GeckoBundle, and
due to that change, a lot of other doorhanger-related classes also had
to be refactored to use GeckoBundle.
General concept is to populate the "extras" field with a stringified JSON object
which contains bunch of additional data which, in aggregate, might give insight
into user's actions.
A builder is used in order to make constructing the extras json string easier.
This builder has a concept of a "global state" which lets us easily include some information
with every A-S telemetry ping.
Currently this is used to track whether or not user has a firefox account.
An instance of a builder is passed around, augmented as more information becomes known,
and is materialized into an "extras" string whenever an action occurs and telemetry
event needs to be sent.
MozReview-Commit-ID: GDmxkWChnnA
Convert "SearchEngines:Data" to use BundleEventListener/GeckoBundle,
including usages in BrowserSearch, SearchPreferenceCategory,
testAddSearchEngine, testDistribution, etc. Also, convert JSON parsing
code in various classes. UI thread is used because the event listeners
perform various UI operations based on the event data.
preferences_general_tablet.xml actually only applies on tablets with enough room
for multiple panes, otherwise preferences_general.xml is used; so the fix here
is necessary to remove the pref on tablets not large enough for multiple
preferences panes.
MozReview-Commit-ID: Ff7VebVYV10
This is the first, mostly mechanical, introduction of a GeckoView
specific BuildConfig.
We have a few "debug logging" like checks. I introduced a
MOZILLA_OFFICIAL abstraction and removed some of the checks as I saw
fit. Subsequent patches will remove more of these checks.
With this change applied, Gradle is broken, because there will be
duplicate BuildConfig files included in the build. That will be fixed
in subsequent patches.
MozReview-Commit-ID: KHhV32o5j5A
This patch abstracts setting the screen orientation into an interface
(but not into the already overloaded GeckoInterface).
I feel this form obscures the (eventual) connection between the
GeckoView widget and its embedding Activity, but it removes the
explicit getActivity() and it's certainly simpler than previous
iterations.
MozReview-Commit-ID: 8a8bPTlcp3T
This commit introduces a special type of a pin, "Activity Stream pin".
It's identified by a fixed position of -1. Activity Stream pins are displayed inline
with top sites, at the very front. They are "non-positioned", as opposed to regular pins
which have a position on Top Sites grid. This approach was selected (as opposed to creating a
new kind of a "non-positioned pins bookmark folder") because it is simpler, does not
involve any migrations or sync changes, and is thus preferred in light of a moving
target that is the current vision for Activity Stream.
Two types of pins, regular ones and Activity Stream pins, are independent of each other.
Due to the fact that pins and bookmarks are almost the same thing, we can only figure our,
based on the underlying queries, the following ahead of time:
- pinned state of a pinned top site item (trivial case)
- pinned state of a non-pinned top site item (trivial case)
- bookmark state of a "bookmarked" hightlight item (trivial case)
- bookmark state of a non-pinned top site item
For all other combinations, states have to be looked up when user opens a context menu for an item.
MozReview-Commit-ID: 3KbOp9S4Pz7
Since we want to include pinned sites in A-S Top Sites, this removes the "plain top sites"
query which excludes pinned sites.
Maximum number of suggested sites displayed is set so that they will fill out at most two "pages".
MozReview-Commit-ID: 8uynmwiaPkt
Convert "ClosedTabs:Data" and "Sanitize:Finished" events used in
RecentTabsAdapter and GeckoPreferences from NativeJSObject events to
GeckoBundle events.