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_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_CONTAINER_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_CONTAINER_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_CONTAINER_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/ui/views/accessible_pane_view.h" | 9 #include "chrome/browser/ui/views/accessible_pane_view.h" |
10 #include "chrome/browser/ui/views/infobars/infobar_container.h" | 10 #include "chrome/browser/ui/views/infobars/infobar_container.h" |
11 | 11 |
12 // The views-specific implementation of InfoBarContainer. | 12 // The views-specific implementation of InfoBarContainer. |
13 class InfoBarContainerView : public AccessiblePaneView, | 13 class InfoBarContainerView : public AccessiblePaneView, |
14 public InfoBarContainer { | 14 public InfoBarContainer { |
15 public: | 15 public: |
16 explicit InfoBarContainerView(Delegate* delegate); | 16 explicit InfoBarContainerView(Delegate* delegate); |
17 virtual ~InfoBarContainerView(); | 17 virtual ~InfoBarContainerView(); |
18 | 18 |
19 // Overlap the previous view by this amount, vertically, so that the | 19 virtual int GetVerticalOverlap() OVERRIDE; |
20 // first InfoBarView in this InfoBarContainer may draw its tab on | |
21 // top. | |
22 int VerticalOverlap(); | |
23 | 20 |
24 private: | 21 private: |
25 // AccessiblePaneView: | 22 // AccessiblePaneView: |
26 virtual gfx::Size GetPreferredSize() OVERRIDE; | 23 virtual gfx::Size GetPreferredSize() OVERRIDE; |
27 virtual void Layout() OVERRIDE; | 24 virtual void Layout() OVERRIDE; |
28 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 25 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
29 | 26 |
30 // InfobarContainer: | 27 // InfobarContainer: |
31 virtual void PlatformSpecificAddInfoBar(InfoBar* infobar) OVERRIDE; | 28 virtual void PlatformSpecificAddInfoBar(InfoBar* infobar) OVERRIDE; |
32 virtual void PlatformSpecificRemoveInfoBar(InfoBar* infobar) OVERRIDE; | 29 virtual void PlatformSpecificRemoveInfoBar(InfoBar* infobar) OVERRIDE; |
33 | 30 |
34 // Return the maximum vertical overlap of the InfoBarContainer's children, | 31 // Return the amount by which to overlap the toolbar above, and, when |
35 // and, when |total_height| is non-NULL, set the |*total_height| of the | 32 // |total_height| is non-NULL, set it to the height of the InfoBarContainer |
36 // InfoBarContainer. | 33 // (including overlap). |
37 int GetVerticalOverlap(int* total_height); | 34 int GetVerticalOverlap(int* total_height); |
38 | 35 |
39 DISALLOW_COPY_AND_ASSIGN(InfoBarContainerView); | 36 DISALLOW_COPY_AND_ASSIGN(InfoBarContainerView); |
40 }; | 37 }; |
41 | 38 |
42 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_CONTAINER_VIEW_H_ | 39 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_CONTAINER_VIEW_H_ |
OLD | NEW |