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

Issue 2702923002: Page Info: Hide default permissions with a value of Ask if the default is Ask. (Closed)

Created:
3 years, 10 months ago by lgarron
Modified:
3 years, 9 months ago
CC:
chromium-reviews, mac-reviews_chromium.org, markusheintz_, msramek+watch_chromium.org, msw, raymes+watch_chromium.org, Robert Sesek, srahim+watch_chromium.org, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Page Info: Hide default permissions with a value of Ask if the default is Ask. The feature comes with a temporary Finch killswitch called PageInfoAlwaysShowAllPermissions. This commit sets the default to Enabled, which keeps the old behaviour of showing all permissions. [1] https://cs.chromium.org/chromium/src/components/content_settings/core/common/content_settings.h?type=cs&q=CONTENT_SETTING_DEFAULT&sq=package:chromium&l=25 BUG=657267, 698467 TEST=Perform the following steps on Mac and Windows: 1) Visit https://permission.site and click the lock icon in the URL bar to open the Page Info bubble. Verify that there are only 5 permissions shown below "Cookies", and that these don't include "Notifications" or "Location". Verify that the button at the bottom says "More settings". 2) On the page, click on "Location" (select "Allow" in the permission prompt) and "Notifications" (select "Block" in the permission prompt). 3) Open the Page Info bubble again and verify that Location and Notifications are now visible in addition to the permissions from step 1, with respective values of "Allow" and "Block". 4) Change the Location dropdown in Page Info from "Allow" to "Ask". Close and re-open Page Info and verify that "Location" is not listed anymore. 5) Relaunch Chrome with --enable-features="PageInfoAlwaysShowAllPermissions", open Page Info, and verify that all permissions are shown (currently 11 on desktop).

Patch Set 1 #

Patch Set 2 : Page Info: hide permissions with default vaules behind a button. #

Patch Set 3 : Page Info: hide permissions with default values behind a button. #

Patch Set 4 : Page Info: Add cross-platform logic to hide permissions with default values behind a button. #

Patch Set 5 : Page Info: Add cross-platform logic to hide permissions with default values behind a button. #

Patch Set 6 : Page Info: Add cross-platform logic to hide permissions with default values behind a button. #

Patch Set 7 : Page Info: Add cross-platform logic to hide permissions with default values behind a button. #

Total comments: 6

Patch Set 8 : Page Info: Add cross-platform logic to hide permissions with default values behind a button. #

Patch Set 9 : Fix #ifdef to allow testing MacViews. #

Patch Set 10 : Fix existing tests. #

Total comments: 1

Patch Set 11 : gco default-views #

Patch Set 12 : Address msw@'s comments. #

Patch Set 13 : Page Info: Hide default permissions with a value of Ask if the default is Ask. #

Patch Set 14 : Page Info: Hide default permissions with a value of Ask if the default is Ask. #

Total comments: 14

Patch Set 15 : Page Info: Hide default permissions with a value of Ask if the default is Ask. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -5 lines) Patch
M chrome/app/generated_resources.grd View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/website_settings/website_settings_popup_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/website_settings/website_settings.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +27 lines, -1 line 0 comments Download

Messages

