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

Issue 1706503002: Add enterprise policy to turn off Bluetooth. (Closed)

Created:
4 years, 10 months ago by Jeffrey Yasskin
Modified:
4 years, 10 months ago
CC:
asvitkine+watch_chromium.org, blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, jam, jochen+watch_chromium.org, juncai, kcarattini, markusheintz_, mkwst+moarreviews-shell_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-test-runner_chromium.org, mlamouri+watch-permissions_chromium.org, msramek+watch_chromium.org, ortuno+watch_chromium.org, Peter Beverloo, raymes+watch_chromium.org, scheib+watch_chromium.org, tnagel+watch_chromium.org, raymes, mlamouri (slow - plz ping), Reilly Grant (use Gerrit)
Base URL:
https://chromium.googlesource.com/chromium/src.git@lkcr
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add enterprise policy to turn off Web Bluetooth. Organizations will be able to set "DefaultWebBluetoothGuardSetting" to '2' to prevent their users from using Web Bluetooth at all, or '3' to explicitly leave the setting at the default "ask" value. There is no "allow" option, because it wouldn't specify which device to select from the chooser. BUG=562592 TEST=On ChromeOS, Android, Mac, and Windows 8.1, run the following steps with 3 different enterprise policy settings. Note that the test machine needs Bluetooth 4 support, and Bluetooth has to be turned on. If it's not, you'll get a "Bluetooth adapter not available." error, and won't have tested this patch. 1) Run chrome with the --enable-web-bluetooth flag. 2) Visit https://googlechrome.github.io/samples/web-bluetooth/device-info.html 3) Type "Test" into the "Device Name Prefix" text box (the third). 4) Press the "Get Bluetooth Device Info" button. Enterprise policy A: 'DefaultWebBluetoothGuardSetting' unset. A dialog saying "https://googlechrome.github.io wants to pair with" should appear. Click 'Cancel' or outside the dialog to close it. Enterprise policy B: 'DefaultWebBluetoothGuardSetting' set to 2. No dialog appears, and the "Live Output" box says "Argh! NotFoundError: User or their enterprise policy has disabled Web Bluetooth globally." Enterprise policy C: 'DefaultWebBluetoothGuardSetting' set to 3. A dialog saying "https://googlechrome.github.io wants to pair with" should appear. Click 'Cancel' or outside the dialog to close it. Committed: https://crrev.com/98bdd399e51a63f104421344e79a1e838d00fcdc Cr-Commit-Position: refs/heads/master@{#377959}

Patch Set 1 : Sync #

Patch Set 2 : Rename the Bluetooth content setting to "Bluetooth Guard" #

Patch Set 3 : Sync #

Patch Set 4 : Fix aw_permission_manager.cc #

Patch Set 5 : Load the policy on all OSes #

Patch Set 6 : Remove the DefaultWebBluetoothGuardSetting indicator_tests. #

Patch Set 7 : Sync #

Total comments: 9

Patch Set 8 : Improve the bluetooth policy documentation. #

Patch Set 9 : Rewrite to avoid content settings and permissions, and add a 2-part test #

Patch Set 10 : Remove the pref_mapping from policy_test_cases.json. #

Patch Set 11 : Release the BrowserMessageFilter::Internal once it has attached the Sender. #

Total comments: 13

Patch Set 12 : Read the policy through the ContentSettings system. #

Patch Set 13 : Switch to a unified browsertest #

Total comments: 15

