mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-06 09:05:45 +00:00
d7f1de6d04
This patch transforms RestrictedProfiles to delegate isAllowed() and canLoadUrl() calls to an object implementing the RestrictionConfiguration interface. DefaultConfiguration, GuestProfileConfiguration and RestrictedProfileConfiguration are implementing RestrictionConfiguration and will take care of handling the restrictions for the different types of profiles. --HG-- extra : commitid : LQ2YsdyG6oR extra : rebase_source : 015f7f02c6e7fded16d3811a71f0ae23547e5f71
28 lines
806 B
Java
28 lines
806 B
Java
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
package org.mozilla.gecko.restrictions;
|
|
|
|
/**
|
|
* Default implementation of RestrictionConfiguration interface. Used whenever no restrictions are enforced for the
|
|
* current profile.
|
|
*/
|
|
public class DefaultConfiguration implements RestrictionConfiguration {
|
|
@Override
|
|
public boolean isAllowed(Restriction restriction) {
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public boolean canLoadUrl(String url) {
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public boolean isRestricted() {
|
|
return false;
|
|
}
|
|
}
|