OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TAB_CONTENTS_INFOBAR_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_INFOBAR_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_INFOBAR_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_INFOBAR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 int arrow_height() const { return arrow_height_; } | 72 int arrow_height() const { return arrow_height_; } |
73 int arrow_target_height() const { return arrow_target_height_; } | 73 int arrow_target_height() const { return arrow_target_height_; } |
74 int arrow_half_width() const { return arrow_half_width_; } | 74 int arrow_half_width() const { return arrow_half_width_; } |
75 int total_height() const { return arrow_height_ + bar_height_; } | 75 int total_height() const { return arrow_height_ + bar_height_; } |
76 | 76 |
77 protected: | 77 protected: |
78 // ui::AnimationDelegate: | 78 // ui::AnimationDelegate: |
79 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 79 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
80 | 80 |
81 // Forwards a close request to our owner. | 81 // Forwards a close request to our owner. |
| 82 // NOTE: Subclasses should not call this if we're already unowned. |
82 void RemoveSelf(); | 83 void RemoveSelf(); |
83 | 84 |
84 // Changes the target height of the main ("bar") portion of the infobar. | 85 // Changes the target height of the main ("bar") portion of the infobar. |
85 void SetBarTargetHeight(int height); | 86 void SetBarTargetHeight(int height); |
86 | 87 |
87 // Given a control with size |prefsize|, returns the centered y position | 88 // Given a control with size |prefsize|, returns the centered y position |
88 // within us, taking into account animation so the control "slides in" (or | 89 // within us, taking into account animation so the control "slides in" (or |
89 // out) as we animate open and closed. | 90 // out) as we animate open and closed. |
90 int OffsetY(const gfx::Size& prefsize) const; | 91 int OffsetY(const gfx::Size& prefsize) const; |
91 | 92 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 int bar_target_height_; | 134 int bar_target_height_; |
134 | 135 |
135 DISALLOW_COPY_AND_ASSIGN(InfoBar); | 136 DISALLOW_COPY_AND_ASSIGN(InfoBar); |
136 }; | 137 }; |
137 | 138 |
138 #elif defined(OS_MACOSX) | 139 #elif defined(OS_MACOSX) |
139 #include "chrome/browser/ui/cocoa/infobars/infobar.h" | 140 #include "chrome/browser/ui/cocoa/infobars/infobar.h" |
140 #endif | 141 #endif |
141 | 142 |
142 #endif // CHROME_BROWSER_TAB_CONTENTS_INFOBAR_H_ | 143 #endif // CHROME_BROWSER_TAB_CONTENTS_INFOBAR_H_ |
OLD | NEW |