Patch Set 14 : Fix nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -16 lines) Patch
M chrome/browser/chrome_content_browser_client.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +18 lines, -0 lines 0 comments Download
M chrome/browser/policy/configuration_policy_handler_list_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/policy/policy_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +51 lines, -0 lines 0 comments Download
M chrome/test/data/policy/policy_test_cases.json View 1 2 3 4 5 10 11 1 chunk +8 lines, -0 lines 0 comments Download
M components/content_settings/core/browser/content_settings_default_provider.cc View 1 9 10 11 1 chunk +5 lines, -0 lines 0 comments Download
M components/content_settings/core/browser/content_settings_policy_provider.cc View 1 9 10 11 3 chunks +6 lines, -0 lines 0 comments Download
M components/content_settings/core/browser/content_settings_registry.cc View 1 9 10 11 1 chunk +7 lines, -0 lines 0 comments Download
M components/content_settings/core/common/content_settings.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M components/content_settings/core/common/content_settings_types.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M components/content_settings/core/common/pref_names.h View 1 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M components/content_settings/core/common/pref_names.cc View 1 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M components/policy/resources/policy_templates.json View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +33 lines, -1 line 0 comments Download
M content/browser/bluetooth/bluetooth_dispatcher_host.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +29 lines, -15 lines 0 comments Download
M content/browser/bluetooth/bluetooth_metrics.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M content/public/browser/content_browser_client.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +10 lines, -0 lines 0 comments Download
M content/public/browser/content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/bluetooth/BluetoothError.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothError.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 82 (40 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1706503002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1706503002/20001
4 years, 10 months ago (2016-02-16 21:09:07 UTC) #7
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_compile_dbg_32_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_32_ng/builds/159375) ios_dbg_simulator_ninja on ...
4 years, 10 months ago (2016-02-16 21:13:19 UTC) #9
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1706503002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1706503002/60001
4 years, 10 months ago (2016-02-16 21:49:15 UTC) #11
Jeffrey Yasskin
Hey permission folks, I need to add an enterprise policy to control Web Bluetooth, and ...
4 years, 10 months ago (2016-02-16 22:12:15 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1706503002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1706503002/80001
4 years, 10 months ago (2016-02-16 22:25:30 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1706503002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1706503002/120001
4 years, 10 months ago (2016-02-17 01:08:00 UTC) #21
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-17 02:42:19 UTC) #23
raymes
Hey Jeffrey, I'll take a look. My sense for a longer term direction is that ...
4 years, 10 months ago (2016-02-17 05:55:36 UTC) #24
Jeffrey Yasskin
On 2016/02/17 05:55:36, raymes wrote: > Hey Jeffrey, I'll take a look. My sense for ...
4 years, 10 months ago (2016-02-17 18:15:49 UTC) #25
Jeffrey Yasskin
On 2016/02/17 18:15:49, Jeffrey Yasskin wrote: > On 2016/02/17 05:55:36, raymes wrote: > > Hey ...
4 years, 10 months ago (2016-02-17 18:59:01 UTC) #28
Jeffrey Yasskin
tnagel, could you look at the policy changes? This is the first policy I've added, ...
4 years, 10 months ago (2016-02-19 01:27:44 UTC) #31
Thiemo Nagel
Jeffrey, could you please add a browser test? Customers tend to become upset when policies ...
4 years, 10 months ago (2016-02-22 12:41:51 UTC) #32
raymes
lgtm Jeffrey and I chatted and this is a temporary solution until we find a ...
4 years, 10 months ago (2016-02-22 22:34:34 UTC) #33
Jeffrey Yasskin
Thanks for looking. https://codereview.chromium.org/1706503002/diff/140001/chrome/browser/permissions/permission_manager.cc File chrome/browser/permissions/permission_manager.cc (right): https://codereview.chromium.org/1706503002/diff/140001/chrome/browser/permissions/permission_manager.cc#newcode87 chrome/browser/permissions/permission_manager.cc:87: case PermissionType::BLUETOOTH_GUARD: On 2016/02/22 22:34:34, raymes ...
4 years, 10 months ago (2016-02-22 22:52:17 UTC) #34
Jeffrey Yasskin
On 2016/02/22 12:41:51, Thiemo Nagel wrote: > Jeffrey, could you please add a browser test? ...
4 years, 10 months ago (2016-02-22 23:47:11 UTC) #35
mlamouri (slow - plz ping)
I'm really unsure why the permissions layer is being used here. The fact that the ...
4 years, 10 months ago (2016-02-23 14:39:23 UTC) #36
Jeffrey Yasskin
On 2016/02/23 14:39:23, Mounir Lamouri wrote: > I'm really unsure why the permissions layer is ...
4 years, 10 months ago (2016-02-23 21:38:40 UTC) #37
Jeffrey Yasskin
Here's a version that doesn't use ContentSettings or the permission system, but instead calls into ...
4 years, 10 months ago (2016-02-24 02:07:07 UTC) #40
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1706503002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1706503002/180001
4 years, 10 months ago (2016-02-24 02:12:13 UTC) #41
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_clang_dbg_recipe on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/26341)
4 years, 10 months ago (2016-02-24 03:08:11 UTC) #43
jam
lgtm
4 years, 10 months ago (2016-02-24 17:08:22 UTC) #44
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1706503002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1706503002/200001
4 years, 10 months ago (2016-02-24 18:17:49 UTC) #46
Thiemo Nagel
Bartosz, would you possibly have cycles to look into this before branch point?
4 years, 10 months ago (2016-02-24 20:07:26 UTC) #48
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/120917)
4 years, 10 months ago (2016-02-24 20:21:23 UTC) #50
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1706503002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1706503002/220001
4 years, 10 months ago (2016-02-24 21:11:22 UTC) #52
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-24 22:30:49 UTC) #54
bartfab (slow)
4 years, 10 months ago (2016-02-25 16:39:14 UTC) #57
bartfab (slow)
4 years, 10 months ago (2016-02-25 16:39:22 UTC) #58
bartfab (slow)
https://codereview.chromium.org/1706503002/diff/220001/chrome/browser/chrome_content_browser_client.cc File chrome/browser/chrome_content_browser_client.cc (right): https://codereview.chromium.org/1706503002/diff/220001/chrome/browser/chrome_content_browser_client.cc#newcode1993 chrome/browser/chrome_content_browser_client.cc:1993: const base::Value* policy_value = Nit 1: #include "base/values.h" Nit ...
4 years, 10 months ago (2016-02-25 17:37:50 UTC) #59
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1706503002/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1706503002/240001
4 years, 10 months ago (2016-02-25 20:37:11 UTC) #61
Jeffrey Yasskin
Chris, could you check the macro change in bluetooth_messages.h? Alexei, could you check histograms.xml? Thanks! ...
4 years, 10 months ago (2016-02-25 20:38:50 UTC) #63
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/185989)
4 years, 10 months ago (2016-02-25 22:14:29 UTC) #65
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1706503002/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1706503002/260001
4 years, 10 months ago (2016-02-25 22:33:31 UTC) #67
Jeffrey Yasskin
Chris, I no longer have a change to bluetooth_messages.h, so you don't need to look ...
4 years, 10 months ago (2016-02-25 22:34:49 UTC) #68
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/179889)
4 years, 10 months ago (2016-02-26 00:43:44 UTC) #71
Alexei Svitkine (slow)
lgtm
4 years, 10 months ago (2016-02-26 16:16:50 UTC) #72
bartfab (slow)
policy LGTM with a couple nits - feel free to CQ after fixing these https://codereview.chromium.org/1706503002/diff/220001/chrome/browser/policy/policy_browsertest.cc ...
4 years, 10 months ago (2016-02-26 18:00:45 UTC) #73
Jeffrey Yasskin
Thanks for the last-minute review! https://codereview.chromium.org/1706503002/diff/260001/chrome/browser/chrome_content_browser_client.cc File chrome/browser/chrome_content_browser_client.cc (right): https://codereview.chromium.org/1706503002/diff/260001/chrome/browser/chrome_content_browser_client.cc#newcode1995 chrome/browser/chrome_content_browser_client.cc:1995: HostContentSettingsMap* content_settings = On ...
4 years, 10 months ago (2016-02-26 18:21:25 UTC) #74
bartfab (slow)
lgtm https://codereview.chromium.org/1706503002/diff/260001/chrome/browser/policy/policy_browsertest.cc File chrome/browser/policy/policy_browsertest.cc (right): https://codereview.chromium.org/1706503002/diff/260001/chrome/browser/policy/policy_browsertest.cc#newcode3698 chrome/browser/policy/policy_browsertest.cc:3698: ".then(() => { domAutomationController.send('Success'); }," On 2016/02/26 18:21:25, ...
4 years, 10 months ago (2016-02-26 18:24:54 UTC) #77
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1706503002/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1706503002/280001
4 years, 10 months ago (2016-02-26 18:25:07 UTC) #78
commit-bot: I haz the power
Committed patchset #14 (id:280001)
4 years, 10 months ago (2016-02-26 20:25:56 UTC) #80
commit-bot: I haz the power
4 years, 10 months ago (2016-02-26 20:27:02 UTC) #82
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/98bdd399e51a63f104421344e79a1e838d00fcdc
Cr-Commit-Position: refs/heads/master@{#377959}

Powered by Google App Engine
This is Rietveld 408576698