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

Issue 1560263002: Store Bluetooth permissions in website settings (Closed)

Created:
4 years, 11 months ago by juncai
Modified:
4 years, 8 months ago
CC:
ortuno, chromium-reviews, markusheintz_, msramek+watch_chromium.org, raymes+watch_chromium.org, raymes, scheib, mlamouri (slow - plz ping)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Store Bluetooth permissions in website settings This patch adds a new class BluetoothPermissionContext that stores a list of chosen objects for chooser-based permissions in website settings. It is similar to UsbChooserContext. BUG=577953

Patch Set 1 : store Bluetooth permissions in website settings #

Total comments: 4

Patch Set 2 : address reillyg@'s comments #

Patch Set 3 : moved bluetooth chooser context related code to non ios source in .gypi file #

Total comments: 6

Patch Set 4 : address reillyg@'s comments #

Total comments: 16

Patch Set 5 : address jyasskin@'s comments #

Patch Set 6 : fixed some compile errors #

Patch Set 7 : fixed some link error on Android #

Patch Set 8 : merged changes from master and resolved conflicts #

Patch Set 9 : cleaned up changes at bluetooth_dispatcher_host.cc #

Total comments: 4

Patch Set 10 : modified ChooserPermissionManager to take url::Origin as parameter #

Total comments: 28

Patch Set 11 : address jyasskin@'s comments #

Patch Set 12 : fixed compile error on Android #

Patch Set 13 : merged changes from master and resolved conflicts #

Patch Set 14 : removed unnecessary include file #

Patch Set 15 : added code to check session->chooser_permission_manager #

