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

Unified Diff: chrome/browser/bluetooth/bluetooth_permission_context_factory.cc

Issue 1706503002: Add enterprise policy to turn off Bluetooth. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Sync 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/bluetooth/bluetooth_permission_context_factory.cc
diff --git a/chrome/browser/bluetooth/bluetooth_permission_context_factory.cc b/chrome/browser/bluetooth/bluetooth_permission_context_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8cd2c7de1e666cfd30e78aa3c2486acf5912ad84
--- /dev/null
+++ b/chrome/browser/bluetooth/bluetooth_permission_context_factory.cc
@@ -0,0 +1,34 @@
+// Copyright 2016 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/bluetooth/bluetooth_permission_context_factory.h"
+
+#include "chrome/browser/bluetooth/bluetooth_permission_context.h"
+#include "chrome/browser/profiles/profile.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+
+BluetoothPermissionContextFactory::BluetoothPermissionContextFactory()
+ : PermissionContextFactoryBase(
+ "BluetoothPermissionContext",
+ BrowserContextDependencyManager::GetInstance()) {}
+
+BluetoothPermissionContextFactory::~BluetoothPermissionContextFactory() {}
+
+// static
+BluetoothPermissionContextFactory*
+BluetoothPermissionContextFactory::GetInstance() {
+ return base::Singleton<BluetoothPermissionContextFactory>::get();
+}
+
+// static
+BluetoothPermissionContext* BluetoothPermissionContextFactory::GetForProfile(
+ Profile* profile) {
+ return static_cast<BluetoothPermissionContext*>(
+ GetInstance()->GetServiceForBrowserContext(profile, true));
+}
+
+KeyedService* BluetoothPermissionContextFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ return new BluetoothPermissionContext(Profile::FromBrowserContext(context));
+}

Powered by Google App Engine
This is Rietveld 408576698