1 // Copyright 2013 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/infobars/infobar_container_cocoa.h"
7 #import "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h"
8 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h"
10 InfoBarContainerCocoa::InfoBarContainerCocoa(
11 InfoBarContainerController* controller)
12 : InfoBarContainer(this),
13 controller_(controller) {
16 InfoBarContainerCocoa::~InfoBarContainerCocoa() {
17 RemoveAllInfoBarsForDestruction();
20 void InfoBarContainerCocoa::PlatformSpecificAddInfoBar(InfoBar* infobar,
22 InfoBarCocoa* infobar_cocoa = static_cast<InfoBarCocoa*>(infobar);
23 [controller_ addInfoBar:infobar_cocoa position:position];
26 void InfoBarContainerCocoa::PlatformSpecificRemoveInfoBar(InfoBar* infobar) {
27 InfoBarCocoa* infobar_cocoa = static_cast<InfoBarCocoa*>(infobar);
28 [controller_ removeInfoBar:infobar_cocoa];
31 SkColor InfoBarContainerCocoa::GetInfoBarSeparatorColor() const {
35 void InfoBarContainerCocoa::InfoBarContainerStateChanged(bool is_animating) {
36 [controller_ positionInfoBarsAndRedraw:is_animating];
39 bool InfoBarContainerCocoa::DrawInfoBarArrows(int* x) const {
41 *x = [controller_ infobarArrowX];
42 return ![controller_ shouldSuppressTopInfoBarTip];