| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_INFOBAR_CONTAINER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_INFOBAR_CONTAINER_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_INFOBAR_CONTAINER_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_INFOBAR_CONTAINER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "components/infobars/core/infobar_container.h" | 11 #include "components/infobars/core/infobar_container.h" |
| 12 | 12 |
| 13 class InfoBarContainerDelegate : public infobars::InfoBarContainer::Delegate { | 13 class InfoBarContainerDelegate : public infobars::InfoBarContainer::Delegate { |
| 14 public: | 14 public: |
| 15 // TODO(estade): make some or all of these private. |
| 15 static const int kDefaultBarTargetHeight; | 16 static const int kDefaultBarTargetHeight; |
| 17 static const int kDefaultBarTargetHeightMd; |
| 16 static const int kSeparatorLineHeight; | 18 static const int kSeparatorLineHeight; |
| 17 static const int kDefaultArrowTargetHeight; | 19 static const int kDefaultArrowTargetHeight; |
| 20 static const int kDefaultArrowTargetHeightMd; |
| 18 static const int kMaximumArrowTargetHeight; | 21 static const int kMaximumArrowTargetHeight; |
| 19 static const int kDefaultArrowTargetHalfWidth; | 22 static const int kDefaultArrowTargetHalfWidth; |
| 23 static const int kDefaultArrowTargetHalfWidthMd; |
| 20 static const int kMaximumArrowTargetHalfWidth; | 24 static const int kMaximumArrowTargetHalfWidth; |
| 21 | 25 |
| 22 InfoBarContainerDelegate(); | 26 InfoBarContainerDelegate(); |
| 23 ~InfoBarContainerDelegate() override; | 27 ~InfoBarContainerDelegate() override; |
| 24 | 28 |
| 25 // Called when the distance between what the top infobar's "unspoofable" arrow | 29 // Called when the distance between what the top infobar's "unspoofable" arrow |
| 26 // would point to and the top infobar itself changes. Sets the maximum height | 30 // would point to and the top infobar itself changes. Sets the maximum height |
| 27 // of the top arrow to the new |height| and asks |container| to update its | 31 // of the top arrow to the new |height| and asks |container| to update its |
| 28 // infobars accordingly. This enables the top infobar to show a longer arrow | 32 // infobars accordingly. This enables the top infobar to show a longer arrow |
| 29 // (e.g. because of a visible bookmark bar) or shorter (e.g. due to being in a | 33 // (e.g. because of a visible bookmark bar) or shorter (e.g. due to being in a |
| (...skipping 11 matching lines...) Expand all Loading... |
| 41 int* arrow_half_width, | 45 int* arrow_half_width, |
| 42 int* bar_height) const override; | 46 int* bar_height) const override; |
| 43 | 47 |
| 44 private: | 48 private: |
| 45 int top_arrow_target_height_; | 49 int top_arrow_target_height_; |
| 46 | 50 |
| 47 DISALLOW_COPY_AND_ASSIGN(InfoBarContainerDelegate); | 51 DISALLOW_COPY_AND_ASSIGN(InfoBarContainerDelegate); |
| 48 }; | 52 }; |
| 49 | 53 |
| 50 #endif // CHROME_BROWSER_UI_INFOBAR_CONTAINER_DELEGATE_H_ | 54 #endif // CHROME_BROWSER_UI_INFOBAR_CONTAINER_DELEGATE_H_ |
| OLD | NEW |