Commit 0309b0c3 authored by Francois Beaufort's avatar Francois Beaufort Committed by Commit Bot

[PTZ] Hide page info camera if camera PTZ is granted or blocked

This CL makes sure "camera" in page info UI is hidden when camera PTZ is
granted or blocked, regardless the state of the "Experimental Web
Platform features" switch. This is needed anymore as the
MediaCapturePanTilt feature is now enabled by default.

Bug: 1144253
Change-Id: If212a72c00e4bede8ad1a0ebacb9a306a7d38409
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2516223Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823516}
parent 2ce92611
......@@ -12,7 +12,6 @@
#include <utility>
#include <vector>
#include "base/command_line.h"
#include "base/i18n/time_formatting.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_functions.h"
......@@ -61,7 +60,6 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "net/cert/cert_status_flags.h"
#include "net/cert/x509_certificate.h"
......@@ -181,16 +179,8 @@ bool ShouldShowPermission(const PageInfo::PermissionInfo& info,
return true;
}
// Camera PTZ is shown only if Experimental Web Platform features are enabled.
base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
if (info.type == ContentSettingsType::CAMERA_PAN_TILT_ZOOM &&
!cmd->HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) {
return false;
}
// Hide camera if camera PTZ is granted or blocked.
if (info.type == ContentSettingsType::MEDIASTREAM_CAMERA &&
cmd->HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) {
if (info.type == ContentSettingsType::MEDIASTREAM_CAMERA) {
std::unique_ptr<base::Value> value = content_settings->GetWebsiteSetting(
site_url, site_url, ContentSettingsType::CAMERA_PAN_TILT_ZOOM,
std::string(), nullptr);
......
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