Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Side by Side Diff: ui/views/bubble/bubble_frame_view.h

Issue 22903022: Limit constrained windows to the size of the parent view. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: No initializer Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 28 matching lines...) Expand all
39 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; 39 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
40 virtual void GetWindowMask(const gfx::Size& size, 40 virtual void GetWindowMask(const gfx::Size& size,
41 gfx::Path* window_mask) OVERRIDE; 41 gfx::Path* window_mask) OVERRIDE;
42 virtual void ResetWindowControls() OVERRIDE; 42 virtual void ResetWindowControls() OVERRIDE;
43 virtual void UpdateWindowIcon() OVERRIDE; 43 virtual void UpdateWindowIcon() OVERRIDE;
44 virtual void UpdateWindowTitle() OVERRIDE; 44 virtual void UpdateWindowTitle() OVERRIDE;
45 45
46 // View overrides: 46 // View overrides:
47 virtual gfx::Insets GetInsets() const OVERRIDE; 47 virtual gfx::Insets GetInsets() const OVERRIDE;
48 virtual gfx::Size GetPreferredSize() OVERRIDE; 48 virtual gfx::Size GetPreferredSize() OVERRIDE;
49 virtual gfx::Size GetMinimumSize() OVERRIDE;
49 virtual void Layout() OVERRIDE; 50 virtual void Layout() OVERRIDE;
50 virtual const char* GetClassName() const OVERRIDE; 51 virtual const char* GetClassName() const OVERRIDE;
51 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; 52 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
52 53
53 // Overridden from ButtonListener: 54 // Overridden from ButtonListener:
54 virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE; 55 virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
55 56
56 // Use bubble_border() and SetBubbleBorder(), not border() and set_border(). 57 // Use bubble_border() and SetBubbleBorder(), not border() and set_border().
57 BubbleBorder* bubble_border() const { return bubble_border_; } 58 BubbleBorder* bubble_border() const { return bubble_border_; }
58 void SetBubbleBorder(BubbleBorder* border); 59 void SetBubbleBorder(BubbleBorder* border);
(...skipping 21 matching lines...) Expand all
80 // if the generated window bounds don't fit in the monitor bounds. 81 // if the generated window bounds don't fit in the monitor bounds.
81 void MirrorArrowIfOffScreen(bool vertical, 82 void MirrorArrowIfOffScreen(bool vertical,
82 const gfx::Rect& anchor_rect, 83 const gfx::Rect& anchor_rect,
83 const gfx::Size& client_size); 84 const gfx::Size& client_size);
84 85
85 // Adjust the bubble's arrow offsets if the generated window bounds don't fit 86 // Adjust the bubble's arrow offsets if the generated window bounds don't fit
86 // in the monitor bounds. 87 // in the monitor bounds.
87 void OffsetArrowIfOffScreen(const gfx::Rect& anchor_rect, 88 void OffsetArrowIfOffScreen(const gfx::Rect& anchor_rect,
88 const gfx::Size& client_size); 89 const gfx::Size& client_size);
89 90
91 // Calculates the size needed to accommodate the given client area.
92 gfx::Size GetSizeForClientSize(const gfx::Size& client_size);
93
90 // The bubble border. 94 // The bubble border.
91 BubbleBorder* bubble_border_; 95 BubbleBorder* bubble_border_;
92 96
93 // Margins between the content and the inside of the border, in pixels. 97 // Margins between the content and the inside of the border, in pixels.
94 gfx::Insets content_margins_; 98 gfx::Insets content_margins_;
95 99
96 // The optional title and (x) close button. 100 // The optional title and (x) close button.
97 Label* title_; 101 Label* title_;
98 LabelButton* close_; 102 LabelButton* close_;
99 103
100 // When supplied, this view is placed in the titlebar between the title and 104 // When supplied, this view is placed in the titlebar between the title and
101 // (x) close button. 105 // (x) close button.
102 View* titlebar_extra_view_; 106 View* titlebar_extra_view_;
103 107
104 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); 108 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView);
105 }; 109 };
106 110
107 } // namespace views 111 } // namespace views
108 112
109 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ 113 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_
OLDNEW
« no previous file with comments | « components/web_modal/web_contents_modal_dialog_host.h ('k') | ui/views/bubble/bubble_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698