OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_INFOBAR_CONTAINER_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_INFOBAR_CONTAINER_DELEGATE_H_ |
| 7 |
| 8 #include "components/infobars/core/infobar_container.h" |
| 9 |
| 10 class InfoBarContainerDelegate : public infobars::InfoBarContainer::Delegate { |
| 11 public: |
| 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; |
| 18 |
| 19 InfoBarContainerDelegate(); |
| 20 ~InfoBarContainerDelegate() override; |
| 21 |
| 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); |
| 29 |
| 30 // infobars::InfoBarContainer::Delegate: |
| 31 int ArrowTargetHeightForInfoBar( |
| 32 size_t index, |
| 33 const gfx::SlideAnimation& animation) const override; |
| 34 void ComputeInfoBarElementSizes(const gfx::SlideAnimation& animation, |
| 35 int arrow_target_height, |
| 36 int bar_target_height, |
| 37 int* arrow_height, |
| 38 int* arrow_half_width, |
| 39 int* bar_height) const override; |
| 40 |
| 41 private: |
| 42 int top_arrow_target_height_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(InfoBarContainerDelegate); |
| 45 }; |
| 46 |
| 47 #endif // CHROME_BROWSER_UI_INFOBAR_CONTAINER_DELEGATE_H_ |
OLD | NEW |