Skip to content

Commit 2ffaa92

Browse files
committed
Bug 1811076: Part 6 - Show a cancelable "slow agent" dialog on slow content analysis r=nika,Gijs,rkraesig,fluent-reviewers,bolsson
This adds a modal dialog to some content analysis use cases that blocks input while CA is running. The dialog can be canceled, which cancels the CA (if possible) and the operation that required it. Differential Revision: https://phabricator.services.mozilla.com/D189578 UltraBlame original commit: 7ca7d7ab66453b81c86545a277ab0fdde9f19171
1 parent 5ad58fd commit 2ffaa92

File tree

12 files changed

+1856
-435
lines changed

12 files changed

+1856
-435
lines changed

browser/components/contentanalysis/content/ContentAnalysis.sys.mjs

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,28 @@ lazy
187187
{
188188
}
189189
;
190+
XPCOMUtils
191+
.
192+
defineLazyServiceGetter
193+
(
194+
lazy
195+
"
196+
gContentAnalysis
197+
"
198+
"
199+
mozilla
200+
.
201+
org
202+
/
203+
contentanalysis
204+
;
205+
1
206+
"
207+
Ci
208+
.
209+
nsIContentAnalysis
210+
)
211+
;
190212
ChromeUtils
191213
.
192214
defineESModuleGetters
@@ -2236,7 +2258,27 @@ aOperation
22362258
)
22372259
{
22382260
return
2239-
false
2261+
!
2262+
(
2263+
aOperation
2264+
=
2265+
=
2266+
Ci
2267+
.
2268+
nsIContentAnalysisRequest
2269+
.
2270+
FILE_DOWNLOADED
2271+
|
2272+
|
2273+
aOperation
2274+
=
2275+
=
2276+
Ci
2277+
.
2278+
nsIContentAnalysisRequest
2279+
.
2280+
PRINT
2281+
)
22402282
;
22412283
}
22422284
/
@@ -2696,6 +2738,12 @@ Ci
26962738
nsIPromptService
26972739
.
26982740
BUTTON_TITLE_CANCEL
2741+
+
2742+
Ci
2743+
.
2744+
nsIPromptService
2745+
.
2746+
SHOW_SPINNER
26992747
null
27002748
null
27012749
null
@@ -2809,6 +2857,15 @@ aRequestToken
28092857
)
28102858
)
28112859
{
2860+
lazy
2861+
.
2862+
gContentAnalysis
2863+
.
2864+
cancelContentAnalysisRequest
2865+
(
2866+
aRequestToken
2867+
)
2868+
;
28122869
let
28132870
dlpBusyView
28142871
=

netwerk/base/nsIPrompt.idl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,16 @@ BUTTON_DELAY_ENABLE
207207
const
208208
unsigned
209209
long
210+
SHOW_SPINNER
211+
=
212+
1
213+
<
214+
<
215+
27
216+
;
217+
const
218+
unsigned
219+
long
210220
STD_OK_CANCEL_BUTTONS
211221
=
212222
(

0 commit comments

Comments
 (0)