Unified diffs Side-by-side diffs Delta from patch set Stats (+539 lines, -16 lines) Patch
M android_webview/browser/aw_browser_context.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/browser/aw_browser_context.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +5 lines, -0 lines 0 comments Download
M android_webview/browser/aw_permission_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -0 lines 0 comments Download
M blimp/engine/browser/blimp_browser_context.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M blimp/engine/browser/blimp_browser_context.cc View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
A chrome/browser/bluetooth/bluetooth_permission_context.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +23 lines, -0 lines 0 comments Download
A chrome/browser/bluetooth/bluetooth_permission_context.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +34 lines, -0 lines 0 comments Download
A chrome/browser/bluetooth/bluetooth_permission_context_factory.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +36 lines, -0 lines 0 comments Download
A chrome/browser/bluetooth/bluetooth_permission_context_factory.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +44 lines, -0 lines 0 comments Download
A + chrome/browser/permissions/chooser_context.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +11 lines, -12 lines 0 comments Download
A chrome/browser/permissions/chooser_context.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +41 lines, -0 lines 0 comments Download
A chrome/browser/permissions/chooser_permission_manager.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +36 lines, -0 lines 0 comments Download
A chrome/browser/permissions/chooser_permission_manager.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +42 lines, -0 lines 0 comments Download
A chrome/browser/permissions/chooser_permission_manager_factory.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/permissions/chooser_permission_manager_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +47 lines, -0 lines 0 comments Download
M chrome/browser/permissions/permission_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/permissions/permission_uma_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/permissions/permission_util.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/profiles/off_the_record_profile_impl.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/profiles/off_the_record_profile_impl.cc View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/ui/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/app_list/test/fake_profile.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/app_list/test/fake_profile.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +10 lines, -0 lines 0 comments Download
M chrome/test/base/testing_profile.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/base/testing_profile.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +5 lines, -0 lines 0 comments Download
M chromecast/browser/cast_browser_context.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chromecast/browser/cast_browser_context.cc View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M components/content_settings/core/browser/website_settings_registry.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M components/content_settings/core/common/content_settings_types.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/bluetooth/bluetooth_dispatcher_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +57 lines, -4 lines 0 comments Download
M content/browser/download/download_manager_impl_unittest.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M content/public/browser/browser_context.h View 1 2 3 4 2 chunks +5 lines, -0 lines 0 comments Download
A content/public/browser/chooser_permission_manager.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +40 lines, -0 lines 0 comments Download
M content/public/browser/permission_type.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M content/public/test/test_browser_context.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M content/public/test/test_browser_context.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M content/shell/browser/shell_browser_context.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M content/shell/browser/shell_browser_context.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (7 generated)
juncai
Please review this patch.
4 years, 11 months ago (2016-01-05 22:44:50 UTC) #4
Reilly Grant (use Gerrit)
https://codereview.chromium.org/1560263002/diff/1/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc File chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc (right): https://codereview.chromium.org/1560263002/diff/1/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc#newcode342 chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc:342: BluetoothChooserContextFactory::GetInstance(); Bluetooth is implemented on Android so it should ...
4 years, 11 months ago (2016-01-05 23:08:51 UTC) #5
juncai
https://codereview.chromium.org/1560263002/diff/1/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc File chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc (right): https://codereview.chromium.org/1560263002/diff/1/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc#newcode342 chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc:342: BluetoothChooserContextFactory::GetInstance(); On 2016/01/05 23:08:51, Reilly Grant wrote: > Bluetooth ...
4 years, 11 months ago (2016-01-05 23:56:15 UTC) #6
Reilly Grant (use Gerrit)
Aside from my comments this looks good. Jeffrey should review to make sure this policy ...
4 years, 11 months ago (2016-01-06 00:16:52 UTC) #8
juncai
https://codereview.chromium.org/1560263002/diff/40001/chrome/browser/ui/bluetooth/bluetooth_chooser_context.h File chrome/browser/ui/bluetooth/bluetooth_chooser_context.h (right): https://codereview.chromium.org/1560263002/diff/40001/chrome/browser/ui/bluetooth/bluetooth_chooser_context.h#newcode30 chrome/browser/ui/bluetooth/bluetooth_chooser_context.h:30: const base::string16& device_name, On 2016/01/06 00:16:52, Reilly Grant wrote: ...
4 years, 11 months ago (2016-01-06 17:14:01 UTC) #9
Reilly Grant (use Gerrit)
https://codereview.chromium.org/1560263002/diff/40001/chrome/browser/ui/bluetooth/bluetooth_chooser_context.cc File chrome/browser/ui/bluetooth/bluetooth_chooser_context.cc (right): https://codereview.chromium.org/1560263002/diff/40001/chrome/browser/ui/bluetooth/bluetooth_chooser_context.cc#newcode48 chrome/browser/ui/bluetooth/bluetooth_chooser_context.cc:48: device_dict->SetString(kDeviceNameKey, device_name); No, don't remove this one! We want ...
4 years, 11 months ago (2016-01-06 18:44:13 UTC) #10
Jeffrey Yasskin
https://codereview.chromium.org/1560263002/diff/60001/chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.h File chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.h (right): https://codereview.chromium.org/1560263002/diff/60001/chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.h#newcode13 chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.h:13: #include "url/gurl.h" I think you can forward-declare GURL too. ...
4 years, 11 months ago (2016-01-06 19:10:55 UTC) #11
Jeffrey Yasskin
https://codereview.chromium.org/1560263002/diff/60001/chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.cc File chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.cc (right): https://codereview.chromium.org/1560263002/diff/60001/chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.cc#newcode54 chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.cc:54: chooser_context->GrantDevicePermission(origin_, embedding_origin, After looking at your Android patch, I ...
4 years, 11 months ago (2016-01-06 19:23:45 UTC) #12
ortuno
The issues this CL points to are not related to the purpose of this change. ...
4 years, 11 months ago (2016-01-11 20:27:58 UTC) #14
juncai
https://codereview.chromium.org/1560263002/diff/40001/chrome/browser/ui/bluetooth/bluetooth_chooser_context.cc File chrome/browser/ui/bluetooth/bluetooth_chooser_context.cc (right): https://codereview.chromium.org/1560263002/diff/40001/chrome/browser/ui/bluetooth/bluetooth_chooser_context.cc#newcode48 chrome/browser/ui/bluetooth/bluetooth_chooser_context.cc:48: device_dict->SetString(kDeviceNameKey, device_name); On 2016/01/06 18:44:13, Reilly Grant wrote: > ...
4 years, 11 months ago (2016-01-11 21:55:16 UTC) #16
Jeffrey Yasskin
On 2016/01/11 20:27:58, ortuno wrote: > The issues this CL points to are not related ...
4 years, 11 months ago (2016-01-15 01:28:16 UTC) #18
juncai
ping jyasskin@, :).
4 years, 11 months ago (2016-01-19 21:03:05 UTC) #19
ortuno
https://codereview.chromium.org/1560263002/diff/160001/content/browser/bluetooth/bluetooth_dispatcher_host.cc File content/browser/bluetooth/bluetooth_dispatcher_host.cc (right): https://codereview.chromium.org/1560263002/diff/160001/content/browser/bluetooth/bluetooth_dispatcher_host.cc#newcode1203 content/browser/bluetooth/bluetooth_dispatcher_host.cc:1203: GURL embedding_origin = Can you add a TODO that ...
4 years, 11 months ago (2016-01-19 21:09:31 UTC) #20
juncai
https://codereview.chromium.org/1560263002/diff/160001/content/browser/bluetooth/bluetooth_dispatcher_host.cc File content/browser/bluetooth/bluetooth_dispatcher_host.cc (right): https://codereview.chromium.org/1560263002/diff/160001/content/browser/bluetooth/bluetooth_dispatcher_host.cc#newcode1203 content/browser/bluetooth/bluetooth_dispatcher_host.cc:1203: GURL embedding_origin = Modified ChooserPermissionManager to take url::Origin instead ...
4 years, 11 months ago (2016-01-19 22:21:37 UTC) #21
Jeffrey Yasskin
Sorry it's taking me so long to get through this. I'm getting stuck on how ...
4 years, 11 months ago (2016-01-21 00:32:30 UTC) #22
juncai
https://codereview.chromium.org/1560263002/diff/180001/chrome/browser/permissions/chooser_permission_manager.cc File chrome/browser/permissions/chooser_permission_manager.cc (right): https://codereview.chromium.org/1560263002/diff/180001/chrome/browser/permissions/chooser_permission_manager.cc#newcode20 chrome/browser/permissions/chooser_permission_manager.cc:20: BluetoothPermissionContext* permission_context = On 2016/01/21 00:32:30, Jeffrey Yasskin wrote: ...
4 years, 11 months ago (2016-01-25 18:53:32 UTC) #23
Reilly Grant (use Gerrit)
https://codereview.chromium.org/1560263002/diff/180001/chrome/browser/profiles/profile_impl.cc File chrome/browser/profiles/profile_impl.cc (right): https://codereview.chromium.org/1560263002/diff/180001/chrome/browser/profiles/profile_impl.cc#newcode50 chrome/browser/profiles/profile_impl.cc:50: #include "chrome/browser/permissions/chooser_permission_manager.h" On 2016/01/25 18:53:32, juncai wrote: > On ...
4 years, 11 months ago (2016-01-25 19:08:38 UTC) #24
juncai
4 years, 11 months ago (2016-01-25 21:51:59 UTC) #25
https://codereview.chromium.org/1560263002/diff/180001/chrome/browser/profile...
File chrome/browser/profiles/profile_impl.cc (right):

https://codereview.chromium.org/1560263002/diff/180001/chrome/browser/profile...
chrome/browser/profiles/profile_impl.cc:50: #include
"chrome/browser/permissions/chooser_permission_manager.h"
On 2016/01/25 19:08:38, Reilly Grant wrote:
> On 2016/01/25 18:53:32, juncai wrote:
> > On 2016/01/21 00:32:30, Jeffrey Yasskin wrote:
> > > I think you don't need this #include.
> > 
> > Without this include, line:
> > return ChooserPermissionManagerFactory::GetForProfile(this);
> > will get compile error:
> > error: cannot initialize return object of type
> > 'content::ChooserPermissionManager *' with an rvalue of type
> > 'ChooserPermissionManager *'
> 
> ChooserPermissionManagerFactory::GetForProfile should be modified to return a
> content::ChooserPermissionManager. That is, move the cast from
> ::ChooserPermissionManager to content::ChooserPermissionManager into
> chooser_permission_manager_factory.cc so that the include is only necessary
> there.

Done.

Powered by Google App Engine
This is Rietveld 408576698