Commit Graph

52 Commits

Author SHA1 Message Date
Greg Stoll
187eb94796 Bug 1951414 - fix confirmation dialog when quitting while Content Analysis requests are active r=dlp-reviewers,handyman
I broke this in bug 1928064 when I refactored a bunch of the JS code.

Differential Revision: https://phabricator.services.mozilla.com/D240189
2025-03-03 17:43:46 +00:00
David P
ff715e46d1 Bug 1950501: Ignore browser.contentanalysis.show_blocked_dialog for non-agent messages r=dlp-reviewers,gstoll
Messages not from an agent can't have been shown by an agent, so ignore the pref for them.

Differential Revision: https://phabricator.services.mozilla.com/D239825
2025-02-27 00:31:50 +00:00
Greg Stoll
54ae391135 Bug 1950615 - show "unable to connect" Content Analysis dialog in all cases r=dlp-reviewers,handyman
I verified that this fixes the problem in this bug and does not regress
bug 1928064.

The problem was that if only one request was being made with the same
user action ID, the otherEntries would always be empty, and so we would
not show the dialog. Now we handle multiple requests by removing their
info from requestTokenToRequestInfo, and thus when we get the
"dlp-request-made" notification we will exit early and not show a dialog.

Differential Revision: https://phabricator.services.mozilla.com/D239755
2025-02-26 18:57:29 +00:00
Greg Stoll
be00c74732 Bug 1948884 - make Content Analysis icon show up with vertical tabs r=desktop-theme-reviewers,sfoster
Differential Revision: https://phabricator.services.mozilla.com/D238669
2025-02-25 20:21:52 +00:00
Greg Stoll
8d790dc2c5 Bug 1928064 part 3 - don't show multiple error dialogs for the same userActionId r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D239398
2025-02-25 01:33:01 +00:00
Greg Stoll
97c001a20c Bug 1928064 part 2 - simplify MapByTopBrowsingContext to RequestInfos r=dlp-reviewers,handyman
We are no longer using the grouping by BrowsingContext functionality,
so rename and greatly simplify this class. (not strictly needed for this
change, but simpler is better!)

Differential Revision: https://phabricator.services.mozilla.com/D239397
2025-02-25 01:33:00 +00:00
David P
b9cdd727a8 Bug 1894538: Part 2 - Cancel content analysis requests on timeout r=dlp-reviewers,fluent-reviewers,flod,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D237661
2025-02-18 20:02:43 +00:00
David P
469f02dde1 Bug 1936020: Part 7 - Refactor ContentAnalysis C++ and IDL classes r=dlp-reviewers,gstoll
The changes include:
1. Making various IDL classes builtin.
2. Making nsIContentAnalysisResponse subclass nsIContentAnalysisResult.
3. Making requestToken and userAction fields internal to CA service.
4. Added sourceWindowGlobal (the source of the data to scan) to request and
   use it for content-source-is-same-tab determinations.
5. Made nsIContentAnalysisCallback expect a Result, not a Response.
6. Added cancelRequestsByUserAction and renamed cancelContentAnalysisRequest to cancelRequestsByRequestToken (deprecated).
7. Added ability for CancelAllRequests to forbid future requests (not needed but for peace of mind).
8. Added MakeResponseForTest since response is not builtin.
9. Made ContentAnalysis SupportsWeakPtr so that it can be weakly held by the MultipartRequestCallback,
   which can't just re-get the service since it doesn't want the mock one.
10. Move SafeContentAnalysisResultCallback functionality to ContentAnalysisCallback.
11. Make various routines use userActionId instead of requestToken.
12. Add MultipartRequestCallback to count that we get the right number of responses.
13. Remove unneeded thread sync behavior.  The only part that was kind-of
    neeed was to abort behavior on a background thread if the request were
    canceled first -- this is a race that we don't need to win so we now just
    ignore it and ignore the result (TODO: I'm not positive I send cancel to
    the agent in this case).
14. Send cancel to the agent (in all other cancel cases).
15. Simplify the request map, which is now the user action map mUserActionMap.
16. Makes the MultipartRequestCallback the nexus for filtering requests --
    this way filters are applied uniformly instead of sometimes-at-some-point-
    for-some-use-cases.
17. Adds showBlockedRequestDialog for showing a block dialog when requests
    are rejected before they are expanded into their final form.
18. Adds SafeGetStaticErrorName for logging nsresults.

