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

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

Issue 1888133002: [Extensions UI Mac] Fix a bug with popped out actions' highlighted state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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_action_button.mm
diff --git a/chrome/browser/ui/cocoa/extensions/browser_action_button.mm b/chrome/browser/ui/cocoa/extensions/browser_action_button.mm
index d9bcbd19b224dca0246a4f0e4eb8286af9204130..31cfdafaa325aa2dcc889fd5ac8efd1359836a2c 100644
--- a/chrome/browser/ui/cocoa/extensions/browser_action_button.mm
+++ b/chrome/browser/ui/cocoa/extensions/browser_action_button.mm
@@ -169,14 +169,15 @@ void ToolbarActionViewDelegateBridge::DoShowContextMenu() {
// to avoid the magic '5' here, but since it's built into Cocoa, it's not too
// hopeful.
NSPoint menuPoint = NSMakePoint(0, NSHeight([owner_ bounds]) + 5);
- base::WeakPtr<ToolbarActionViewDelegateBridge> weak_this;
+ base::WeakPtr<ToolbarActionViewDelegateBridge> weakThis =
+ weakFactory_.GetWeakPtr();
Devlin 2016/04/14 18:54:35 D'oh. :(
Avi (use Gerrit) 2016/04/14 19:08:31 hahasob
[[owner_ cell] setHighlighted:YES];
[[owner_ menu] popUpMenuPositioningItem:nil
atLocation:menuPoint
inView:owner_];
// Since menus run in a blocking way, it's possible that the extension was
// unloaded since this point.
- if (!weak_this)
+ if (!weakThis)
return;
[[owner_ cell] setHighlighted:NO];
contextMenuRunning_ = false;
@@ -540,6 +541,10 @@ void ToolbarActionViewDelegateBridge::DoShowContextMenu() {
[browserActionsController_ currentWebContents]);
}
+- (BOOL)isHighlighted {
+ return [[self cell] isHighlighted];
+}
+
@end
@implementation BrowserActionCell

Powered by Google App Engine
This is Rietveld 408576698