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 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "components/infobars/core/infobar_container.h" | 11 #include "components/infobars/core/infobar_container.h" |
12 #include "ui/views/accessible_pane_view.h" | 12 #include "ui/views/accessible_pane_view.h" |
13 #include "ui/views/view_targeter_delegate.h" | 13 #include "ui/views/view_targeter_delegate.h" |
14 | 14 |
15 // The views-specific implementation of InfoBarContainer. | 15 // The views-specific implementation of InfoBarContainer. |
16 class InfoBarContainerView : public views::AccessiblePaneView, | 16 class InfoBarContainerView : public views::AccessiblePaneView, |
17 public infobars::InfoBarContainer, | 17 public infobars::InfoBarContainer { |
18 public views::ViewTargeterDelegate { | |
19 public: | 18 public: |
20 static const char kViewClassName[]; | 19 static const char kViewClassName[]; |
21 | 20 |
22 explicit InfoBarContainerView(Delegate* delegate); | 21 explicit InfoBarContainerView(Delegate* delegate); |
23 ~InfoBarContainerView() override; | 22 ~InfoBarContainerView() override; |
24 | 23 |
25 private: | |
26 // AccessiblePaneView: | 24 // AccessiblePaneView: |
27 gfx::Size GetPreferredSize() const override; | 25 gfx::Size GetPreferredSize() const override; |
28 const char* GetClassName() const override; | 26 const char* GetClassName() const override; |
29 void Layout() override; | 27 void Layout() override; |
30 void GetAccessibleState(ui::AXViewState* state) override; | 28 void GetAccessibleState(ui::AXViewState* state) override; |
31 | 29 |
32 // InfobarContainer: | 30 // InfobarContainer: |
33 void PlatformSpecificAddInfoBar(infobars::InfoBar* infobar, | 31 void PlatformSpecificAddInfoBar(infobars::InfoBar* infobar, |
34 size_t position) override; | 32 size_t position) override; |
35 void PlatformSpecificRemoveInfoBar(infobars::InfoBar* infobar) override; | 33 void PlatformSpecificRemoveInfoBar(infobars::InfoBar* infobar) override; |
36 | 34 |
37 // ViewTargeterDelegate: | 35 private: |
38 bool DoesIntersectRect(const View* target, | 36 // This view draws the shadow over the web contents below the |
39 const gfx::Rect& rect) const override; | 37 // lowest infobar. A separate view with a layer is used so it can |
| 38 // draw outside the bounds of |this|. |
| 39 views::View* content_shadow_; |
40 | 40 |
41 DISALLOW_COPY_AND_ASSIGN(InfoBarContainerView); | 41 DISALLOW_COPY_AND_ASSIGN(InfoBarContainerView); |
42 }; | 42 }; |
43 | 43 |
44 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_CONTAINER_VIEW_H_ | 44 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_CONTAINER_VIEW_H_ |
OLD | NEW |