Commit 944806b2 authored by MozLando's avatar MozLando
Browse files

Merge #4267



4267: Use UUID for custom tab config ID in PWA r=jonalmeida a=NotWoods



Co-authored-by: default avatarTiger Oakes <toakes@mozilla.com>
parents 198f576c 049a4250
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ import mozilla.components.browser.state.state.CustomTabMenuItem
import mozilla.components.support.utils.SafeIntent
import mozilla.components.support.utils.toSafeBundle
import mozilla.components.support.utils.toSafeIntent
import java.util.UUID
import kotlin.math.max

/**
@@ -88,7 +87,6 @@ fun createCustomTabConfigFromIntent(
    val safeIntent = intent.toSafeIntent()

    return CustomTabConfig(
        id = UUID.randomUUID().toString(),
        toolbarColor = safeIntent.getColorExtra(EXTRA_TOOLBAR_COLOR),
        navigationBarColor = safeIntent.getColorExtra(EXTRA_NAVIGATION_BAR_COLOR),
        closeButtonIcon = getCloseButtonIcon(safeIntent, resources),
+0 −1
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ fun WebAppManifest.toTaskDescription(icon: Bitmap?) =
 */
fun WebAppManifest.toCustomTabConfig() =
    CustomTabConfig(
        id = startUrl,
        toolbarColor = themeColor,
        navigationBarColor = backgroundColor?.let {
            if (isDark(it)) Color.BLACK else Color.WHITE
+0 −1
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ class WebAppManifestKtTest {
            themeColor = rgb(255, 0, 255),
            backgroundColor = rgb(230, 230, 230)
        ).toCustomTabConfig()
        assertEquals("https://example.com", config.id)
        assertEquals(rgb(255, 0, 255), config.toolbarColor)
        assertEquals(Color.WHITE, config.navigationBarColor)
        assertNull(config.closeButtonIcon)