Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / infobar_container_delegate.h
blobcd2335d45ecea1a2a0a3b0fd6afc7067c0b80920
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 {
11 public:
12 static const int kDefaultBarTargetHeight;
13 static const int kDefaultBarTargetHeightMd;
14 static const int kSeparatorLineHeight;
15 static const int kDefaultArrowTargetHeight;
16 static const int kMaximumArrowTargetHeight;
17 static const int kDefaultArrowTargetHalfWidth;
18 static const int kMaximumArrowTargetHalfWidth;
20 InfoBarContainerDelegate();
21 ~InfoBarContainerDelegate() override;
23 // Called when the distance between what the top infobar's "unspoofable" arrow
24 // would point to and the top infobar itself changes. Sets the maximum height
25 // of the top arrow to the new |height| and asks |container| to update its
26 // infobars accordingly. This enables the top infobar to show a longer arrow
27 // (e.g. because of a visible bookmark bar) or shorter (e.g. due to being in a
28 // popup window) if desired.
29 void SetMaxTopArrowHeight(int height, infobars::InfoBarContainer* container);
31 // infobars::InfoBarContainer::Delegate:
32 int ArrowTargetHeightForInfoBar(
33 size_t index,
34 const gfx::SlideAnimation& animation) const override;
35 void ComputeInfoBarElementSizes(const gfx::SlideAnimation& animation,
36 int arrow_target_height,
37 int bar_target_height,
38 int* arrow_height,
39 int* arrow_half_width,
40 int* bar_height) const override;
42 private:
43 int top_arrow_target_height_;
45 DISALLOW_COPY_AND_ASSIGN(InfoBarContainerDelegate);
48 #endif // CHROME_BROWSER_UI_INFOBAR_CONTAINER_DELEGATE_H_