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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 static const int kDefaultArrowTargetHalfWidth; | 50 static const int kDefaultArrowTargetHalfWidth; |
51 static const int kMaximumArrowTargetHalfWidth; | 51 static const int kMaximumArrowTargetHalfWidth; |
52 | 52 |
53 explicit InfoBar(scoped_ptr<InfoBarDelegate> delegate); | 53 explicit InfoBar(scoped_ptr<InfoBarDelegate> delegate); |
54 virtual ~InfoBar(); | 54 virtual ~InfoBar(); |
55 | 55 |
56 static SkColor GetTopColor(InfoBarDelegate::Type infobar_type); | 56 static SkColor GetTopColor(InfoBarDelegate::Type infobar_type); |
57 static SkColor GetBottomColor(InfoBarDelegate::Type infobar_type); | 57 static SkColor GetBottomColor(InfoBarDelegate::Type infobar_type); |
58 | 58 |
59 InfoBarManager* owner() { return owner_; } | 59 InfoBarManager* owner() { return owner_; } |
60 InfoBarDelegate* delegate() { return delegate_.get(); } | 60 InfoBarDelegate* delegate() const { return delegate_.get(); } |
61 const InfoBarDelegate* delegate() const { return delegate_.get(); } | |
62 void set_container(InfoBarContainer* container) { container_ = container; } | 61 void set_container(InfoBarContainer* container) { container_ = container; } |
63 | 62 |
64 // Sets |owner_|. This also calls StoreActiveEntryUniqueID() on |delegate_|. | 63 // Sets |owner_|. This also calls StoreActiveEntryUniqueID() on |delegate_|. |
65 // This must only be called once as there's no way to extract an infobar from | 64 // This must only be called once as there's no way to extract an infobar from |
66 // its owner without deleting it, for reparenting in another tab. | 65 // its owner without deleting it, for reparenting in another tab. |
67 void SetOwner(InfoBarManager* owner); | 66 void SetOwner(InfoBarManager* owner); |
68 | 67 |
69 // Makes the infobar visible. If |animate| is true, the infobar is then | 68 // Makes the infobar visible. If |animate| is true, the infobar is then |
70 // animated to full size. | 69 // animated to full size. |
71 void Show(bool animate); | 70 void Show(bool animate); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 int arrow_half_width_; // Includes only fill. | 142 int arrow_half_width_; // Includes only fill. |
144 int bar_height_; // Includes both fill and bottom separator. | 143 int bar_height_; // Includes both fill and bottom separator. |
145 int bar_target_height_; | 144 int bar_target_height_; |
146 | 145 |
147 DISALLOW_COPY_AND_ASSIGN(InfoBar); | 146 DISALLOW_COPY_AND_ASSIGN(InfoBar); |
148 }; | 147 }; |
149 | 148 |
150 } // namespace infobars | 149 } // namespace infobars |
151 | 150 |
152 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_H_ | 151 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_H_ |
OLD | NEW |