Commit a985282e authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

extensions: only close the popup on activation changes if visible

As the widget is shown only once the webcontents has loaded it is possible
to close the popup before it's shown. Ignore activation changes until the
popup is shown.

BUG=867654
TEST=covered by tests in mash

Change-Id: I74956b137a119f2b745a52698cb9dee6543b85e4
Reviewed-on: https://chromium-review.googlesource.com/1169525Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581924}
parent a38a47cb
...@@ -152,7 +152,9 @@ void ExtensionPopup::AddedToWidget() { ...@@ -152,7 +152,9 @@ void ExtensionPopup::AddedToWidget() {
void ExtensionPopup::OnWidgetActivationChanged(views::Widget* widget, void ExtensionPopup::OnWidgetActivationChanged(views::Widget* widget,
bool active) { bool active) {
if (active && widget == anchor_widget()) // Don't close if we haven't shown the widget yet (the widget is shown once
// the WebContents finishes loading).
if (GetWidget()->IsVisible() && active && widget == anchor_widget())
CloseUnlessUnderInspection(); CloseUnlessUnderInspection();
} }
......
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