Skip to content

Commit

Permalink
WIP focus debugging logs
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiccooney committed Jul 30, 2024
1 parent 65f881c commit 62fdae4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/kotlin/com/sourcegraph/cody/ui/CodyToolWindowFactory.kt
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,19 @@ class WebUIProxy(private val host: WebUIHost, private val browser: JBCefBrowserB
setEnableOpenDevToolsMenuItem(true)
}
.build()

browser.jbCefClient.addFocusHandler(object : CefFocusHandlerAdapter() {
override fun onGotFocus(browser: CefBrowser) {
println("onGotFocus $browser")
}

override fun onSetFocus(browser: CefBrowser, source: CefFocusHandler.FocusSource): Boolean {
val x = super.onSetFocus(browser, source)
println("onSetFocus $browser $x")
return x
}
}, browser.cefBrowser)

val proxy = WebUIProxy(host, browser)

val viewToHost =
Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/com/sourcegraph/cody/ui/WebPanelProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ import javax.swing.JLabel
class WebPanelEditor(private val file: VirtualFile) : FileEditor {
companion object {
val WEB_UI_PROXY_KEY = Key.create<WebUIProxy>("WebUIProxy")

var epoch = 0
}

val age = epoch++
private val userData: MutableMap<Any, Any?> = mutableMapOf()

override fun <T : Any?> getUserData(key: Key<T>): T? {
Expand Down

0 comments on commit 62fdae4

Please sign in to comment.