OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_WIDGET_WIDGET_H_ | 5 #ifndef VIEWS_WIDGET_WIDGET_H_ |
6 #define VIEWS_WIDGET_WIDGET_H_ | 6 #define VIEWS_WIDGET_WIDGET_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <stack> | 9 #include <stack> |
10 | 10 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 // Returns the bounds of the Widget's client area in screen coordinates. | 290 // Returns the bounds of the Widget's client area in screen coordinates. |
291 gfx::Rect GetClientAreaScreenBounds() const; | 291 gfx::Rect GetClientAreaScreenBounds() const; |
292 | 292 |
293 // Retrieves the restored bounds for the window. | 293 // Retrieves the restored bounds for the window. |
294 gfx::Rect GetRestoredBounds() const; | 294 gfx::Rect GetRestoredBounds() const; |
295 | 295 |
296 // Sizes and/or places the widget to the specified bounds, size or position. | 296 // Sizes and/or places the widget to the specified bounds, size or position. |
297 void SetBounds(const gfx::Rect& bounds); | 297 void SetBounds(const gfx::Rect& bounds); |
298 void SetSize(const gfx::Size& size); | 298 void SetSize(const gfx::Size& size); |
299 | 299 |
300 // Like SetBounds(), but ensures the Widget is fully visible within the bounds | 300 // Like SetBounds(), but ensures the Widget is fully visible on screen, |
301 // of its parent. If the Widget has no parent, it is centered within the | 301 // resizing and/or repositioning as necessary. This is only useful for |
302 // bounds of its screen if it is visible, or |other_widget|'s screen if it is | 302 // non-child widgets. |
303 // not. | 303 void SetBoundsConstrained(const gfx::Rect& bounds); |
304 void SetBoundsConstrained(const gfx::Rect& bounds, | |
305 Widget* other_widget); | |
306 | 304 |
307 // Places the widget in front of the specified widget in z-order. | 305 // Places the widget in front of the specified widget in z-order. |
308 void MoveAboveWidget(Widget* widget); | 306 void MoveAboveWidget(Widget* widget); |
309 void MoveAbove(gfx::NativeView native_view); | 307 void MoveAbove(gfx::NativeView native_view); |
310 void MoveToTop(); | 308 void MoveToTop(); |
311 | 309 |
312 // Sets a shape on the widget. This takes ownership of shape. | 310 // Sets a shape on the widget. This takes ownership of shape. |
313 void SetShape(gfx::NativeRegion shape); | 311 void SetShape(gfx::NativeRegion shape); |
314 | 312 |
315 // Hides the widget then closes it after a return to the message loop. | 313 // Hides the widget then closes it after a return to the message loop. |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 // duplicate move events even though the mouse hasn't moved. | 738 // duplicate move events even though the mouse hasn't moved. |
741 bool last_mouse_event_was_move_; | 739 bool last_mouse_event_was_move_; |
742 gfx::Point last_mouse_event_position_; | 740 gfx::Point last_mouse_event_position_; |
743 | 741 |
744 DISALLOW_COPY_AND_ASSIGN(Widget); | 742 DISALLOW_COPY_AND_ASSIGN(Widget); |
745 }; | 743 }; |
746 | 744 |
747 } // namespace views | 745 } // namespace views |
748 | 746 |
749 #endif // VIEWS_WIDGET_WIDGET_H_ | 747 #endif // VIEWS_WIDGET_WIDGET_H_ |
OLD | NEW |