1 // Copyright 2014 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 #ifndef CHROME_BROWSER_UI_INFOBAR_CONTAINER_DELEGATE_H_
6 #define CHROME_BROWSER_UI_INFOBAR_CONTAINER_DELEGATE_H_
8 #include "components/infobars/core/infobar_container.h"
10 class InfoBarContainerDelegate
: public infobars::InfoBarContainer::Delegate
{
12 static const int kDefaultBarTargetHeight
;
13 static const int kSeparatorLineHeight
;
14 static const int kDefaultArrowTargetHeight
;
15 static const int kMaximumArrowTargetHeight
;
16 static const int kDefaultArrowTargetHalfWidth
;
17 static const int kMaximumArrowTargetHalfWidth
;
19 InfoBarContainerDelegate();
20 ~InfoBarContainerDelegate() override
;
22 // Called when the distance between what the top infobar's "unspoofable" arrow
23 // would point to and the top infobar itself changes. Sets the maximum height
24 // of the top arrow to the new |height| and asks |container| to update its
25 // infobars accordingly. This enables the top infobar to show a longer arrow
26 // (e.g. because of a visible bookmark bar) or shorter (e.g. due to being in a
27 // popup window) if desired.
28 void SetMaxTopArrowHeight(int height
, infobars::InfoBarContainer
* container
);
30 // infobars::InfoBarContainer::Delegate:
31 int ArrowTargetHeightForInfoBar(
33 const gfx::SlideAnimation
& animation
) const override
;
34 void ComputeInfoBarElementSizes(const gfx::SlideAnimation
& animation
,
35 int arrow_target_height
,
36 int bar_target_height
,
38 int* arrow_half_width
,
39 int* bar_height
) const override
;
42 int top_arrow_target_height_
;
44 DISALLOW_COPY_AND_ASSIGN(InfoBarContainerDelegate
);
47 #endif // CHROME_BROWSER_UI_INFOBAR_CONTAINER_DELEGATE_H_