gecko-dev/mobile/android/base/restrictions/DefaultConfiguration.java
Sebastian Kaspari d7f1de6d04 Bug 1187260 - Simplify RestrictedProfiles class. r=ally
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
2015-07-24 19:47:31 +02:00

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;
}
}