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

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

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/message_center/views/toast_contents_view.cc ('k') | ui/views/bubble/bubble_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_DELEGATE_H_ 5 #ifndef UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_
6 #define UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ 6 #define UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "ui/views/bubble/bubble_border.h" 9 #include "ui/views/bubble/bubble_border.h"
10 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 bool accept_events() const { return accept_events_; } 88 bool accept_events() const { return accept_events_; }
89 void set_accept_events(bool accept_events) { accept_events_ = accept_events; } 89 void set_accept_events(bool accept_events) { accept_events_ = accept_events; }
90 90
91 bool border_accepts_events() const { return border_accepts_events_; } 91 bool border_accepts_events() const { return border_accepts_events_; }
92 void set_border_accepts_events(bool event) { border_accepts_events_ = event; } 92 void set_border_accepts_events(bool event) { border_accepts_events_ = event; }
93 93
94 bool adjust_if_offscreen() const { return adjust_if_offscreen_; } 94 bool adjust_if_offscreen() const { return adjust_if_offscreen_; }
95 void set_adjust_if_offscreen(bool adjust) { adjust_if_offscreen_ = adjust; } 95 void set_adjust_if_offscreen(bool adjust) { adjust_if_offscreen_ = adjust; }
96 96
97 // Get the arrow's anchor rect in screen space. 97 // Get the arrow's anchor rect in screen space.
98 virtual gfx::Rect GetAnchorRect(); 98 virtual gfx::Rect GetAnchorRect() const;
99 99
100 // Allows delegates to provide custom parameters before widget initialization. 100 // Allows delegates to provide custom parameters before widget initialization.
101 virtual void OnBeforeBubbleWidgetInit(Widget::InitParams* params, 101 virtual void OnBeforeBubbleWidgetInit(Widget::InitParams* params,
102 Widget* widget) const; 102 Widget* widget) const;
103 103
104 // Sets the bubble alignment relative to the anchor. This may only be called 104 // Sets the bubble alignment relative to the anchor. This may only be called
105 // after calling CreateBubble. 105 // after calling CreateBubble.
106 void SetAlignment(BubbleBorder::BubbleAlignment alignment); 106 void SetAlignment(BubbleBorder::BubbleAlignment alignment);
107 107
108 // Sets the bubble arrow paint type. 108 // Sets the bubble arrow paint type.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 bool close_on_esc_; 153 bool close_on_esc_;
154 bool close_on_deactivate_; 154 bool close_on_deactivate_;
155 155
156 // The view and widget to which this bubble is anchored. Since an anchor view 156 // The view and widget to which this bubble is anchored. Since an anchor view
157 // can be deleted without notice, we store it in the ViewStorage and retrieve 157 // can be deleted without notice, we store it in the ViewStorage and retrieve
158 // it from there. It will make sure that the view is still valid. 158 // it from there. It will make sure that the view is still valid.
159 const int anchor_view_storage_id_; 159 const int anchor_view_storage_id_;
160 Widget* anchor_widget_; 160 Widget* anchor_widget_;
161 161
162 // The anchor rect used in the absence of an anchor view. 162 // The anchor rect used in the absence of an anchor view.
163 gfx::Rect anchor_rect_; 163 mutable gfx::Rect anchor_rect_;
164 164
165 // The arrow's location on the bubble. 165 // The arrow's location on the bubble.
166 BubbleBorder::Arrow arrow_; 166 BubbleBorder::Arrow arrow_;
167 167
168 // Bubble border shadow to use. 168 // Bubble border shadow to use.
169 BubbleBorder::Shadow shadow_; 169 BubbleBorder::Shadow shadow_;
170 170
171 // The background color of the bubble; and flag for when it's explicitly set. 171 // The background color of the bubble; and flag for when it's explicitly set.
172 SkColor color_; 172 SkColor color_;
173 bool color_explicitly_set_; 173 bool color_explicitly_set_;
(...skipping 17 matching lines...) Expand all
191 191
192 // Parent native window of the bubble. 192 // Parent native window of the bubble.
193 gfx::NativeView parent_window_; 193 gfx::NativeView parent_window_;
194 194
195 DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView); 195 DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView);
196 }; 196 };
197 197
198 } // namespace views 198 } // namespace views
199 199
200 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ 200 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_
OLDNEW
« no previous file with comments | « ui/message_center/views/toast_contents_view.cc ('k') | ui/views/bubble/bubble_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698