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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // Caller must arrange to update the layout to have the call take effect. | 52 // Caller must arrange to update the layout to have the call take effect. |
53 void SetTitleFontList(const gfx::FontList& font_list); | 53 void SetTitleFontList(const gfx::FontList& font_list); |
54 | 54 |
55 // View overrides: | 55 // View overrides: |
56 gfx::Insets GetInsets() const override; | 56 gfx::Insets GetInsets() const override; |
57 gfx::Size GetPreferredSize() const override; | 57 gfx::Size GetPreferredSize() const override; |
58 gfx::Size GetMinimumSize() const override; | 58 gfx::Size GetMinimumSize() const override; |
59 gfx::Size GetMaximumSize() const override; | 59 gfx::Size GetMaximumSize() const override; |
60 void Layout() override; | 60 void Layout() override; |
61 const char* GetClassName() const override; | 61 const char* GetClassName() const override; |
62 void ChildPreferredSizeChanged(View* child) override; | |
63 void OnThemeChanged() override; | 62 void OnThemeChanged() override; |
64 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 63 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
65 | 64 |
66 // Overridden from ButtonListener: | 65 // Overridden from ButtonListener: |
67 void ButtonPressed(Button* sender, const ui::Event& event) override; | 66 void ButtonPressed(Button* sender, const ui::Event& event) override; |
68 | 67 |
69 // Use bubble_border() and SetBubbleBorder(), not border() and SetBorder(). | 68 // Use bubble_border() and SetBubbleBorder(), not border() and SetBorder(). |
70 BubbleBorder* bubble_border() const { return bubble_border_; } | 69 BubbleBorder* bubble_border() const { return bubble_border_; } |
71 void SetBubbleBorder(scoped_ptr<BubbleBorder> border); | 70 void SetBubbleBorder(scoped_ptr<BubbleBorder> border); |
72 | 71 |
73 gfx::Insets content_margins() const { return content_margins_; } | 72 gfx::Insets content_margins() const { return content_margins_; } |
74 | 73 |
75 void SetTitlebarExtraView(scoped_ptr<View> view); | 74 void SetFootnoteView(View* view); |
76 | |
77 void SetFootnoteView(scoped_ptr<View> view); | |
78 | 75 |
79 // Given the size of the contents and the rect to point at, returns the bounds | 76 // Given the size of the contents and the rect to point at, returns the bounds |
80 // of the bubble window. The bubble's arrow location may change if the bubble | 77 // of the bubble window. The bubble's arrow location may change if the bubble |
81 // does not fit on the monitor and |adjust_if_offscreen| is true. | 78 // does not fit on the monitor and |adjust_if_offscreen| is true. |
82 gfx::Rect GetUpdatedWindowBounds(const gfx::Rect& anchor_rect, | 79 gfx::Rect GetUpdatedWindowBounds(const gfx::Rect& anchor_rect, |
83 gfx::Size client_size, | 80 gfx::Size client_size, |
84 bool adjust_if_offscreen); | 81 bool adjust_if_offscreen); |
85 | 82 |
86 bool close_button_clicked() const { return close_button_clicked_; } | 83 bool close_button_clicked() const { return close_button_clicked_; } |
87 | 84 |
(...skipping 29 matching lines...) Expand all Loading... |
117 gfx::Insets title_margins_; | 114 gfx::Insets title_margins_; |
118 | 115 |
119 // Margins between the content and the inside of the border, in pixels. | 116 // Margins between the content and the inside of the border, in pixels. |
120 gfx::Insets content_margins_; | 117 gfx::Insets content_margins_; |
121 | 118 |
122 // The optional title icon, title, and (x) close button. | 119 // The optional title icon, title, and (x) close button. |
123 views::ImageView* title_icon_; | 120 views::ImageView* title_icon_; |
124 Label* title_; | 121 Label* title_; |
125 LabelButton* close_; | 122 LabelButton* close_; |
126 | 123 |
127 // When supplied, this view is placed in the titlebar between the title and | |
128 // (x) close button. | |
129 View* titlebar_extra_view_; | |
130 | |
131 // A view to contain the footnote view, if it exists. | 124 // A view to contain the footnote view, if it exists. |
132 View* footnote_container_; | 125 View* footnote_container_; |
133 | 126 |
134 // Whether the close button was clicked. | 127 // Whether the close button was clicked. |
135 bool close_button_clicked_; | 128 bool close_button_clicked_; |
136 | 129 |
137 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); | 130 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); |
138 }; | 131 }; |
139 | 132 |
140 } // namespace views | 133 } // namespace views |
141 | 134 |
142 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ | 135 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ |
OLD | NEW |