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

Issue 1784333002: Add Device Policy Handler for Bluetooth, and allow disabling the Bluetooth adapter on Chrome OS (Closed)

Created:
4 years, 9 months ago by Ivan Šandrk
Modified:
4 years, 8 months ago
CC:
chromium-reviews, davemoore+watch_chromium.org, ortuno+watch_chromium.org, oshima+watch_chromium.org, scheib+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add Device Policy Handler for Bluetooth, and allow disabling the Bluetooth adapter on Chrome OS This is cl #2 of 3 to tackle this issue: #1 boolean policy #2 policy handler + changes in Bluetooth code #3 UI part. (+ cl #4 with the tests) BUG=463578 Committed: https://crrev.com/bf114686c1e861b93a891f4f3ba32bbf087f23f6 Cr-Commit-Position: refs/heads/master@{#387923}

Patch Set 1 #

Patch Set 2 : wired up the code, code cleanup #

Patch Set 3 : last upload wasnt good #

Patch Set 4 : removed IsDisabled for now, added conditional compilation (cros only) #

Total comments: 2

Patch Set 5 : Made SetDisabled pure virtual #

Total comments: 30

Patch Set 6 : code fix #

Total comments: 14

Patch Set 7 : refactoring, enforce policy run on startup, set policy default value to true, cros only [also rebase] #

Patch Set 8 : scoped_ptr to std::unique_ptr, cros-only for mock, minor refactor #

Patch Set 9 : SetDisabled cros only in bluetooth_adapter_bluez #

Patch Set 10 : Save a reference to BluetoothAdapter #

Patch Set 11 : Fix buildbots failure on linux_chromeos #

Patch Set 12 : Fix buildbots failure on linux_chromeos, try #2 #

