Commit ad413819 authored by Marcin Wiacek's avatar Marcin Wiacek Committed by Commit Bot

Fix cutting off list of sites in Settings->SiteSettings->(category)

Bug was added with https://chromium-review.googlesource.com/c/chromium/src/+/1195373.

Currently: there is displayed maximally one site on exception list in every Settings->SiteSettings->(category) screen. It happens because of return which is ending not only internal for, but also external one.

With fix: there are displayed all sites.

BUG=887595

Change-Id: I924f7a6955134f9a18976c6dbab201e8b404432c
Reviewed-on: https://chromium-review.googlesource.com/c/1266395Reviewed-by: default avatarFinnur Thorarinsson <finnur@chromium.org>
Commit-Queue: Marcin Wiącek <marcin@mwiacek.com>
Cr-Commit-Position: refs/heads/master@{#597622}
parent 7fc8f939
......@@ -234,6 +234,17 @@ public class WebsitePermissionsFetcher {
}
private void setException(int contentSettingsType) {
@ContentSettingException.Type
int exceptionType;
for (exceptionType = 0; exceptionType < ContentSettingException.Type.NUM_ENTRIES;
exceptionType++) {
if (contentSettingsType == ContentSettingException.CONTENT_TYPES[exceptionType]) break;
}
assert contentSettingsType
== ContentSettingException.CONTENT_TYPES[exceptionType]
: "Unexpected content setting type received: "
+ contentSettingsType;
for (ContentSettingException exception :
WebsitePreferenceBridge.getContentSettingsExceptions(contentSettingsType)) {
// The pattern "*" represents the default setting, not a specific website.
......@@ -241,13 +252,7 @@ public class WebsitePermissionsFetcher {
WebsiteAddress address = WebsiteAddress.create(exception.getPattern());
if (address == null) continue;
Website site = findOrCreateSite(address, null);
for (int i = 0; i < ContentSettingException.CONTENT_TYPES.length; i++) {
if (contentSettingsType == ContentSettingException.CONTENT_TYPES[i]) {
site.setContentSettingException(i, exception);
return;
}
}
assert false : "Unexpected content setting type received: " + contentSettingsType;
site.setContentSettingException(exceptionType, exception);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment