blob: 0389cb4613acafc070a14e3ec5c644ad63a81b0e [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/generic_sensor/sensor_permission_context.h"
SensorPermissionContext::SensorPermissionContext(Profile* profile)
: PermissionContextBase(profile,
CONTENT_SETTINGS_TYPE_SENSORS,
blink::WebFeaturePolicyFeature::kNotFound) {}
SensorPermissionContext::~SensorPermissionContext() {}
ContentSetting SensorPermissionContext::GetPermissionStatusInternal(
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
const GURL& embedding_origin) const {
if (requesting_origin != embedding_origin)
return CONTENT_SETTING_BLOCK;
return CONTENT_SETTING_ALLOW;
}
bool SensorPermissionContext::IsRestrictedToSecureOrigins() const {
return true;
}