Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
For #12151 - Fix ktlint issues for GeckoPromptDelegate.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandru2909 committed Sep 22, 2022
1 parent 1195e3c commit e489e99
Show file tree
Hide file tree
Showing 2 changed files with 215 additions and 174 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -431,15 +431,15 @@ internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSe
onClear,
format,
onConfirm,
onDismiss
onDismiss,
)

return geckoResult
}

override fun onAuthPrompt(
session: GeckoSession,
geckoPrompt: PromptDelegate.AuthPrompt
geckoPrompt: PromptDelegate.AuthPrompt,
): GeckoResult<PromptResponse>? {
val geckoResult = GeckoResult<PromptResponse>()
val title = geckoPrompt.title ?: ""
Expand Down Expand Up @@ -482,16 +482,16 @@ internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSe
previousFailed,
isCrossOrigin,
onConfirm,
onDismiss
)
onDismiss,
),
)
}
return geckoResult
}

override fun onTextPrompt(
session: GeckoSession,
prompt: PromptDelegate.TextPrompt
prompt: PromptDelegate.TextPrompt,
): GeckoResult<PromptResponse>? {
val geckoResult = GeckoResult<PromptResponse>()
val title = prompt.title ?: ""
Expand All @@ -512,8 +512,8 @@ internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSe
inputValue,
false,
onConfirm,
onDismiss
)
onDismiss,
),
)
}

Expand All @@ -522,7 +522,7 @@ internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSe

override fun onColorPrompt(
session: GeckoSession,
prompt: PromptDelegate.ColorPrompt
prompt: PromptDelegate.ColorPrompt,
): GeckoResult<PromptResponse>? {
val geckoResult = GeckoResult<PromptResponse>()
val onConfirm: (String) -> Unit = {
Expand All @@ -536,15 +536,15 @@ internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSe

geckoEngineSession.notifyObservers {
onPromptRequest(
PromptRequest.Color(defaultColor, onConfirm, onDismiss)
PromptRequest.Color(defaultColor, onConfirm, onDismiss),
)
}
return geckoResult
}

override fun onPopupPrompt(
session: GeckoSession,
prompt: PromptDelegate.PopupPrompt
prompt: PromptDelegate.PopupPrompt,
): GeckoResult<PromptResponse> {
val geckoResult = GeckoResult<PromptResponse>()
val onAllow: () -> Unit = {
Expand All @@ -560,15 +560,15 @@ internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSe

geckoEngineSession.notifyObservers {
onPromptRequest(
PromptRequest.Popup(prompt.targetUri ?: "", onAllow, onDeny)
PromptRequest.Popup(prompt.targetUri ?: "", onAllow, onDeny),
)
}
return geckoResult
}

override fun onBeforeUnloadPrompt(
session: GeckoSession,
geckoPrompt: BeforeUnloadPrompt
geckoPrompt: BeforeUnloadPrompt,
): GeckoResult<PromptResponse>? {
val geckoResult = GeckoResult<PromptResponse>()
val title = geckoPrompt.title ?: ""
Expand All @@ -593,7 +593,7 @@ internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSe

override fun onSharePrompt(
session: GeckoSession,
prompt: PromptDelegate.SharePrompt
prompt: PromptDelegate.SharePrompt,
): GeckoResult<PromptResponse> {
val geckoResult = GeckoResult<PromptResponse>()
val onSuccess = {
Expand All @@ -614,20 +614,20 @@ internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSe
ShareData(
title = prompt.title,
text = prompt.text,
url = prompt.uri
url = prompt.uri,
),
onSuccess,
onFailure,
onDismiss
)
onDismiss,
),
)
}
return geckoResult
}

override fun onButtonPrompt(
session: GeckoSession,
prompt: PromptDelegate.ButtonPrompt
prompt: PromptDelegate.ButtonPrompt,
): GeckoResult<PromptResponse>? {
val geckoResult = GeckoResult<PromptResponse>()
val title = prompt.title ?: ""
Expand Down Expand Up @@ -657,18 +657,18 @@ internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSe
"",
onConfirmPositiveButton,
onConfirmNegativeButton,
onDismiss
onDismiss,
) {
onDismiss(false)
}
},
)
}
return geckoResult
}

override fun onRepostConfirmPrompt(
session: GeckoSession,
prompt: PromptDelegate.RepostConfirmPrompt
prompt: PromptDelegate.RepostConfirmPrompt,
): GeckoResult<PromptResponse>? {
val geckoResult = GeckoResult<PromptResponse>()

Expand All @@ -688,8 +688,8 @@ internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSe
onPromptRequest(
PromptRequest.Repost(
onConfirm,
onCancel
)
onCancel,
),
)
}
return geckoResult
Expand All @@ -705,7 +705,7 @@ internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSe
onClear: () -> Unit,
format: String,
onConfirm: (String) -> Unit,
onDismiss: () -> Unit
onDismiss: () -> Unit,
) {
val initialDate = initialDateString.toDate(format)
val minDate = if (minDateString.isNullOrEmpty()) null else minDateString.toDate()
Expand Down Expand Up @@ -733,8 +733,8 @@ internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSe
selectionType,
onSelect,
onClear,
onDismiss
)
onDismiss,
),
)
}
}
Expand Down
Loading

0 comments on commit e489e99

Please sign in to comment.