Make default options in Page Info remain there until the page is reloaded/navigated |
|||
Issue descriptionTry the following. 1. Change a permission in Page Info from Allow or Block to Default 2. Close the popover (X or click outside the popover) 3. Re-open the popover without Reloading the page The permission row disappears but the user may still want to change it. We should keep the row there until a navigation/refresh happens.
,
Oct 23 2017
Screenshot attached
,
Nov 10 2017
,
Nov 11 2017
I am thinking about this change.
I came up with something like this:
Creating an in-memory content setting provider to keep record of those content settings set from Allow or Block to Default.
This way the changed permission can be kept for specific amount of time (to be discussed later) in memory. If we keep that provider throughout the program execution, whenever the user opens the page info, that settings will be shown and it can be quickly changed by user without the need to press "Site Settings".
This new provider should not necessarily be registered in host_content_settings_map.cc's content_settings_providers_. We can create a method such as:
GetRecentlyChangedWebsiteSetting(const GURL& primary_url,
const GURL& secondary_url,
ContentSettingsType content_type,
...)
to only search through this in-memory provider, and if an entry is found there, the code in page_info.cc::ShouldShowPermission can be like:
// All other content settings only show when they are non-factory-default.
if ((base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableSiteSettings) ||
base::FeatureList::IsEnabled(features::kSiteDetails)) &&
IsPermissionFactoryDefault(content_settings, info) &&
!IsPermissionRecentlyChanged(content_settings, info)) { // <----- this line
return false;
}
Do you think it worth to implement it as explained above? or you have any other solution that can help?
,
Nov 14 2017
Thanks for your suggestion! I discussed possible solutions with raymes@ offline and I think we want to avoid changing HostContentSettingsMap. If you'd like to work on this, one possible solution we came up with was to add a vector or set to TabSpecificContentSettings storing all the recently used content settings and check this in ShouldShowPermission. We can clear the stored permissions in TabSpecificContentSettings::OnDidStartNavigation() (or possibly the FinishedNavigation). PageInfo is a subclass of SiteDataObserver, so I think you can get the TabSpecificContentSettings instance from there.
,
Nov 15 2017
Thanks Patricia for the explanation. I'd like to take this bug, if it's possible. I'll start working on it this weekend.
,
Dec 6 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a9c769dee7fefcb2145397f41e69655a1f127480 commit a9c769dee7fefcb2145397f41e69655a1f127480 Author: shahriar rostami <shahriar.rostami@gmail.com> Date: Wed Dec 06 04:54:08 2017 Make default options in Page Info remain there until the page is reloaded or navigated When non-default content settings changed to default, they should be kept in Page Info because user might need to change them again. If the navigation or refresh happens, content settings with default value should not be shown in Page Info anymore. Bug: 777275 Change-Id: Ica986ee6646b833bf47da05fb39abb786ce2259a Reviewed-on: https://chromium-review.googlesource.com/792790 Commit-Queue: Raymes Khoury <raymes@chromium.org> Reviewed-by: Raymes Khoury <raymes@chromium.org> Cr-Commit-Position: refs/heads/master@{#522006} [modify] https://crrev.com/a9c769dee7fefcb2145397f41e69655a1f127480/chrome/browser/content_settings/tab_specific_content_settings.cc [modify] https://crrev.com/a9c769dee7fefcb2145397f41e69655a1f127480/chrome/browser/content_settings/tab_specific_content_settings.h [modify] https://crrev.com/a9c769dee7fefcb2145397f41e69655a1f127480/chrome/browser/ui/page_info/page_info.cc [modify] https://crrev.com/a9c769dee7fefcb2145397f41e69655a1f127480/chrome/browser/ui/page_info/page_info.h [modify] https://crrev.com/a9c769dee7fefcb2145397f41e69655a1f127480/chrome/browser/ui/page_info/page_info_unittest.cc
,
Dec 7 2017
Thanks for working on this, shahriar.rostami@! Marking as fixed :) |
|||
►
Sign in to add a comment |
|||
Comment 1 by raymes@chromium.org
, Oct 23 2017