New issue
Advanced search Search tips

Issue 921657 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug

Blocking:
issue 854329



Sign in to add a comment

Add Observer for permission changes to ChooserContextBase

Project Member Reported by odejesush@chromium.org, Jan 14

Issue description

ChooserContextBase uses HostContentSettingsMap, which uses content_settings::Observer to notify of changes to permissions. However, the notifications only occur for permissions that are modified in HostContentSettingsMap. This means that for UsbChooserContext, which is a derived class of ChooserContextBase, it is unable to provide notifications for permission changes for ephemeral devices because UsbChooserContext stores these permissions itself instead of using HostContentSettingsMap.

As a result, the site settings UI and  is unable to dynamically update when these permissions are modified. Therefore, ChooserContextBase should have an observer that sub-classes can also use to notify subscribers.
 
Blocking: 854329
Project Member

Comment 2 by bugdroid1@chromium.org, Jan 18 (4 days ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8b39653b3751f241d2cd035ef51e720c33f756ae

commit 8b39653b3751f241d2cd035ef51e720c33f756ae
Author: Ovidio Henriquez <odejesush@chromium.org>
Date: Fri Jan 18 18:56:53 2019

Add a permission observer for ChooserContextBase

This change adds a observer named PermissionObserver for permission
changes to ChooserContextBase. Since UsbChooserContext already had an
observer, it was refactored to be DeviceObserver. Additionally, the
OnPermissionRevoked method of that observer was moved into
PermissionObserver in order to keep all permission related notification
methods in that observer.

Bug: 921657
Change-Id: I1dacac10b59646e4c2ed90ddec1b1d5187c63d0f
Reviewed-on: https://chromium-review.googlesource.com/c/1410148
Commit-Queue: Ovidio de Jesús Ruiz-Henríquez <odejesush@chromium.org>
Reviewed-by: Ben Wells <benwells@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Dan Beam <dbeam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624219}
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/permissions/chooser_context_base.cc
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/permissions/chooser_context_base.h
[add] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/permissions/chooser_context_base_mock_permission_observer.cc
[add] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/permissions/chooser_context_base_mock_permission_observer.h
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/permissions/chooser_context_base_unittest.cc
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/resources/settings/site_settings/chooser_exception_list.js
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/resources/settings/site_settings/constants.js
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/ui/webui/settings/site_settings_handler.cc
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/ui/webui/settings/site_settings_handler.h
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/ui/webui/site_settings_helper.cc
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/ui/webui/site_settings_helper.h
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/ui/webui/site_settings_helper_unittest.cc
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/usb/usb_chooser_context.cc
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/usb/usb_chooser_context.h
[add] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/usb/usb_chooser_context_mock_device_observer.cc
[add] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/usb/usb_chooser_context_mock_device_observer.h
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/usb/usb_chooser_context_unittest.cc
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/usb/usb_chooser_controller.h
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/usb/web_usb_service_impl.cc
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/browser/usb/web_usb_service_impl.h
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/test/BUILD.gn
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/test/data/webui/settings/chooser_exception_list_tests.js
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js
[modify] https://crrev.com/8b39653b3751f241d2cd035ef51e720c33f756ae/chrome/test/data/webui/settings/test_util.js

Sign in to add a comment