| 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/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class BubbleBorder; | 23 class BubbleBorder; |
| 24 | 24 |
| 25 // The non-client frame view of bubble-styled widgets. | 25 // The non-client frame view of bubble-styled widgets. |
| 26 class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView, | 26 class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView, |
| 27 public ButtonListener { | 27 public ButtonListener { |
| 28 public: | 28 public: |
| 29 // Internal class name. | 29 // Internal class name. |
| 30 static const char kViewClassName[]; | 30 static const char kViewClassName[]; |
| 31 | 31 |
| 32 explicit BubbleFrameView(const gfx::Insets& content_margins); | 32 explicit BubbleFrameView(const gfx::Insets& content_margins); |
| 33 virtual ~BubbleFrameView(); | 33 ~BubbleFrameView() override; |
| 34 | 34 |
| 35 // Insets to make bubble contents align horizontal with the bubble title. | 35 // Insets to make bubble contents align horizontal with the bubble title. |
| 36 // NOTE: this does not take into account whether a title actually exists. | 36 // NOTE: this does not take into account whether a title actually exists. |
| 37 static gfx::Insets GetTitleInsets(); | 37 static gfx::Insets GetTitleInsets(); |
| 38 | 38 |
| 39 // Creates a close button used in the corner of the dialog. | 39 // Creates a close button used in the corner of the dialog. |
| 40 static LabelButton* CreateCloseButton(ButtonListener* listener); | 40 static LabelButton* CreateCloseButton(ButtonListener* listener); |
| 41 | 41 |
| 42 // NonClientFrameView overrides: | 42 // NonClientFrameView overrides: |
| 43 virtual gfx::Rect GetBoundsForClientView() const override; | 43 gfx::Rect GetBoundsForClientView() const override; |
| 44 virtual gfx::Rect GetWindowBoundsForClientBounds( | 44 gfx::Rect GetWindowBoundsForClientBounds( |
| 45 const gfx::Rect& client_bounds) const override; | 45 const gfx::Rect& client_bounds) const override; |
| 46 virtual int NonClientHitTest(const gfx::Point& point) override; | 46 int NonClientHitTest(const gfx::Point& point) override; |
| 47 virtual void GetWindowMask(const gfx::Size& size, | 47 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; |
| 48 gfx::Path* window_mask) override; | 48 void ResetWindowControls() override; |
| 49 virtual void ResetWindowControls() override; | 49 void UpdateWindowIcon() override; |
| 50 virtual void UpdateWindowIcon() override; | 50 void UpdateWindowTitle() override; |
| 51 virtual void UpdateWindowTitle() override; | 51 void SizeConstraintsChanged() override; |
| 52 virtual void SizeConstraintsChanged() override; | |
| 53 | 52 |
| 54 // Set the FontList to be used for the title of the bubble. | 53 // Set the FontList to be used for the title of the bubble. |
| 55 // Caller must arrange to update the layout to have the call take effect. | 54 // Caller must arrange to update the layout to have the call take effect. |
| 56 void SetTitleFontList(const gfx::FontList& font_list); | 55 void SetTitleFontList(const gfx::FontList& font_list); |
| 57 | 56 |
| 58 // View overrides: | 57 // View overrides: |
| 59 virtual gfx::Insets GetInsets() const override; | 58 gfx::Insets GetInsets() const override; |
| 60 virtual gfx::Size GetPreferredSize() const override; | 59 gfx::Size GetPreferredSize() const override; |
| 61 virtual gfx::Size GetMinimumSize() const override; | 60 gfx::Size GetMinimumSize() const override; |
| 62 virtual void Layout() override; | 61 void Layout() override; |
| 63 virtual const char* GetClassName() const override; | 62 const char* GetClassName() const override; |
| 64 virtual void ChildPreferredSizeChanged(View* child) override; | 63 void ChildPreferredSizeChanged(View* child) override; |
| 65 virtual void OnThemeChanged() override; | 64 void OnThemeChanged() override; |
| 66 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 65 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
| 67 | 66 |
| 68 // Overridden from ButtonListener: | 67 // Overridden from ButtonListener: |
| 69 virtual void ButtonPressed(Button* sender, const ui::Event& event) override; | 68 void ButtonPressed(Button* sender, const ui::Event& event) override; |
| 70 | 69 |
| 71 // Use bubble_border() and SetBubbleBorder(), not border() and SetBorder(). | 70 // Use bubble_border() and SetBubbleBorder(), not border() and SetBorder(). |
| 72 BubbleBorder* bubble_border() const { return bubble_border_; } | 71 BubbleBorder* bubble_border() const { return bubble_border_; } |
| 73 void SetBubbleBorder(scoped_ptr<BubbleBorder> border); | 72 void SetBubbleBorder(scoped_ptr<BubbleBorder> border); |
| 74 | 73 |
| 75 gfx::Insets content_margins() const { return content_margins_; } | 74 gfx::Insets content_margins() const { return content_margins_; } |
| 76 | 75 |
| 77 void SetTitlebarExtraView(View* view); | 76 void SetTitlebarExtraView(View* view); |
| 78 | 77 |
| 79 // Given the size of the contents and the rect to point at, returns the bounds | 78 // Given the size of the contents and the rect to point at, returns the bounds |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // When supplied, this view is placed in the titlebar between the title and | 119 // When supplied, this view is placed in the titlebar between the title and |
| 121 // (x) close button. | 120 // (x) close button. |
| 122 View* titlebar_extra_view_; | 121 View* titlebar_extra_view_; |
| 123 | 122 |
| 124 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); | 123 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); |
| 125 }; | 124 }; |
| 126 | 125 |
| 127 } // namespace views | 126 } // namespace views |
| 128 | 127 |
| 129 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ | 128 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ |
| OLD | NEW |