Commit 60b084a4 authored by Grisha Kruglov's avatar Grisha Kruglov
Browse files

Closes #7145: Switch sample-browser to browser-storage-sync

parent 5f820348
......@@ -76,7 +76,7 @@ dependencies {
implementation project(':browser-thumbnails')
implementation project(':browser-toolbar')
implementation project(':browser-menu')
implementation project(':browser-storage-memory')
implementation project(':browser-storage-sync')
implementation project(':lib-fetch-httpurlconnection')
implementation project(':lib-nearby')
......@@ -107,12 +107,13 @@ dependencies {
// Add a dependency on service-glean to simplify the testing workflow
// for engineers that want to test Gecko metrics exfiltrated via the Glean
// SDK. See bug 1592935 for more context.
implementation project(":service-glean")
implementation project(':service-glean')
implementation project(':support-utils')
implementation project(':feature-downloads')
implementation project(':support-ktx')
implementation project(':support-webextensions')
implementation project(':support-rustlog')
geckoNightlyImplementation project(':browser-engine-gecko-nightly')
geckoBetaImplementation project(':browser-engine-gecko-beta')
......
......@@ -29,7 +29,7 @@ import mozilla.components.browser.session.Session
import mozilla.components.browser.session.SessionManager
import mozilla.components.browser.session.storage.SessionStorage
import mozilla.components.browser.state.store.BrowserStore
import mozilla.components.browser.storage.memory.InMemoryHistoryStorage
import mozilla.components.browser.storage.sync.PlacesHistoryStorage
import mozilla.components.concept.engine.DefaultSettings
import mozilla.components.concept.engine.Engine
import mozilla.components.concept.fetch.Client
......@@ -104,7 +104,7 @@ open class DefaultComponents(private val applicationContext: Context) {
val icons by lazy { BrowserIcons(applicationContext, client) }
// Storage
private val lazyHistoryStorage = lazy { InMemoryHistoryStorage() }
private val lazyHistoryStorage = lazy { PlacesHistoryStorage(applicationContext) }
val historyStorage by lazy { lazyHistoryStorage.value }
private val sessionStorage by lazy { SessionStorage(applicationContext, engine) }
......
......@@ -5,6 +5,7 @@
package org.mozilla.samples.browser
import android.app.Application
import mozilla.appservices.Megazord
import mozilla.components.browser.session.Session
import mozilla.components.concept.fetch.Client
import mozilla.components.feature.addons.update.GlobalAddonDependencyProvider
......@@ -19,6 +20,7 @@ import mozilla.components.support.base.log.logger.Logger
import mozilla.components.support.base.log.sink.AndroidLogSink
import mozilla.components.support.ktx.android.content.isMainProcess
import mozilla.components.support.ktx.android.content.runOnlyInMainProcess
import mozilla.components.support.rustlog.RustLog
import mozilla.components.support.webextensions.WebExtensionSupport
class SampleApplication : Application() {
......@@ -29,6 +31,9 @@ class SampleApplication : Application() {
override fun onCreate() {
super.onCreate()
Megazord.init()
RustLog.enable()
Log.addSink(AndroidLogSink())
if (!isMainProcess()) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment