Commit 3f2fe29d authored by groby's avatar groby Committed by Commit bot

[Permission Bubble] Allow re-display after ESC

Permission bubbles on Mac would not re-display for new permissions after
dismissing a bubble with ESC.

The root cause is that ESC would close the bubble, but not clean out the
pending requests. This change ensures pending requests are removed when
a bubble closes, for whatever reason.

BUG=385088
TEST= 1) Navigate to adrifelt.github.io/demos/all-permissions.html
      2) Click on location, observer permission bubble popping up.
      3) Click in permission bubble to give focus to bubble - DO NOT
         click on any UI elements in the bubble, just the text.
      4) Press ESC, observe bubble being dismissed.
      5) Click on "notifications" on the web page. With the change,
         observe a new bubble. Without, no new bubble.

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

Cr-Commit-Position: refs/heads/master@{#330950}
parent aefbdd17
......@@ -248,6 +248,9 @@ class MenuDelegate : public ui::SimpleMenuModel::Delegate {
- (void)windowWillClose:(NSNotification*)notification {
bridge_->OnBubbleClosing();
[super windowWillClose:notification];
if (delegate_)
delegate_->Closing();
}
- (void)parentWindowWillBecomeFullScreen:(NSNotification*)notification {
......
......@@ -301,6 +301,7 @@ TEST_F(PermissionBubbleControllerTest, EscapeCloses) {
acceptStates:accept_states_];
EXPECT_TRUE([[controller_ window] isVisible]);
EXPECT_CALL(*this, Closing()).Times(1);
[[controller_ window]
performKeyEquivalent:cocoa_test_event_utils::KeyEventWithKeyCode(
kVK_Escape, '\e', NSKeyDown, 0)];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment