Commit Graph

95 Commits

Author SHA1 Message Date
Jonathan Almeida
371ef7d6a2 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1401: Add default share menu for CustomTabs 2019-01-22 11:05:11 -05:00
Jonathan Almeida
aa9c4b389b [components] Closes https://github.com/mozilla-mobile/android-components/issues/1724: Use pixel density to get accurate icon size 2019-01-21 10:27:38 -05:00
Jonathan Almeida
8b44f50eb0 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1400: Add close button to custom tabs
Also makes the toolbar unclickable so it can't be switching into
edit mode, and removes all other actions.

Moved the custom tab back button bitmap checking to the feature from the
CustomTabConfig since we needed to know the DisplayMetrics for the
current screen to properly compare it to the max dp value.
2019-01-21 10:27:38 -05:00
Christian Sadilek
43905d4c7e [components] Closes https://github.com/mozilla-mobile/android-components/issues/1518: Select session of same type when session is removed 2019-01-11 18:16:07 +01:00
Sebastian Kaspari
8ef7647504 [components] AutoSave: Do not block on background save.
Android doesn't kill the process immediately after all foreground activities are gone. So we still have
time to save the state from our background thread.

This also avoids ANRs and issues we saw related to blocking the UI thread, e.g.:
https://github.com/mozilla-mobile/reference-browser/issues/405
2019-01-11 14:14:33 +01:00
Mitchell Hentges
8fd19cdf3a [components] Moves description to be part of project.ext 2019-01-11 10:08:32 +01:00
Mitchell Hentges
3ee4d96a84 [components] Reads componentsVersion from .buildconfig.yml 2019-01-11 10:08:32 +01:00
Sebastian Kaspari
6a87f4d360 [components] Issue https://github.com/mozilla-mobile/android-components/issues/1541: feature-session-bundling: New component that saves sessions in grouped bundles. 2019-01-03 12:12:49 +01:00
Colin Lee
5f1b789127 [components] Fixes https://github.com/mozilla-mobile/android-components/issues/1624: Session: Crash because trackersBlocked is empty 2018-12-28 18:03:50 -05:00
Jonathan Almeida
42fcea2b83 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1600: Add exit fullscreen use case 2018-12-21 19:03:49 -05:00
Grisha Kruglov
ed472d66ae [components] Clean up gradle build files for some of the components
- Remove a few unnecessary dependencies
- Add some comments around usage of 'api'
- Mark some of the dependencies as 'api' if they're necessary for use of the module
2018-12-21 13:11:27 -08:00
Sebastian Kaspari
7647c16b8f [components] Refactor EngineSessionHolder to keep a reference to an EngineSession or EngineSessionState.
The main change here is that EngineSessionHolder can now hold an EngineState and this state
is used when we need to create an EngineSession (which will clear the state). This has the
following advantages:

* When restoring we can just attach the EngineState and do not need to create the
  EngineSession immediately. With that we do not load all the EngineSessions and everything
  at once. Initially only the selected EngineSession will be created and loaded. That will
  make the restore faster and use less resources when restoring a lot of sessions.

* (Not in this commit, for a follow-up) It allows us to close EngineSession instances and
  just keep the EngineState around until we need the EngineSession again. That's something
  we could do in low memory situations or when there are just too many sessions/tabs open
  to be performant (e.g. only keep the last recently used EngineSession instances around).
