OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ | 5 #ifndef UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ |
6 #define UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ | 6 #define UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 const char* GetClassName() const override; | 56 const char* GetClassName() const override; |
57 gfx::Insets GetInsets() const override; | 57 gfx::Insets GetInsets() const override; |
58 gfx::Size GetPreferredSize() const override; | 58 gfx::Size GetPreferredSize() const override; |
59 gfx::Size GetMinimumSize() const override; | 59 gfx::Size GetMinimumSize() const override; |
60 gfx::Size GetMaximumSize() const override; | 60 gfx::Size GetMaximumSize() const override; |
61 void Layout() override; | 61 void Layout() override; |
62 void OnPaint(gfx::Canvas* canvas) override; | 62 void OnPaint(gfx::Canvas* canvas) override; |
63 void PaintChildren(const ui::PaintContext& context) override; | 63 void PaintChildren(const ui::PaintContext& context) override; |
64 void OnThemeChanged() override; | 64 void OnThemeChanged() override; |
65 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 65 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
| 66 void ViewHierarchyChanged( |
| 67 const ViewHierarchyChangedDetails& details) override; |
66 | 68 |
67 // ButtonListener: | 69 // ButtonListener: |
68 void ButtonPressed(Button* sender, const ui::Event& event) override; | 70 void ButtonPressed(Button* sender, const ui::Event& event) override; |
69 | 71 |
70 // Use bubble_border() and SetBubbleBorder(), not border() and SetBorder(). | 72 // Use bubble_border() and SetBubbleBorder(), not border() and SetBorder(). |
71 BubbleBorder* bubble_border() const { return bubble_border_; } | 73 BubbleBorder* bubble_border() const { return bubble_border_; } |
72 void SetBubbleBorder(std::unique_ptr<BubbleBorder> border); | 74 void SetBubbleBorder(std::unique_ptr<BubbleBorder> border); |
73 | 75 |
74 gfx::Insets content_margins() const { return content_margins_; } | 76 gfx::Insets content_margins() const { return content_margins_; } |
75 | 77 |
(...skipping 12 matching lines...) Expand all Loading... |
88 | 90 |
89 protected: | 91 protected: |
90 // Returns the available screen bounds if the frame were to show in |rect|. | 92 // Returns the available screen bounds if the frame were to show in |rect|. |
91 virtual gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect) const; | 93 virtual gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect) const; |
92 | 94 |
93 bool IsCloseButtonVisible() const; | 95 bool IsCloseButtonVisible() const; |
94 gfx::Rect GetCloseButtonMirroredBounds() const; | 96 gfx::Rect GetCloseButtonMirroredBounds() const; |
95 | 97 |
96 private: | 98 private: |
97 FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest, GetBoundsForClientView); | 99 FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest, GetBoundsForClientView); |
| 100 FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest, RemoveFootnoteView); |
98 FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, CloseReasons); | 101 FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, CloseReasons); |
99 FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateTest, CloseMethods); | 102 FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateTest, CloseMethods); |
100 | 103 |
101 // Mirrors the bubble's arrow location on the |vertical| or horizontal axis, | 104 // Mirrors the bubble's arrow location on the |vertical| or horizontal axis, |
102 // if the generated window bounds don't fit in the monitor bounds. | 105 // if the generated window bounds don't fit in the monitor bounds. |
103 void MirrorArrowIfOffScreen(bool vertical, | 106 void MirrorArrowIfOffScreen(bool vertical, |
104 const gfx::Rect& anchor_rect, | 107 const gfx::Rect& anchor_rect, |
105 const gfx::Size& client_size); | 108 const gfx::Size& client_size); |
106 | 109 |
107 // Adjust the bubble's arrow offsets if the generated window bounds don't fit | 110 // Adjust the bubble's arrow offsets if the generated window bounds don't fit |
(...skipping 23 matching lines...) Expand all Loading... |
131 | 134 |
132 // Whether the close button was clicked. | 135 // Whether the close button was clicked. |
133 bool close_button_clicked_; | 136 bool close_button_clicked_; |
134 | 137 |
135 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); | 138 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); |
136 }; | 139 }; |
137 | 140 |
138 } // namespace views | 141 } // namespace views |
139 | 142 |
140 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ | 143 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ |
OLD | NEW |