@@ -8,6 +8,8 @@ import com.intellij.openapi.application.ApplicationManager
8
8
import com.intellij.openapi.diagnostic.Logger
9
9
import com.intellij.openapi.project.Project
10
10
import com.intellij.ui.JBColor
11
+ import com.tabnineCommon.binary.BinaryRequestFacade
12
+ import com.tabnineCommon.binary.requests.analytics.EventRequest
11
13
import com.tabnineCommon.binary.requests.config.StateRequest
12
14
import com.tabnineCommon.chat.actions.TabnineActionsGroup
13
15
import com.tabnineCommon.config.Config
@@ -25,7 +27,7 @@ import javax.swing.JPanel
25
27
import javax.swing.SwingConstants.CENTER
26
28
import javax.swing.event.HyperlinkEvent
27
29
28
- class ChatFrame (private val project : Project , private val messagesRouter : ChatMessagesRouter ) :
30
+ class ChatFrame (private val project : Project , private val messagesRouter : ChatMessagesRouter , private val binaryRequestFacade : BinaryRequestFacade ) :
29
31
JPanel (true ), Disposable {
30
32
private var capabilitiesFetched = false
31
33
@@ -98,7 +100,7 @@ class ChatFrame(private val project: Project, private val messagesRouter: ChatMe
98
100
ChatBrowser (messagesRouter, project)
99
101
} catch (e: Exception ) {
100
102
Logger .getInstance(javaClass).warn(" Failed to create browser" , e)
101
- displayBrowserNotEnabled ()
103
+ displayBrowserNotAvailable ()
102
104
103
105
return
104
106
}
@@ -120,8 +122,11 @@ class ChatFrame(private val project: Project, private val messagesRouter: ChatMe
120
122
)
121
123
}
122
124
123
- private fun displayBrowserNotEnabled () {
125
+ private fun displayBrowserNotAvailable () {
124
126
val action = ActionManager .getInstance().getAction(" ChooseRuntime" )
127
+
128
+ binaryRequestFacade.executeRequest(EventRequest (" chat-browser-not-available" , mapOf (" choose-runtime-available" to (action != null ).toString())))
129
+
125
130
val imgsrc = javaClass.classLoader.getResource(" images/choose-runtime-with-jcef.png" )?.toString()
126
131
val chooseRuntimePostfix = """
127
132
<p>This issue may arise if your IDE is running on a Java runtime that does not support<br/>the Java Chromium Embedded Framework (JCEF).</p>
@@ -147,6 +152,7 @@ class ChatFrame(private val project: Project, private val messagesRouter: ChatMe
147
152
}
148
153
text.addHyperlinkListener {
149
154
if (it.eventType == HyperlinkEvent .EventType .ACTIVATED ) {
155
+ binaryRequestFacade.executeRequest(EventRequest (" chat-choose-runtime-clicked" , emptyMap()))
150
156
action?.actionPerformed(AnActionEvent .createFromInputEvent(null , " TabnineChatFrame" , null , DataManager .getInstance().getDataContext(text)))
151
157
}
152
158
}
0 commit comments