New issue
Advanced search Search tips

Issue 616006 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

MacViews: Permission bubble displays at wrong location on window resizing.

Project Member Reported by karandeepb@chromium.org, May 31 2016

Issue description

Version: 53.0.2753.0
OS: Mac

Pre-condition:Enable ‘Toolkit-Views WebUI-style Browser Dialogs’ flag.
Test url:https://permission.site
What steps will reproduce the problem?
1. Launch chrome and navigate to above url.
2. Click on ‘Auto Download’ such that the permission bubble is seen.
3. Resize the window by mouse dragging.

What is the expected output?
Permission bubble should move as well anchored to the left of the address bar

What do you see instead?
Permission bubble stays at the same location (See screenshot)



 
permission_bubble.png
164 KB View Download
Summary: MacViews: Permission bubble displays at wrong location on window resizing. (was: 53.0.2753.0)

Comment 2 by tapted@chromium.org, May 31 2016

Labels: M-53
Owner: ellyjo...@chromium.org
Status: Assigned (was: Available)
Ah, yep, this is something we maybe forgot to plumb through. Moving is fine, and resizing from the bottom right is fine, but in other cases we need to watch for a window resize.

Cocoa does this in -[BrowserWindowController layoutSubviews]:

  // Will update the location of the permission bubble when showing/hiding the
  // top level toolbar in fullscreen.
  PermissionBubbleManager* manager = [self permissionBubbleManager];
  if (manager)
    manager->UpdateAnchorPosition();

PermissionBubbleManager is cross-platform code and that should call into the PermissionBubbleViewViews::GetAnchorPoint() in permission_bubble_view_cocoa_views.mm. But.... for some reason it isn't :/.

Elly - do you want to take a look?
Project Member

Comment 3 by sheriffbot@chromium.org, Jul 7 2016

Labels: -M-53 M-54 MovedFrom-53
Moving this nonessential bug to the next milestone.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Owner: karandeepb@chromium.org
Taking this bug Elly, let me know if you had started it.
Project Member

Comment 5 by bugdroid1@chromium.org, Aug 10 2016

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

commit 0b3631682321c7dee86957078c9c070a01bb3821
Author: karandeepb <karandeepb@chromium.org>
Date: Wed Aug 10 04:42:12 2016

MacViews: Reposition permission bubble on browser resize.

On MacViews currently, permission bubble does not reposition itself on resizing
the browser. The Cocoa implementation for PermissionPrompt
(PermissionBubbleCocoa) has a PermissionBubbleController instance which listens
for window resize notifications. On a Views browser, the repositioning is
facilitated by the call to BubbleDialogDelegateView::OnWidgetBoundsChanged.

But these approaches don't work for MacViews since PermissionPromptImpl does not
have a PermissionBubbleController instance. Also, on the Cocoa browser
BubbleDialogDelegateView::OnWidgetBoundsChanged won't be fired on a browser
window resize.

This CL updates windowDidResize: method on BrowserWindowController to inform the
PermissionRequestManager to update the permission bubble position. It does this
by introducing a new method updatePermissionBubbleAnchor on
BrowserWindowController (Private). This also removes the need to override
parentWindowDidResize: on PermissionBubbleController.

BUG= 616006 
TEST=Go to https://permission.site/. Ensure permission setting for Notifications
is "Ask By Default". Click on Notifications. Permission bubble should appear.
Resize the browser window by dragging the mouse. Ensure the permission bubble
repositions itself correctly. Try with and without
chrome://flags/#mac-views-webui-dialogs enabled.

Review-Url: https://codereview.chromium.org/2227513002
Cr-Commit-Position: refs/heads/master@{#410956}

[modify] https://crrev.com/0b3631682321c7dee86957078c9c070a01bb3821/chrome/browser/ui/cocoa/browser_window_controller.mm
[modify] https://crrev.com/0b3631682321c7dee86957078c9c070a01bb3821/chrome/browser/ui/cocoa/browser_window_controller_private.h
[modify] https://crrev.com/0b3631682321c7dee86957078c9c070a01bb3821/chrome/browser/ui/cocoa/browser_window_controller_private.mm
[modify] https://crrev.com/0b3631682321c7dee86957078c9c070a01bb3821/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm

Status: Fixed (was: Assigned)
Labels: TE-Verified-54.0.2830.0 TE-Verified-M54
Tested the issue on Mac 10.11.6 using 54.0.2830.0.Observed that Permission bubble is moving as well anchored to the left of the address bar.
Please find attached screencast.

Marking it as TE-Verified.
616006.mp4
1.1 MB View Download

Sign in to add a comment