Skip to content

Commit 3da0dcb

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 1a20206 commit 3da0dcb

File tree

12 files changed

+2081
-500
lines changed

12 files changed

+2081
-500
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
@@ -401,6 +401,16 @@ BUTTON_DELAY_ENABLE
401401
const
402402
unsigned
403403
long
404+
SHOW_SPINNER
405+
=
406+
1
407+
<
408+
<
409+
27
410+
;
411+
const
412+
unsigned
413+
long
404414
STD_OK_CANCEL_BUTTONS
405415
=
406416
(

0 commit comments

Comments
 (0)