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_UI_VIEWS_INFOBARS_INFOBAR_CONTAINER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_CONTAINER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_CONTAINER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_CONTAINER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 }; | 36 }; |
37 | 37 |
38 explicit InfoBarContainer(Delegate* delegate); | 38 explicit InfoBarContainer(Delegate* delegate); |
39 virtual ~InfoBarContainer(); | 39 virtual ~InfoBarContainer(); |
40 | 40 |
41 // Changes the TabContents for which this container is showing infobars. This | 41 // Changes the TabContents for which this container is showing infobars. This |
42 // will remove all current infobars from the container, add the infobars from | 42 // will remove all current infobars from the container, add the infobars from |
43 // |contents|, and show them all. |contents| may be NULL. | 43 // |contents|, and show them all. |contents| may be NULL. |
44 void ChangeTabContents(TabContents* contents); | 44 void ChangeTabContents(TabContents* contents); |
45 | 45 |
46 // Called when a contained infobar has animated. The container is expected to | 46 // Called when a contained infobar has animated or by some other means changed |
47 // do anything necessary to respond to the infobar's possible size change, | 47 // its size. The container is expected to do anything necessary to respond, |
48 // e.g. re-layout. | 48 // e.g. re-layout. |
49 void OnInfoBarAnimated(bool done); | 49 void OnInfoBarSizeChanged(bool is_animating); |
50 | 50 |
51 // Remove the specified InfoBarDelegate from the selected TabContents. This | 51 // Remove the specified InfoBarDelegate from the selected TabContents. This |
52 // will notify us back and cause us to close the InfoBar. This is called from | 52 // will notify us back and cause us to close the InfoBar. This is called from |
53 // the InfoBar's close button handler. | 53 // the InfoBar's close button handler. |
54 void RemoveDelegate(InfoBarDelegate* delegate); | 54 void RemoveDelegate(InfoBarDelegate* delegate); |
55 | 55 |
56 // Called by |infobar| to request that it be removed from the container, as it | 56 // Called by |infobar| to request that it be removed from the container, as it |
57 // is about to delete itself. At this point, |infobar| should already be | 57 // is about to delete itself. At this point, |infobar| should already be |
58 // hidden. | 58 // hidden. |
59 void RemoveInfoBar(InfoBar* infobar); | 59 void RemoveInfoBar(InfoBar* infobar); |
60 | 60 |
| 61 // Return the amount by which to overlap the toolbar above, so that the |
| 62 // InfoBars inside may draw anti-spoof arrows atop it. |
| 63 virtual int GetVerticalOverlap() = 0; |
| 64 |
61 protected: | 65 protected: |
62 // These must be implemented on each platform to e.g. adjust the visible | 66 // These must be implemented on each platform to e.g. adjust the visible |
63 // object hierarchy. | 67 // object hierarchy. |
64 virtual void PlatformSpecificAddInfoBar(InfoBar* infobar) = 0; | 68 virtual void PlatformSpecificAddInfoBar(InfoBar* infobar) = 0; |
65 virtual void PlatformSpecificRemoveInfoBar(InfoBar* infobar) = 0; | 69 virtual void PlatformSpecificRemoveInfoBar(InfoBar* infobar) = 0; |
66 | 70 |
67 private: | 71 private: |
68 typedef std::set<InfoBar*> InfoBars; | 72 typedef std::set<InfoBar*> InfoBars; |
69 | 73 |
70 // NotificationObserver: | 74 // NotificationObserver: |
(...skipping 18 matching lines...) Expand all Loading... |
89 | 93 |
90 NotificationRegistrar registrar_; | 94 NotificationRegistrar registrar_; |
91 Delegate* delegate_; | 95 Delegate* delegate_; |
92 TabContents* tab_contents_; | 96 TabContents* tab_contents_; |
93 InfoBars infobars_; | 97 InfoBars infobars_; |
94 | 98 |
95 DISALLOW_COPY_AND_ASSIGN(InfoBarContainer); | 99 DISALLOW_COPY_AND_ASSIGN(InfoBarContainer); |
96 }; | 100 }; |
97 | 101 |
98 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_CONTAINER_H_ | 102 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_CONTAINER_H_ |
OLD | NEW |