Patch Set 13 : Use Shutdown instead of SetDisabled, reverted changes in device/bluetooth/* #

Total comments: 22

Patch Set 14 : Bartfab's nits #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -7 lines) Patch
A chrome/browser/chromeos/policy/bluetooth_policy_handler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +40 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/policy/bluetooth_policy_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +56 lines, -0 lines 2 comments Download
M chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/policy/browser_policy_connector_chromeos.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/settings/device_settings_provider.cc View 1 2 3 4 5 6 7 1 chunk +7 lines, -4 lines 0 comments Download
M chrome/chrome_browser_chromeos.gypi View 1 2 3 4 5 6 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 12 13 2 chunks +5 lines, -3 lines 0 comments Download

Messages

Total messages: 45 (15 generated)
Ivan Šandrk
cschuet@chromium.org: Please review changes in atwilson@chromium.org: Please review changes in
4 years, 8 months ago (2016-03-31 15:28:40 UTC) #3
scheib
Perhaps this should be a cross platform policy, similar to https://codereview.chromium.org/1706503002/ (which only addresses Web ...
4 years, 8 months ago (2016-03-31 16:56:54 UTC) #5
cschuet (SLOW)
On 2016/03/31 16:56:54, scheib wrote: > Perhaps this should be a cross platform policy, similar ...
4 years, 8 months ago (2016-03-31 17:09:32 UTC) #6
Ivan Šandrk
scheib, friendly ping
4 years, 8 months ago (2016-04-11 11:55:36 UTC) #7
scheib
Hello, I haven't seen activity on this patch, or other reviews? Typically an OWNERS review ...
4 years, 8 months ago (2016-04-11 23:27:11 UTC) #8
Ivan Šandrk
On 2016/04/11 23:27:11, scheib wrote: > Hello, I haven't seen activity on this patch, or ...
4 years, 8 months ago (2016-04-12 17:31:11 UTC) #11
Ivan Šandrk
Now that I've made SetDisabled pure virtual, I'm getting a lot of errors like the ...
4 years, 8 months ago (2016-04-12 18:30:25 UTC) #12
scheib
On 2016/04/12 17:31:11, Ivan Šandrk wrote: > On 2016/04/11 23:27:11, scheib wrote: > > Hello, ...
4 years, 8 months ago (2016-04-12 19:20:30 UTC) #13
scheib
https://codereview.chromium.org/1784333002/diff/80001/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/1784333002/diff/80001/device/bluetooth/bluetooth_adapter.h#newcode263 device/bluetooth/bluetooth_adapter.h:263: #if defined(OS_CHROMEOS) Explain here why this is only ChromeOS.
4 years, 8 months ago (2016-04-12 19:20:39 UTC) #14
Andrew T Wilson (Slow)
https://codereview.chromium.org/1784333002/diff/80001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc File chrome/browser/chromeos/policy/bluetooth_policy_handler.cc (right): https://codereview.chromium.org/1784333002/diff/80001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc#newcode17 chrome/browser/chromeos/policy/bluetooth_policy_handler.cc:17: bluetooth_policy_subscription_ = cros_settings_->AddSettingsObserver( Are we always guaranteed to get ...
4 years, 8 months ago (2016-04-13 13:55:11 UTC) #15
Ivan Šandrk
https://codereview.chromium.org/1784333002/diff/80001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc File chrome/browser/chromeos/policy/bluetooth_policy_handler.cc (right): https://codereview.chromium.org/1784333002/diff/80001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc#newcode34 chrome/browser/chromeos/policy/bluetooth_policy_handler.cc:34: bool allow_bluetooth = false; On 2016/04/13 13:55:10, Andrew T ...
4 years, 8 months ago (2016-04-13 17:19:05 UTC) #16
scheib
https://codereview.chromium.org/1784333002/diff/80001/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/1784333002/diff/80001/device/bluetooth/bluetooth_adapter.h#newcode263 device/bluetooth/bluetooth_adapter.h:263: #if defined(OS_CHROMEOS) On 2016/04/13 17:19:04, Ivan Šandrk wrote: > ...
4 years, 8 months ago (2016-04-13 19:45:41 UTC) #17
scheib
https://codereview.chromium.org/1784333002/diff/100001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc File chrome/browser/chromeos/policy/bluetooth_policy_handler.cc (right): https://codereview.chromium.org/1784333002/diff/100001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc#newcode37 chrome/browser/chromeos/policy/bluetooth_policy_handler.cc:37: // device::BluetoothAdapterFactory::GetAdapter( Don't leave commented out code.
4 years, 8 months ago (2016-04-13 19:47:44 UTC) #18
ortuno
https://codereview.chromium.org/1784333002/diff/100001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc File chrome/browser/chromeos/policy/bluetooth_policy_handler.cc (right): https://codereview.chromium.org/1784333002/diff/100001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc#newcode25 chrome/browser/chromeos/policy/bluetooth_policy_handler.cc:25: void BluetoothPolicyHandler::OnBluetoothPolicyChanged() { You didn't answer atwilson's question: "Are ...
4 years, 8 months ago (2016-04-13 21:12:21 UTC) #19
Ivan Šandrk
bartfab@chromium.org: Please review changes in chrome/browser/chromeos/settings/device_settings_provider.cc https://codereview.chromium.org/1784333002/diff/80001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc File chrome/browser/chromeos/policy/bluetooth_policy_handler.cc (right): https://codereview.chromium.org/1784333002/diff/80001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc#newcode17 chrome/browser/chromeos/policy/bluetooth_policy_handler.cc:17: bluetooth_policy_subscription_ = cros_settings_->AddSettingsObserver( ...
4 years, 8 months ago (2016-04-14 18:08:48 UTC) #21
scheib
Will still need a testing patch. https://codereview.chromium.org/1784333002/diff/100001/device/bluetooth/bluetooth_adapter_bluez.cc File device/bluetooth/bluetooth_adapter_bluez.cc (right): https://codereview.chromium.org/1784333002/diff/100001/device/bluetooth/bluetooth_adapter_bluez.cc#newcode263 device/bluetooth/bluetooth_adapter_bluez.cc:263: SetPowered(false, base::Bind(&base::DoNothing), On ...
4 years, 8 months ago (2016-04-14 21:41:10 UTC) #26
Ivan Šandrk
I'm also wondering what is your opinion on the question atwilson raised here https://codereview.chromium.org/1784333002/diff/80001/device/bluetooth/bluetooth_adapter_bluez.cc#newcode345 https://codereview.chromium.org/1784333002/diff/100001/device/bluetooth/bluetooth_adapter_bluez.cc ...
4 years, 8 months ago (2016-04-15 17:32:06 UTC) #27
scheib
https://codereview.chromium.org/1784333002/diff/80001/device/bluetooth/bluetooth_adapter_bluez.cc File device/bluetooth/bluetooth_adapter_bluez.cc (right): https://codereview.chromium.org/1784333002/diff/80001/device/bluetooth/bluetooth_adapter_bluez.cc#newcode263 device/bluetooth/bluetooth_adapter_bluez.cc:263: SetPowered(false, base::Bind(&base::DoNothing), On 2016/04/14 18:08:47, Ivan Šandrk wrote: > ...
4 years, 8 months ago (2016-04-15 17:46:53 UTC) #28
Ivan Šandrk
https://codereview.chromium.org/1784333002/diff/80001/device/bluetooth/bluetooth_adapter_bluez.cc File device/bluetooth/bluetooth_adapter_bluez.cc (right): https://codereview.chromium.org/1784333002/diff/80001/device/bluetooth/bluetooth_adapter_bluez.cc#newcode263 device/bluetooth/bluetooth_adapter_bluez.cc:263: SetPowered(false, base::Bind(&base::DoNothing), On 2016/04/15 17:46:53, scheib wrote: > On ...
4 years, 8 months ago (2016-04-15 17:52:28 UTC) #29
bartfab (slow)
LGTM with nits, assuming you provide tests in a follow-up CL. https://codereview.chromium.org/1784333002/diff/320001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc File chrome/browser/chromeos/policy/bluetooth_policy_handler.cc (right): ...
4 years, 8 months ago (2016-04-18 13:43:44 UTC) #30
bartfab (slow)
On 2016/04/15 17:52:28, Ivan Šandrk wrote: > https://codereview.chromium.org/1784333002/diff/80001/device/bluetooth/bluetooth_adapter_bluez.cc > File device/bluetooth/bluetooth_adapter_bluez.cc (right): > > https://codereview.chromium.org/1784333002/diff/80001/device/bluetooth/bluetooth_adapter_bluez.cc#newcode263 ...
4 years, 8 months ago (2016-04-18 13:44:43 UTC) #31
Ivan Šandrk
scheib: Thanks for your help, we decided to just use Shutdown instead. https://codereview.chromium.org/1784333002/diff/320001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc File chrome/browser/chromeos/policy/bluetooth_policy_handler.cc ...
4 years, 8 months ago (2016-04-18 15:09:18 UTC) #32
bartfab (slow)
lgtm
4 years, 8 months ago (2016-04-18 15:13:45 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1784333002/340001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1784333002/340001
4 years, 8 months ago (2016-04-18 15:56:42 UTC) #35
commit-bot: I haz the power
Committed patchset #14 (id:340001)
4 years, 8 months ago (2016-04-18 16:03:49 UTC) #37
commit-bot: I haz the power
Patchset 14 (id:??) landed as https://crrev.com/bf114686c1e861b93a891f4f3ba32bbf087f23f6 Cr-Commit-Position: refs/heads/master@{#387923}
4 years, 8 months ago (2016-04-18 16:05:55 UTC) #39
scheib
not lgtm. https://codereview.chromium.org/1784333002/diff/340001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc File chrome/browser/chromeos/policy/bluetooth_policy_handler.cc (right): https://codereview.chromium.org/1784333002/diff/340001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc#newcode21 chrome/browser/chromeos/policy/bluetooth_policy_handler.cc:21: adapter->Shutdown(); If all references to the adapter ...
4 years, 8 months ago (2016-04-18 17:10:57 UTC) #40
Ivan Šandrk
A revert of this CL (patchset #14 id:340001) has been created in https://codereview.chromium.org/1902473002/ by isandrk@chromium.org. ...
4 years, 8 months ago (2016-04-18 18:10:54 UTC) #41
Ivan Šandrk
Fix in CL/1900163002. https://codereview.chromium.org/1784333002/diff/340001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc File chrome/browser/chromeos/policy/bluetooth_policy_handler.cc (right): https://codereview.chromium.org/1784333002/diff/340001/chrome/browser/chromeos/policy/bluetooth_policy_handler.cc#newcode21 chrome/browser/chromeos/policy/bluetooth_policy_handler.cc:21: adapter->Shutdown(); On 2016/04/18 17:10:57, scheib wrote: ...
4 years, 8 months ago (2016-04-19 15:53:58 UTC) #44
scheib
4 years, 8 months ago (2016-04-19 17:31:36 UTC) #45
Message was sent while issue was closed.
On 2016/04/19 15:53:58, Ivan Šandrk wrote:
> Fix in CL/1900163002.
> 
>
https://codereview.chromium.org/1784333002/diff/340001/chrome/browser/chromeo...
> File chrome/browser/chromeos/policy/bluetooth_policy_handler.cc (right):
> 
>
https://codereview.chromium.org/1784333002/diff/340001/chrome/browser/chromeo...
> chrome/browser/chromeos/policy/bluetooth_policy_handler.cc:21:
> adapter->Shutdown();
> On 2016/04/18 17:10:57, scheib wrote:
> > If all references to the adapter are released then a new adapter can be
> > constructed and it will be available. You must hold a reference to the
adapter
> > to keep it shut down.
> 
> Done.

Thanks, http://crrev.com/1900163002 looks good.

Powered by Google App Engine
This is Rietveld 408576698