Total messages: 28 (14 generated)
lgarron
raymes@, could you review the cross-platform code? palmer@, could you review the cocoa/views stubs? (Feel ...
3 years, 10 months ago (2017-02-24 01:07:27 UTC) #6
lgarron
isherman@, could you review histograms.xml?
3 years, 10 months ago (2017-02-24 01:21:23 UTC) #8
palmer
https://codereview.chromium.org/2702923002/diff/110001/chrome/browser/ui/website_settings/website_settings_ui.cc File chrome/browser/ui/website_settings/website_settings_ui.cc (right): https://codereview.chromium.org/2702923002/diff/110001/chrome/browser/ui/website_settings/website_settings_ui.cc#newcode288 chrome/browser/ui/website_settings/website_settings_ui.cc:288: VisiblePermissions visible_permissions) { Nit: I'd expect |VisiblePermissions| to be ...
3 years, 10 months ago (2017-02-24 01:55:02 UTC) #9
lgarron
https://codereview.chromium.org/2702923002/diff/110001/chrome/browser/ui/website_settings/website_settings_ui.cc File chrome/browser/ui/website_settings/website_settings_ui.cc (right): https://codereview.chromium.org/2702923002/diff/110001/chrome/browser/ui/website_settings/website_settings_ui.cc#newcode288 chrome/browser/ui/website_settings/website_settings_ui.cc:288: VisiblePermissions visible_permissions) { On 2017/02/24 at 01:55:02, palmer wrote: ...
3 years, 10 months ago (2017-02-24 02:15:27 UTC) #10
lgarron
CCing dependent CL reviewers Views: https://codereview.chromium.org/2717613003 (msw@) Cocoa: https://codereview.chromium.org/2712863005 (rsesek@)
3 years, 10 months ago (2017-02-24 02:41:55 UTC) #11
Ilya Sherman
histograms.xml lgtm
3 years, 10 months ago (2017-02-24 21:55:36 UTC) #16
Robert Sesek
cocoa/ LGTM
3 years, 10 months ago (2017-02-24 22:18:14 UTC) #18
raymes
Hey Lucas, I think there's a meeting about this tomorrow? It would be good to ...
3 years, 9 months ago (2017-02-27 01:40:49 UTC) #19
lgarron
Okes-dokes, we have greatly simplified. raymes@, could you review again?
3 years, 9 months ago (2017-03-04 03:34:31 UTC) #22
raymes
Thanks Lucas! https://codereview.chromium.org/2702923002/diff/170001/chrome/browser/ui/website_settings/website_settings_ui.cc File chrome/browser/ui/website_settings/website_settings_ui.cc (right): https://codereview.chromium.org/2702923002/diff/170001/chrome/browser/ui/website_settings/website_settings_ui.cc#newcode295 chrome/browser/ui/website_settings/website_settings_ui.cc:295: return l10n_util::GetStringUTF16(IDS_PAGE_INFO_SITE_SETTINGS_LINK); Strange that the behavior changes ...
3 years, 9 months ago (2017-03-05 23:47:11 UTC) #24
elawrence
https://codereview.chromium.org/2702923002/diff/250001/chrome/browser/ui/website_settings/website_settings.cc File chrome/browser/ui/website_settings/website_settings.cc (right): https://codereview.chromium.org/2702923002/diff/250001/chrome/browser/ui/website_settings/website_settings.cc#newcode213 chrome/browser/ui/website_settings/website_settings.cc:213: // - Its current value is "Ask" (or the ...
3 years, 9 months ago (2017-03-06 19:28:02 UTC) #25
lgarron
https://codereview.chromium.org/2702923002/diff/250001/chrome/app/generated_resources.grd File chrome/app/generated_resources.grd (right): https://codereview.chromium.org/2702923002/diff/250001/chrome/app/generated_resources.grd#newcode8664 chrome/app/generated_resources.grd:8664: + More settings On 2017/03/05 at 23:47:11, raymes wrote: ...
3 years, 9 months ago (2017-03-09 02:41:24 UTC) #26
raymes
https://codereview.chromium.org/2702923002/diff/250001/chrome/browser/ui/website_settings/website_settings.cc File chrome/browser/ui/website_settings/website_settings.cc (right): https://codereview.chromium.org/2702923002/diff/250001/chrome/browser/ui/website_settings/website_settings.cc#newcode216 chrome/browser/ui/website_settings/website_settings.cc:216: if (base::FeatureList::IsEnabled(kPageInfoAlwaysShowAllPermissions)) { On 2017/03/09 02:41:24, lgarron wrote: > ...
3 years, 9 months ago (2017-03-09 03:25:19 UTC) #27
lgarron
3 years, 9 months ago (2017-03-11 02:17:17 UTC) #28
On 2017/03/09 at 03:25:19, raymes wrote:
>
https://codereview.chromium.org/2702923002/diff/250001/chrome/browser/ui/webs...
> File chrome/browser/ui/website_settings/website_settings.cc (right):
> 
>
https://codereview.chromium.org/2702923002/diff/250001/chrome/browser/ui/webs...
> chrome/browser/ui/website_settings/website_settings.cc:216: if
(base::FeatureList::IsEnabled(kPageInfoAlwaysShowAllPermissions)) {
> On 2017/03/09 02:41:24, lgarron wrote:
> > On 2017/03/05 at 23:47:11, raymes wrote:
> > > nit: other single-line if-statements in this file don't seem to use {} so
I
> > would suggest removing for consistency
> > 
> > Fine, but: https://bugs.chromium.org/p/chromium/issues/detail?id=699840
> > (I wish `git cl format` would finally just pick *something*, even removing
the
> > braces: https://bugs.chromium.org/p/chromium/issues/detail?id=651609)
> 
> I agree, I don't feel strongly which way, it's just consistency that I desire!
> 
>
https://codereview.chromium.org/2702923002/diff/250001/chrome/browser/ui/webs...
> chrome/browser/ui/website_settings/website_settings.cc:220: if
(permission_info.default_setting != CONTENT_SETTING_ASK) {
> On 2017/03/09 02:41:24, lgarron wrote:
> > On 2017/03/05 at 23:47:11, raymes wrote:
> > > Should this be comparing to the user-specified default or the
chrome-specified
> > default? Currently it's the user specified default. I don't think there will
be
> > much difference in practice, but it's probably better to decide now.
> > > 
> > > We can easily access the Chrome-specified default through
WebsiteSettingsInfo
> > if needed.
> > 
> > Chrome-specified.
> > 
> > I thought that was what was happening here; will have to check when I can
> > compile on corp again.
> 
> To be clear by Chrome-specified default I mean the one that chrome ships with
> 
> Currently it's just grabbing the value from the HostContentSettingsMap that
has the *,* pattern - which is the user-specified default. We can get the
chrome-specified default by accessing
ContentSettingsRegistry::GetInstance()->Get(type)->InitialDefaultValue();
> 
> Note: that function doesn't actually exist yet, but implementing it would be
trivial:
> 
> ContentSetting ContentSettingsInfo::InitialDefaultValue() {
>   return
ValueToContentSetting(website_settings_info->initial_default_value());
> }
> 
>
https://codereview.chromium.org/2702923002/diff/250001/chrome/browser/ui/webs...
> chrome/browser/ui/website_settings/website_settings.cc:230: }
> On 2017/03/09 02:41:24, lgarron wrote:
> > On 2017/03/05 at 23:47:11, raymes wrote:
> > > Do you think we really want to hide settings that are set to ASK, even if
it's
> > not due to ASK being the default?
> > > 
> > > I think in practice it won't matter, but I would suggest the code would be
> > clearer here as:
> > > 
> > > if (permission_info.setting != CONTENT_SETTING_DEFAULT)
> > >   return true;
> > > 
> > > return false;
> > 
> > Because of line 220, we always show permissions whose default is not ask.
> > 
> > As far as I know, the CONTENT_SETTING_ASK cannot be reached in practice
unless
> > someone hacks their settings or we perform a settings migration and
explicitly
> > set that value. But semantically, this is what how I meant [1].
> > 
> > Are you saying that in theory we should show the permission for
http://a.example.com in
> > the following case?
> > - Global default: ASK
> > - [*.]example.com: BLOCK
> > - http://a.example.com: ASK
> > (Ignoring that that this UI is totally borked anyhow [2].)
> > 
> > [1] https://bugs.chromium.org/p/chromium/issues/detail?id=657267#c35
> > [2] https://bugs.chromium.org/p/chromium/issues/detail?id=614618
> 
> Yeah I guess I'm thinking in theory if the value was meaningfully ASK from
some situation other than the Chrome-default, then we should show the setting.
For example, if the default was BLOCK but enterprise policy set it to ASK then I
think we should show it. I actually think that it's possible that could happen
today.
> 
> Thinking about it in more detail, if the source of the setting is something
other than the chrome-specified default I think we should probably show it. We
could incorporate permission_info.source to check that if we wanted, e.g.
> 
> if (permission_info.source == default provider AND 
>     permission_info.setting == chrome default AND 
>     permission_info.setting == ASK) {
>   hide
> } else {
>   show
> }
> 
> What would you think about that approach?

Shelving this until we can come to a consensus with Enamel + UI review. :-(

Powered by Google App Engine
This is Rietveld 408576698