Chromium Code Reviews| 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 |