DescriptionMake the download request limiter listen to content settings changes.
The download request limiter persists the automatic downloads content
setting per origin. This indicates which sites users have allowed to
trigger multiple automatic downloads.
However, the limiter does not respect changes made to the content
setting via the OIB or content settings pages. This means that the user
can change the content settings (e.g. accidentally allowed the
permission, visit OIB to revoke permission), but the limiter will not
change its internal state to match the new setting. In this case, the
limiter will continue to allow all downloads, even after reloading the
page.
This CL fixes the bug by making the limiter listen to the
NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED notification, updating its
internal state when the automatic downloads setting has been changed.
Unit tests are also added to ensure the correct behaviour.
BUG=584146
TEST=Changing automatic downloads permissions in the OIB or in content
settings will be applied on page reload.
Committed: https://crrev.com/8aea480299a0b812aa3705d9a7c84d811ed075ef
Cr-Commit-Position: refs/heads/master@{#375396}
Patch Set 1 #Patch Set 2 : Rebase #
Total comments: 6
Patch Set 3 : Address reviewer comments #
Dependent Patchsets: Messages
Total messages: 13 (6 generated)
|