Differential Revision: https://phabricator.services.mozilla.com/D236630
2025-02-13 19:19:17 +00:00
David P
2af003235e Bug 1936020: Part 4 - Fix contentanalysis.sys.mjs typo r=dlp-reviewers,gstoll
Rename "request" variable that is a response to "response".

Differential Revision: https://phabricator.services.mozilla.com/D236627
2025-02-13 19:19:16 +00:00
Greg Stoll
30b5ca4b60 Bug 1926362 - make cancelling a DLP request actually cancel with the DLP agent r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D231145
2024-12-06 14:41:37 +00:00
David P
acd7b80652 Bug 1929636: Improve content analysis paste-blocked and warn dialogs when agent is not connected r=dlp-reviewers,gstoll
When the DLP agent can't be reached, we enact default DLP behavior based on the
browser.contentanalysis.default_result pref.  That still shows result dialogs
for pastes, and when default-warn is enabled, and the messages used for those
when the agent *is* connected would confuse the user here.  This changes those
messages.

Differential Revision: https://phabricator.services.mozilla.com/D228233
2024-11-07 17:46:02 +00:00
Greg Stoll
c9025fc7e5 Bug 1915351 part 6 - make Content Analysis JS display multiple dialogs seamlessly r=dlp-reviewers,handyman
This uses the already-existing ability of the TabDialogManager to show
a dialog immediately after the previous one closes. So this code doesn't
need to keep track of what dialog to show next - it just displays them
all (and closes them appropriately), and the TabDialogManager will show
them one at a time.

Differential Revision: https://phabricator.services.mozilla.com/D223415
2024-10-28 22:37:58 +00:00
Alexandru Marc
0633abca1a Backed out 10 changesets (bug 1879401, bug 1915351) for causing multiple regressions. CLOSED TREE
Backed out changeset 574d567bbbf1 (bug 1915351)
Backed out changeset 4fcb7eea243f (bug 1915351)
Backed out changeset aa0e2ce8cf21 (bug 1915351)
Backed out changeset 1cf3847d73a7 (bug 1915351)
Backed out changeset fba6942240ea (bug 1915351)
Backed out changeset c5279472391f (bug 1915351)
Backed out changeset a20adf8d4516 (bug 1915351)
Backed out changeset 2b900eb520ce (bug 1915351)
Backed out changeset a8b2b1f62ae6 (bug 1915351)
Backed out changeset 989b843531f8 (bug 1879401)
2024-10-25 16:43:29 +03:00
Greg Stoll
e66bb15ca2 Bug 1915351 part 6 - make Content Analysis JS display multiple dialogs seamlessly r=dlp-reviewers,handyman
This uses the already-existing ability of the TabDialogManager to show
a dialog immediately after the previous one closes. So this code doesn't
need to keep track of what dialog to show next - it just displays them
all (and closes them appropriately), and the TabDialogManager will show
them one at a time.

Differential Revision: https://phabricator.services.mozilla.com/D223415
2024-10-24 02:15:14 +00:00
Greg Stoll
575789c7d8 Bug 1921079 - make DLP agent name bold in panel r=dlp-reviewers,fluent-reviewers,handyman
I tried this for the hover text as well but unsurprisingly bold text
isn't styled any differently there.

Differential Revision: https://phabricator.services.mozilla.com/D225856
2024-10-18 19:30:29 +00:00
Greg Stoll
8761987491 Bug 1912384 part 2 - don't show dialog for cached DLP results r=dlp-reviewers,handyman
For BLOCKED text, if we do two requests in quick succession, we will now
return a cached result for the second request. This patch avoids showing
the BLOCK dialog more than once. (also works for WARN)

Differential Revision: https://phabricator.services.mozilla.com/D219496
2024-08-22 13:15:36 +00:00
Gijs Kruitbosch
a6f6ff1c9a Bug 1896783 - start using the category manager for browser delayed startup, r=mossop,webcompat-reviewers,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D210433
2024-08-14 13:10:41 +00:00
Greg Stoll
6e33f54294 Bug 1902969 - cancel DLP request when warn dialog is moved to new window r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D213998
2024-06-28 19:01:05 +00:00
Greg Stoll
5d5b96fb12 Bug 1900798 - go back to async "DLP blocked" dialog for print preview r=dlp-reviewers,handyman
A new attempt to fix these problems - always use asynchronous dialogs, but in the print preview case show the "DLP blocked" dialog on the original browsingContext that displayed the print preview dialog (since the dialog itself is about to close)

