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 COMPONENTS_INFOBARS_CORE_INFOBAR_H_ | 5 #ifndef COMPONENTS_INFOBARS_CORE_INFOBAR_H_ |
6 #define COMPONENTS_INFOBARS_CORE_INFOBAR_H_ | 6 #define COMPONENTS_INFOBARS_CORE_INFOBAR_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 explicit InfoBar(scoped_ptr<InfoBarDelegate> delegate); | 43 explicit InfoBar(scoped_ptr<InfoBarDelegate> delegate); |
44 ~InfoBar() override; | 44 ~InfoBar() override; |
45 | 45 |
46 static SkColor GetTopColor(InfoBarDelegate::Type infobar_type); | 46 static SkColor GetTopColor(InfoBarDelegate::Type infobar_type); |
47 static SkColor GetBottomColor(InfoBarDelegate::Type infobar_type); | 47 static SkColor GetBottomColor(InfoBarDelegate::Type infobar_type); |
48 | 48 |
49 InfoBarManager* owner() { return owner_; } | 49 InfoBarManager* owner() { return owner_; } |
50 InfoBarDelegate* delegate() const { return delegate_.get(); } | 50 InfoBarDelegate* delegate() const { return delegate_.get(); } |
51 void set_container(InfoBarContainer* container) { container_ = container; } | 51 void set_container(InfoBarContainer* container) { container_ = container; } |
52 | 52 |
53 // Sets |owner_|. This also calls StoreActiveEntryUniqueID() on |delegate_|. | 53 // Sets |owner_|. This must only be called once as there's no way to extract |
54 // This must only be called once as there's no way to extract an infobar from | 54 // an infobar from its owner without deleting it, for reparenting in another |
55 // its owner without deleting it, for reparenting in another tab. | 55 // tab. |
56 void SetOwner(InfoBarManager* owner); | 56 void SetOwner(InfoBarManager* owner); |
57 | 57 |
58 // Makes the infobar visible. If |animate| is true, the infobar is then | 58 // Makes the infobar visible. If |animate| is true, the infobar is then |
59 // animated to full size. | 59 // animated to full size. |
60 void Show(bool animate); | 60 void Show(bool animate); |
61 | 61 |
62 // Makes the infobar hidden. If |animate| is false, the infobar is | 62 // Makes the infobar hidden. If |animate| is false, the infobar is |
63 // immediately removed from the container, and, if now unowned, deleted. If | 63 // immediately removed from the container, and, if now unowned, deleted. If |
64 // |animate| is true, the infobar is animated to zero size, ultimately | 64 // |animate| is true, the infobar is animated to zero size, ultimately |
65 // triggering a call to AnimationEnded(). | 65 // triggering a call to AnimationEnded(). |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 int arrow_half_width_; // Includes only fill. | 133 int arrow_half_width_; // Includes only fill. |
134 int bar_height_; // Includes both fill and bottom separator. | 134 int bar_height_; // Includes both fill and bottom separator. |
135 int bar_target_height_; // May be left as -1, meaning "use default". | 135 int bar_target_height_; // May be left as -1, meaning "use default". |
136 | 136 |
137 DISALLOW_COPY_AND_ASSIGN(InfoBar); | 137 DISALLOW_COPY_AND_ASSIGN(InfoBar); |
138 }; | 138 }; |
139 | 139 |
140 } // namespace infobars | 140 } // namespace infobars |
141 | 141 |
142 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_H_ | 142 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_H_ |
OLD | NEW |