2018-12-19 11:30:07 +01:00
Christian Sadilek
5f9ebdbebe [components] Closes https://github.com/mozilla-mobile/android-components/issues/1067: Add support for opening/closing windows 2018-11-28 12:20:21 -05:00
Arturo Mejia
23d17a6fed [components] Closes https://github.com/mozilla-mobile/android-components/issues/1434: Add support for choice html elements for GeckoEngine 2018-11-28 10:50:35 -05:00
Sebastian Kaspari
96d4fe8f36 [components] Issue https://github.com/mozilla-mobile/android-components/issues/1428: SessionStorageTest: Fix flaky test. 2018-11-26 14:37:55 +01:00
Sebastian Kaspari
4d8197cf69 [components] Issue https://github.com/mozilla-mobile/android-components/issues/743: SessionStorage: Customizable UI-independent session storage. 2018-11-20 12:35:28 +01:00
ali-abdullah
89f3263d12 [components] included buildSrc in ktlint and detekt checks 2018-11-16 12:40:04 +01:00
Sebastian Kaspari
ae4a0d6251 [components] Issue https://github.com/mozilla-mobile/android-components/issues/1303: Move CustomTabService to new feature component: feature-customtabs. 2018-11-13 08:58:58 +01:00
Christian Sadilek
e7bc2e35b3 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1157: Add API for permission requests 2018-11-08 20:01:26 +01:00
Sebastian Kaspari
870fbf8c35 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1198: SessionManager.remove(): Do not select custom tab session. 2018-10-30 17:03:07 -04:00
Sebastian Kaspari
53b3d1a71f [components] Update repository information in README files. 2018-10-25 15:37:46 +02:00
Vadim Semenov
0af6566645 [components] Wrap if-statements in curly brackets 2018-10-24 11:52:48 +02:00
Sebastian Kaspari
9e17b84339 [components] Simplify build configuration. 2018-10-24 10:21:12 +02:00
Christian Sadilek
fa57495a6b [components] Closes https://github.com/mozilla-mobile/android-components/issues/1113: Session/EngineSession link is not thread-safe 2018-10-23 13:13:22 +02:00
Grisha Kruglov
2d43416527 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1115: Preserve session's parent in DefaultSessionStorage 2018-10-22 17:15:37 -04:00
Grisha Kruglov
1a9b2ae0a0 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1114: Firm up session storage and restoration around new storage format
Current storage format doesn't preserve session order, and snapshot processing
is a bit vague around the various edge cases.

This patch changes the storage format to use an ordered list (vs a set), and firms
up creation, processing and restoration of snapshots. Guiding principles are:
- be explicit,
- be lenient about what we accept, and strict about what we produce.

Storage format version isn't bumped out of simplicity: there are no production
consumers of this (that we know of) that we'll need to migrate, and so let's
do the simple thing this time.
2018-10-22 17:15:37 -04:00
Grisha Kruglov
8143ce85d9 [components] Closes https://github.com/mozilla-mobile/android-components/issues/904: Refactor SessionStorage around idea of snapshots
This patch introduces an idea of a SessionsSnapshot, which is a representation of
SessionManager's state that's suitable for persistance. SessionStorage's APIs read/write
APIs are changed to operate over the snapshot.

A public `restore` method was added to SessionManager, along with onSessionsRestored observer method,
which allow restoring a SessionsSnapshot.
2018-10-22 17:15:37 -04:00
Johan Lorenzo
0ca864a1bf [components] Stop Bintray. Update {group,artifact}Ids. Remove massage task 2018-10-22 14:35:51 +02:00
Sebastian Kaspari
ba7cc8770d [components] Closes https://github.com/mozilla-mobile/android-components/issues/1092: SessionManager: Update parent id of children after removing parent. 2018-10-19 17:50:10 -04:00
Sebastian Kaspari
c4a65f8db6 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1066: SessionManager: Add child sessions after parent. 2018-10-19 17:50:10 -04:00
Sebastian Kaspari
dd56177d8a [components] Closes https://github.com/mozilla-mobile/android-components/issues/1065: SessionManager: Add option to select parent on child removal. 2018-10-19 17:50:10 -04:00
Julian_Chu
2f5224bab0 [components] Close https://github.com/mozilla-mobile/android-components/issues/1064: add Parent id to Session
When creating new session from an existing session, we need to the
relationship between two sessions. For example, to click a href link in
web-page to open new tab.

This commit add parent id to Session. If a session is added without
parent, it will be append to tail of sessions. Otherwise it will sit
next to parent.
2018-10-19 11:44:48 +08:00
Renan Barros
db8ac6893e [components] closes issue https://github.com/mozilla-mobile/android-components/issues/1017 2018-10-17 11:10:47 +08:00
Arturo Mejia
6a3cdff388 [components] Closes https://github.com/mozilla-mobile/android-components/issues/988: Create feature-download (Non UI) 2018-10-15 13:36:27 -04:00
Christian Sadilek
f98507c95f [components] Closes https://github.com/mozilla-mobile/android-components/issues/962: Add reusable functionality for observing selected session 2018-10-12 14:39:40 +02:00
Marco
6e4f04af78 [components] Closes https://github.com/mozilla-mobile/android-components/issues/47: Remove test prefix from method names 2018-10-10 15:59:39 -04:00
Grisha Kruglov
f27edf7eda [components] Add 'defaultSession' to SessionManager
Problem this is trying to solve:

SessionManager doesn't own its "empty" state (no selected session, no sessions at all).
Components which rely on the SessionManager may make assumptions about what happens
when SessionManager becomes "empty", and current approach is for some component to "take charge",
and be responsible for adding a "default" session when there are none left.