Differential Revision: https://phabricator.services.mozilla.com/D212815
2024-06-12 19:39:15 +00:00
Greg Stoll
1981579755 Bug 1899703, 1899971 - don't shutdownhang when quitting while DLP request is active r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D212474
2024-06-05 14:05:56 +00:00
Greg Stoll
0ed79d0d07 Bug 1899714 - make DLP block dialog show up again for print preview window r=dlp-reviewers,handyman
I verified that quitting while the synchronous version of the dialog is active doesn't hang, so we're not re-regressing bug 1898718.

Differential Revision: https://phabricator.services.mozilla.com/D212189
2024-06-04 23:03:52 +00:00
Greg Stoll
6bdae479cd Bug 1898718 - show DLP response dialog asynchronously so it doesn't block shutdown r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D211870
2024-05-29 18:11:37 +00:00
Greg Stoll
4bcafcb40b Bug 1893536 - Use more natural wording for Content Analysis error messages r=dlp-reviewers,fluent-reviewers,bolsson,handyman
Differential Revision: https://phabricator.services.mozilla.com/D208678
2024-04-27 10:44:51 +00:00
Greg Stoll
230709d6c4 Bug 1893497 - Remove unneeded await on l10n.setAttributes in ContentAnalysis.sys.mjs r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D208658
2024-04-25 22:53:26 +00:00
Hanna Jones
21849b1def Bug 1803678 - enable lazy loading of ESModule based moz- custom elements r=reusable-components-reviewers,pip-reviewers,credential-management-reviewers,translations-reviewers,kpatenio,issammani,mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D207445
2024-04-24 19:16:46 +00:00
Stanca Serban
29d6ee2faf Backed out changeset 58e1e96263b7 (bug 1803678) mochitests failures in test_confirm_delete_dialog.html. CLOSED TREE 2024-04-24 03:14:45 +03:00
Hanna Jones
9413513b0d Bug 1803678 - enable lazy loading of ESModule based moz- custom elements r=reusable-components-reviewers,pip-reviewers,credential-management-reviewers,translations-reviewers,kpatenio,issammani,mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D207445
2024-04-23 19:28:47 +00:00
Aron Cseh
08943f7f60 Backed out changeset 421fd8a0360c (bug 1803678) for causing mochitest failures on browser_translations_select_panel_init_failure.js CLOSED TREE 2024-04-23 18:16:55 +03:00
Hanna Jones
cf0399a238 Bug 1803678 - enable lazy loading of ESModule based moz- custom elements r=reusable-components-reviewers,pip-reviewers,credential-management-reviewers,translations-reviewers,kpatenio,issammani,mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D207445
2024-04-23 13:52:27 +00:00
Greg Stoll
001f5dd92d Bug 1879149 - UX improvements for DLP block dialog and warn dialog r=dlp-reviewers,fluent-reviewers,bolsson,handyman
- Make the block dialog modal (instead of an OS notification) and use UX strings
- Make the warn dialog not have a default choice on it

Differential Revision: https://phabricator.services.mozilla.com/D206813
2024-04-16 13:10:03 +00:00
Greg Stoll
8a34220acd Bug 1878700 part 2 - show DLP icon in toolbar when content analysis is active r=handyman,desktop-theme-reviewers,fluent-reviewers,emilio,bolsson,Gijs
This also opens SUMO when the icon is clicked on. (the real page will be made as a part of bug 1882595)

Differential Revision: https://phabricator.services.mozilla.com/D203686
2024-04-15 14:25:53 +00:00
Greg Stoll
1a4633232d Bug 1875481 - Part 3: Add content analysis support to printing operations r=handyman,spohl,fluent-reviewers,kpatenio,smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D200979
2024-04-10 00:15:47 +00:00
Stanca Serban
4c0f6b30c1 Backed out 3 changesets (bug 1875481) for basicWindowDotPrintTest related junit failures.
Backed out changeset cd024cb2768e (bug 1875481)
Backed out changeset 6b7be15cd017 (bug 1875481)
Backed out changeset d1da53c0673b (bug 1875481)
2024-04-09 05:56:47 +03:00
Greg Stoll
77cb63d2a3 Bug 1875481 - Part 3: Add content analysis support to printing operations r=handyman,spohl,fluent-reviewers,kpatenio,smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D200979
2024-04-08 23:53:58 +00:00
Greg Stoll
4b6721833e Bug 1888259 - Show a notification when a Content Analysis request is denied for lack of an agent connection r=dlp-reviewers,fluent-reviewers,handyman
Note that this also covers the case when the connection initially succeeds but then the agent goes away - we hope to handle this better in bug 1888293. This also shows a message if the signature verification fails.

