Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
fenix
Commits
7a272a45
Commit
7a272a45
authored
Feb 09, 2020
by
Grisha Kruglov
Committed by
Sebastian Kaspari
Feb 10, 2020
Browse files
Enable fennec Pinned Sites migration
parent
e73b3cfb
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/org/mozilla/fenix/components/TopSiteStorage.kt
View file @
7a272a45
...
@@ -14,7 +14,7 @@ import org.mozilla.fenix.test.Mockable
...
@@ -14,7 +14,7 @@ import org.mozilla.fenix.test.Mockable
class
TopSiteStorage
(
private
val
context
:
Context
)
{
class
TopSiteStorage
(
private
val
context
:
Context
)
{
var
cachedTopSites
=
listOf
<
TopSite
>()
var
cachedTopSites
=
listOf
<
TopSite
>()
private
val
topSiteS
torage
by
lazy
{
val
s
torage
by
lazy
{
TopSiteStorage
(
context
)
TopSiteStorage
(
context
)
}
}
...
@@ -22,20 +22,20 @@ class TopSiteStorage(private val context: Context) {
...
@@ -22,20 +22,20 @@ class TopSiteStorage(private val context: Context) {
* Adds a new [TopSite].
* Adds a new [TopSite].
*/
*/
fun
addTopSite
(
title
:
String
,
url
:
String
)
{
fun
addTopSite
(
title
:
String
,
url
:
String
)
{
topSiteS
torage
.
addTopSite
(
title
,
url
)
s
torage
.
addTopSite
(
title
,
url
)
}
}
/**
/**
* Returns a [LiveData] list of all the [TopSite] instances.
* Returns a [LiveData] list of all the [TopSite] instances.
*/
*/
fun
getTopSites
():
LiveData
<
List
<
TopSite
>>
{
fun
getTopSites
():
LiveData
<
List
<
TopSite
>>
{
return
topSiteS
torage
.
getTopSites
()
return
s
torage
.
getTopSites
()
}
}
/**
/**
* Removes the given [TopSite].
* Removes the given [TopSite].
*/
*/
fun
removeTopSite
(
topSite
:
TopSite
)
{
fun
removeTopSite
(
topSite
:
TopSite
)
{
topSiteS
torage
.
removeTopSite
(
topSite
)
s
torage
.
removeTopSite
(
topSite
)
}
}
}
}
app/src/migration/java/org/mozilla/fenix/MigratingFenixApplication.kt
View file @
7a272a45
...
@@ -16,7 +16,10 @@ class MigratingFenixApplication : FenixApplication() {
...
@@ -16,7 +16,10 @@ class MigratingFenixApplication : FenixApplication() {
FennecMigrator
.
Builder
(
this
,
this
.
components
.
analytics
.
crashReporter
)
FennecMigrator
.
Builder
(
this
,
this
.
components
.
analytics
.
crashReporter
)
.
migrateOpenTabs
(
this
.
components
.
core
.
sessionManager
)
.
migrateOpenTabs
(
this
.
components
.
core
.
sessionManager
)
.
migrateHistory
(
this
.
components
.
core
.
historyStorage
)
.
migrateHistory
(
this
.
components
.
core
.
historyStorage
)
.
migrateBookmarks
(
this
.
components
.
core
.
bookmarksStorage
)
.
migrateBookmarks
(
this
.
components
.
core
.
bookmarksStorage
,
this
.
components
.
core
.
topSiteStorage
.
storage
)
.
migrateLogins
(
.
migrateLogins
(
this
.
components
.
core
.
asyncPasswordsStorage
,
this
.
components
.
core
.
asyncPasswordsStorage
,
this
.
components
.
core
.
passwordsEncryptionKey
this
.
components
.
core
.
passwordsEncryptionKey
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment