[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / infobars / infobar_container_cocoa.mm
blobcd9c907017ab12c90fffe476afc98f5bb54f589e
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,
22     size_t position) {
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 {
34   return SK_ColorBLACK;
37 void InfoBarContainerCocoa::InfoBarContainerStateChanged(bool is_animating) {
38   [controller_ positionInfoBarsAndRedraw:is_animating];
41 bool InfoBarContainerCocoa::DrawInfoBarArrows(int* x) const {
42   if (x)
43     *x = [controller_ infobarArrowX];
44   return ![controller_ shouldSuppressTopInfoBarTip];