Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 1706503002: Add enterprise policy to turn off Bluetooth. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Fix nits Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index b85bffd4f607d443c7ec415e9501b7435d365165..3e884bb11b7b4f72fe1d410d8bbce349972e3277 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -110,6 +110,7 @@
#include "components/content_settings/core/browser/cookie_settings.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings.h"
+#include "components/content_settings/core/common/content_settings_types.h"
#include "components/data_reduction_proxy/content/browser/data_reduction_proxy_message_filter.h"
#include "components/dom_distiller/core/dom_distiller_switches.h"
#include "components/dom_distiller/core/url_constants.h"
@@ -163,6 +164,8 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/resources/grit/ui_resources.h"
+#include "url/gurl.h"
+#include "url/origin.h"
#if defined(OS_WIN)
#include "base/strings/string_tokenizer.h"
@@ -1988,6 +1991,21 @@ bool ChromeContentBrowserClient::AllowKeygen(
CONTENT_SETTING_ALLOW;
}
+bool ChromeContentBrowserClient::AllowWebBluetooth(
+ content::BrowserContext* browser_context,
+ const url::Origin& requesting_origin,
+ const url::Origin& embedding_origin) {
+ const HostContentSettingsMap* const content_settings =
+ HostContentSettingsMapFactory::GetForProfile(
+ Profile::FromBrowserContext(browser_context));
+
+ return content_settings->GetContentSetting(
+ GURL(requesting_origin.Serialize()),
+ GURL(embedding_origin.Serialize()),
+ CONTENT_SETTINGS_TYPE_BLUETOOTH_GUARD,
+ std::string()) != CONTENT_SETTING_BLOCK;
+}
+
net::URLRequestContext*
ChromeContentBrowserClient::OverrideRequestContextForURL(
const GURL& url, content::ResourceContext* context) {
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/policy/configuration_policy_handler_list_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698