1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_observer_cocoa.h"
7 #import <Cocoa/Cocoa.h>
9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
10 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
12 BookmarkBubbleObserverCocoa::BookmarkBubbleObserverCocoa(
13 BrowserWindowController* controller)
14 : controller_(controller), lockOwner_([[NSObject alloc] init]) {}
16 BookmarkBubbleObserverCocoa::~BookmarkBubbleObserverCocoa() {}
18 void BookmarkBubbleObserverCocoa::OnBookmarkBubbleShown(
19 const bookmarks::BookmarkNode* node) {
20 [controller_ lockBarVisibilityForOwner:lockOwner_ withAnimation:NO delay:NO];
21 [[controller_ bookmarkBarController] startPulsingBookmarkNode:node];
24 void BookmarkBubbleObserverCocoa::OnBookmarkBubbleHidden() {
25 [controller_ releaseBarVisibilityForOwner:lockOwner_
28 [[controller_ bookmarkBarController] stopPulsingBookmarkNode];
29 [controller_ bookmarkBubbleClosed];