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 : infobars::InfoBarContainer(this),
13 controller_(controller) {
16 InfoBarContainerCocoa::~InfoBarContainerCocoa() {
17 RemoveAllInfoBarsForDestruction();
20 void InfoBarContainerCocoa::PlatformSpecificAddInfoBar(
21 infobars::InfoBar* infobar,
23 InfoBarCocoa* infobar_cocoa = static_cast<InfoBarCocoa*>(infobar);
24 [controller_ addInfoBar:infobar_cocoa position:position];
27 void InfoBarContainerCocoa::PlatformSpecificRemoveInfoBar(
28 infobars::InfoBar* infobar) {
29 InfoBarCocoa* infobar_cocoa = static_cast<InfoBarCocoa*>(infobar);
30 [controller_ removeInfoBar:infobar_cocoa];
33 SkColor InfoBarContainerCocoa::GetInfoBarSeparatorColor() const {
37 void InfoBarContainerCocoa::InfoBarContainerStateChanged(bool is_animating) {
38 [controller_ positionInfoBarsAndRedraw:is_animating];
41 bool InfoBarContainerCocoa::DrawInfoBarArrows(int* x) const {
43 *x = [controller_ infobarArrowX];
44 return ![controller_ shouldSuppressTopInfoBarTip];