Skip to content

Commit

Permalink
Correctly move permission bubbles after entering / exiting fullscreen.
Browse files Browse the repository at this point in the history
When full screen is entered or exited the position of the bubble arrow
may need to be updated. This change updates the location, and ensures
the bubble is repainted when the arrow location is updated.

BUG=614928

Review-Url: https://codereview.chromium.org/2036503002
Cr-Commit-Position: refs/heads/master@{#397314}
(cherry picked from commit 2c657c1)

Review URL: https://codereview.chromium.org/2036973002 .

Cr-Commit-Position: refs/branch-heads/2743@{crosswalk-project#201}
Cr-Branched-From: 2b3ae3b-refs/heads/master@{#394939}
  • Loading branch information
Ben Wells committed Jun 3, 2016
1 parent cc68fbf commit 71b82bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions chrome/browser/ui/cocoa/info_bubble_view.mm
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,12 @@ - (void)setBackgroundColor:(NSColor*)backgroundColor {
backgroundColor_.reset([backgroundColor retain]);
}

- (void)setArrowLocation:(info_bubble::BubbleArrowLocation)location {
if (arrowLocation_ == location)
return;

arrowLocation_ = location;
[self setNeedsDisplayInRect:[self bounds]];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ - (void)parentWindowWillToggleFullScreen:(NSNotification*)notification {

- (void)parentWindowDidResize:(NSNotification*)notification {
DCHECK(bridge_);
[self setAnchorPoint:[self getExpectedAnchorPoint]];
[self updateAnchorPosition];
}

- (void)parentWindowDidMove:(NSNotification*)notification {
Expand Down Expand Up @@ -433,6 +433,7 @@ - (void)showWithDelegate:(PermissionBubbleView::Delegate*)delegate
- (void)updateAnchorPosition {
[self setParentWindow:[self getExpectedParentWindow]];
[self setAnchorPoint:[self getExpectedAnchorPoint]];
[[self bubble] setArrowLocation:[self getExpectedArrowLocation]];
}

- (NSPoint)getExpectedAnchorPoint {
Expand Down

0 comments on commit 71b82bd

Please sign in to comment.