This doesn't bode well for composing components. We can get into a kind of "action at a distance"
situation, when various components make certain assumptions (say, SessionManager must always have
a selected session), but none of them actually take charge and populate the manager when appropriate.
Since components aren't necessarily aware of each other, and ideally are arbitrarily composable,
this graph of implicit dependencies becomes problematic.

This patch:
A naive solution to this is to get the SessionManager to owner its "empty" state.
This patch allows "default" behaviour to be specified at creation time, supplying a lambda
which produces a default session. Not supplying this lambda is equivalent to allowing SessionManager
to be empty.

Fixes https://github.com/mozilla-mobile/android-components/issues/764.
2018-10-03 09:53:56 +02:00
Wajahat Karim
ed0729232c [components] Closes https://github.com/mozilla-mobile/android-components/issues/922: Update READMEs to point to maven.mozilla.org and use new artifact names. 2018-10-03 09:20:43 +02:00
Sebastian Kaspari
9e715e0058 [components] Issue https://github.com/mozilla-mobile/android-components/issues/939: SessionManager: Do not select custom tab sessions from add(). 2018-10-02 10:40:10 -04:00
Arturo Mejia
a4c1e8c218 [components] Closes https://github.com/mozilla-mobile/android-components/issues/825: Session.url is not updated until page has nearly finished
loading
2018-09-26 10:21:51 +02:00
Arturo Mejia
5bc1ca7173 [components] Closes https://github.com/mozilla-mobile/android-components/issues/495: Provide thumbnail of websites
* Adding captureThumbnail to EngineSession

* Updating TabViewHolder to add thumbnail

* Adding thumbnail to Session

* Adding a new product flavor for systemEngine
2018-09-20 12:51:00 -04:00
Christian Sadilek
6c4bb75508 [components] Closes https://github.com/mozilla-mobile/android-components/issues/768: Replace all calls to Java 8's Map.forEach 2018-09-12 18:52:51 -04:00
Jonathan Almeida
da6f4a83e2 [components] Closes https://github.com/mozilla-mobile/android-components/issues/644: Clear Data (WebView only)
This only includes the implementation for the SystemWebView that's based
off of what we currently do in Focus/Fire TV. Since this is needed for
those apps now, we can work with this implementation until GeckoView
provides us with a nicer API to do the equivalent for it. (Bug 1489669)

We also don't notify any observers since there isn't any
confirmation/information available that we can propagate to cients.
2018-09-11 16:30:30 -04:00
Jonathan Almeida
69563c770e [components] Closes https://github.com/mozilla-mobile/android-components/issues/643: FullScreen mode support 2018-09-11 14:37:57 -04:00
Christian Sadilek
0b1c254fb8 [components] Closes https://github.com/mozilla-mobile/android-components/issues/678: Document browser-session component 2018-09-11 11:21:36 -04:00
Christian Sadilek
6473d424f9 [components] Fix KDocs for SessionStorage 2018-09-10 23:50:06 -04:00
Arturo Mejia
8ced4b7828 [components] Closes https://github.com/mozilla-mobile/android-components/issues/701: Exposing browser-session Desktop mode
* Adding desktopMode property to Session

* Adding onDesktopModeChanged in Session

* Renaming RequestDesktopSite to RequestDesktopSiteUseCase to follow
  the convention

* Implementing onDesktopModeChange in EngineObserver

Renaming:

On EngineSession.Observer
    from onDesktopModeEnabled to onDesktopModeChange
    from setDesktopMode to toggleDesktopMode

On Session
    from onDesktopModeEnabledChanged to onDesktopModeChanged
2018-09-06 18:17:44 -04:00
Christian Sadilek
25d2dfc396 [components] Closes https://github.com/mozilla-mobile/android-components/issues/656: Add find in page functionality to engine/session 2018-08-30 14:06:39 -04:00
Jonathan Almeida
be422f354a [components] Issue https://github.com/mozilla-mobile/android-components/issues/647: Desktop mode support
Closes https://github.com/mozilla-mobile/android-components/issues/647
2018-08-29 11:36:07 -04:00
Jonathan Almeida
2ff709d589 [components] Issue https://github.com/mozilla-mobile/android-components/issues/476: Add long press support as observable
Fixes https://github.com/mozilla-mobile/android-components/issues/476
2018-08-27 13:44:11 -04:00