BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / bookmarks / bookmark_bubble_observer_cocoa.mm
blob34bfca5fc279ff7c4e3b753041140456ff5004a8
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_
26                               withAnimation:YES
27                                       delay:NO];
28   [[controller_ bookmarkBarController] stopPulsingBookmarkNode];
29   [controller_ bookmarkBubbleClosed];