diff options
Diffstat (limited to 'chrome/browser/cocoa/extensions/browser_actions_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/extensions/browser_actions_controller.mm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/extensions/browser_actions_controller.mm b/chrome/browser/cocoa/extensions/browser_actions_controller.mm index cc73d61..c3cd111 100644 --- a/chrome/browser/cocoa/extensions/browser_actions_controller.mm +++ b/chrome/browser/cocoa/extensions/browser_actions_controller.mm @@ -30,6 +30,7 @@ NSString* const kBrowserActionsChangedNotification = @"BrowserActionsChanged"; - (void)removeActionButtonForExtension:(Extension*)extension; - (void)repositionActionButtons; - (int)currentTabId; +- (bool)shouldDisplayBrowserAction:(Extension*)extension; @end // A helper class to proxy extension notifications to the view controller's @@ -139,6 +140,9 @@ class ExtensionsServiceObserverBridge : public NotificationObserver, if (!extension->browser_action()) return; + if (![self shouldDisplayBrowserAction:extension]) + return; + // Show the container if it's the first button. Otherwise it will be shown // already. if ([buttons_ count] == 0) @@ -266,4 +270,10 @@ class ExtensionsServiceObserverBridge : public NotificationObserver, return [buttonOrder_ objectAtIndex:(NSUInteger)index]; } +- (bool)shouldDisplayBrowserAction:(Extension*)extension { + return (!profile_->IsOffTheRecord() || + profile_->GetExtensionsService()-> + IsIncognitoEnabled(extension->id())); +} + @end |