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

Unified Diff: chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm

Issue 1659993002: [Extensions UI Mac] Fix race condition in showing the icon surfacing bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
index 38857b0b34bd8f46cabb7d845129b8c0e7ebb81d..62bc2d7af23a00849a8c08e690809ea8d564ad72 100644
--- a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
@@ -379,15 +379,6 @@ void ToolbarActionsBarBridge::ShowExtensionMessageBubble(
[self showChevronIfNecessaryInFrame:[containerView_ frame]];
[self updateGrippyCursors];
[container setIsOverflow:isOverflow_];
- if (ExtensionToolbarIconSurfacingBubbleDelegate::ShouldShowForProfile(
- browser_->profile())) {
- [containerView_ setTrackingEnabled:YES];
- [[NSNotificationCenter defaultCenter]
- addObserver:self
- selector:@selector(containerMouseEntered:)
- name:kBrowserActionsContainerMouseEntered
- object:containerView_];
- }
focusedViewIndex_ = -1;
}
@@ -572,6 +563,15 @@ void ToolbarActionsBarBridge::ShowExtensionMessageBubble(
new ui::NinePartImageIds(IMAGE_GRID(IDR_DEVELOPER_MODE_HIGHLIGHT)));
}
[containerView_ setHighlight:std::move(highlight)];
+ if (toolbarActionsBar_->show_icon_surfacing_bubble() &&
+ ![containerView_ trackingEnabled]) {
+ [containerView_ setTrackingEnabled:YES];
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(containerMouseEntered:)
+ name:kBrowserActionsContainerMouseEntered
+ object:containerView_];
+ }
std::vector<ToolbarActionViewController*> toolbar_actions =
toolbarActionsBar_->GetActions();

Powered by Google App Engine
This is Rietveld 408576698