Differential Revision: https://phabricator.services.mozilla.com/D206024
2024-04-02 11:53:40 +00:00
Greg Stoll
2a8fe926e0 Bug 1882603 - don't show Content Analysis Block result if pref is set r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D205153
2024-03-20 17:35:26 +00:00
Dave Townsend
a0c83bc943 Bug 1864896: Autofix unused function arguments (browser). r=webcompat-reviewers,mconley,fxview-reviewers,desktop-theme-reviewers,omc-reviewers,migration-reviewers,twisniewski,aminomancer,dao,sclements,firefox-desktop-core-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D203005
2024-03-19 09:36:35 +00:00
Greg Stoll
748f318387 Bug 1879152 - Add confirmation dialog on quit when DLP requests are pending r=handyman,fluent-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D201154
2024-03-07 17:50:07 +00:00
Cosmin Sabou
216033805e Backed out changeset 62ed755b7c5e (bug 1879152) for bc failures on browser_all_files_referenced. 2024-03-07 06:09:47 +02:00
Greg Stoll
0992e51892 Bug 1879152 - Add confirmation dialog on quit when DLP requests are pending r=handyman,fluent-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D201154
2024-03-07 03:19:09 +00:00
Sandor Molnar
78888fed61 Backed out changeset 5156f24f97bf (bug 1879152) for causing bc failures @ en-US/toolkit/contentanalysis/contentanalysis CLOSED TREE 2024-03-07 04:24:43 +02:00
Greg Stoll
c681600c16 Bug 1879152 - Add confirmation dialog on quit when DLP requests are pending r=handyman,fluent-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D201154
2024-03-07 01:43:17 +00:00
Greg Stoll
62ef9ea396 Bug 1878701 - Part 3: Use UX-suggested text for the DLP agent busy dialog r=handyman,fluent-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D200729
2024-02-21 22:59:53 +00:00
Greg Stoll
7f0ba0ee01 Bug 1878701 - Part 2: Make DLP busy dialog have a gray Cancel button r=handyman,Gijs,reusable-components-reviewers,mstriemer
This changes CommonDialog to allow having a button 1 (which is styled
like Cancel) without a button 0. (which is styled like OK)

Differential Revision: https://phabricator.services.mozilla.com/D200728
2024-02-21 22:59:53 +00:00
Cristian Tuns
a1e335952f Backed out 3 changesets (bug 1878701) for causing remote failures in browser_PromptListener.js CLOSED TREE
Backed out changeset 2e05063bf9de (bug 1878701)
Backed out changeset 675a4ee7708c (bug 1878701)
Backed out changeset 2db4b9283ba5 (bug 1878701)
2024-02-14 16:26:16 -05:00
Greg Stoll
50cbcdbbca Bug 1878701 - Part 3: Use UX-suggested text for the DLP agent busy dialog r=handyman,fluent-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D200729
2024-02-14 18:25:13 +00:00
Greg Stoll
877a45c2b5 Bug 1878701 - Part 2: Make DLP busy dialog have a gray Cancel button r=handyman,Gijs
This changes CommonDialog to allow having a button 1 (which is styled
like Cancel) without a button 0. (which is styled like OK)

Differential Revision: https://phabricator.services.mozilla.com/D200728
2024-02-14 18:25:13 +00:00
Greg Stoll
b7eef69b9f Bug 1871187: prompt() goes through content analysis r=Gijs
Adds another text-paste case to content analysis, this time for the
prompt() command, which is not covered by the other clipboard cases
in bug 1871135.

Differential Revision: https://phabricator.services.mozilla.com/D197018
2024-01-09 13:53:31 +00:00
Greg Stoll
8fe8524043 Bug 1811076: Part 8 - Show content analysis WARN dialog and let user to choose allow/deny r=Gijs,fluent-reviewers,flod,rkraesig
If a WARN response is returned from the content analysis agent, the browser displays a dialog box and lets the user choose whether to allow or deny the content.

Differential Revision: https://phabricator.services.mozilla.com/D189581
2023-12-18 20:19:53 +00:00
Greg Stoll
1c0872151e 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
2023-12-08 17:48:31 +00:00