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_WIDGET_WIDGET_H_ | 5 #ifndef UI_VIEWS_WIDGET_WIDGET_H_ |
6 #define UI_VIEWS_WIDGET_WIDGET_H_ | 6 #define UI_VIEWS_WIDGET_WIDGET_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <stack> | 9 #include <stack> |
10 #include <vector> | 10 #include <vector> |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 WidgetDelegate* widget_delegate() const { return widget_delegate_; } | 296 WidgetDelegate* widget_delegate() const { return widget_delegate_; } |
297 | 297 |
298 // Sets the specified view as the contents of this Widget. There can only | 298 // Sets the specified view as the contents of this Widget. There can only |
299 // be one contents view child of this Widget's RootView. This view is sized to | 299 // be one contents view child of this Widget's RootView. This view is sized to |
300 // fit the entire size of the RootView. The RootView takes ownership of this | 300 // fit the entire size of the RootView. The RootView takes ownership of this |
301 // View, unless it is set as not being parent-owned. | 301 // View, unless it is set as not being parent-owned. |
302 void SetContentsView(View* view); | 302 void SetContentsView(View* view); |
303 View* GetContentsView(); | 303 View* GetContentsView(); |
304 | 304 |
305 // Returns the bounds of the Widget in screen coordinates. | 305 // Returns the bounds of the Widget in screen coordinates. |
306 gfx::Rect GetWindowScreenBounds() const; | 306 gfx::Rect GetWindowBoundsInScreen() const; |
307 | 307 |
308 // Returns the bounds of the Widget's client area in screen coordinates. | 308 // Returns the bounds of the Widget's client area in screen coordinates. |
309 gfx::Rect GetClientAreaScreenBounds() const; | 309 gfx::Rect GetClientAreaBoundsInScreen() const; |
310 | 310 |
311 // Retrieves the restored bounds for the window. | 311 // Retrieves the restored bounds for the window. |
312 gfx::Rect GetRestoredBounds() const; | 312 gfx::Rect GetRestoredBounds() const; |
313 | 313 |
314 // Sizes and/or places the widget to the specified bounds, size or position. | 314 // Sizes and/or places the widget to the specified bounds, size or position. |
315 void SetBounds(const gfx::Rect& bounds); | 315 void SetBounds(const gfx::Rect& bounds); |
316 void SetSize(const gfx::Size& size); | 316 void SetSize(const gfx::Size& size); |
317 | 317 |
318 // Sizes the window to the specified size and centerizes it. | 318 // Sizes the window to the specified size and centerizes it. |
319 void CenterWindow(const gfx::Size& size); | 319 void CenterWindow(const gfx::Size& size); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 // if it exists and the root view otherwise. | 609 // if it exists and the root view otherwise. |
610 virtual View* GetChildViewParent(); | 610 virtual View* GetChildViewParent(); |
611 | 611 |
612 // True if the widget is considered top level widget. Top level widget | 612 // True if the widget is considered top level widget. Top level widget |
613 // is a widget of TYPE_WINDOW, TYPE_PANEL, TYPE_WINDOW_FRAMELESS, BUBBLE, | 613 // is a widget of TYPE_WINDOW, TYPE_PANEL, TYPE_WINDOW_FRAMELESS, BUBBLE, |
614 // POPUP or MENU, and has a focus manager and input method object associated | 614 // POPUP or MENU, and has a focus manager and input method object associated |
615 // with it. TYPE_CONTROL and TYPE_TOOLTIP is not considered top level. | 615 // with it. TYPE_CONTROL and TYPE_TOOLTIP is not considered top level. |
616 bool is_top_level() const { return is_top_level_; } | 616 bool is_top_level() const { return is_top_level_; } |
617 | 617 |
618 // Returns the work are bounds of the screen the Widget belongs to. | 618 // Returns the work are bounds of the screen the Widget belongs to. |
619 gfx::Rect GetWorkAreaScreenBounds() const; | 619 gfx::Rect GetWorkAreaBoundsInScreen() const; |
620 | 620 |
621 // Notification that our owner is closing. | 621 // Notification that our owner is closing. |
622 // NOTE: this is not invoked for aura as it's currently not needed there. | 622 // NOTE: this is not invoked for aura as it's currently not needed there. |
623 // Under aura menus close by way of activation getting reset when the owner | 623 // Under aura menus close by way of activation getting reset when the owner |
624 // closes. | 624 // closes. |
625 virtual void OnOwnerClosing(); | 625 virtual void OnOwnerClosing(); |
626 | 626 |
627 // Overridden from NativeWidgetDelegate: | 627 // Overridden from NativeWidgetDelegate: |
628 virtual bool IsModal() const OVERRIDE; | 628 virtual bool IsModal() const OVERRIDE; |
629 virtual bool IsDialogBox() const OVERRIDE; | 629 virtual bool IsDialogBox() const OVERRIDE; |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 | 804 |
805 // Is |root_layers_| out of date? | 805 // Is |root_layers_| out of date? |
806 bool root_layers_dirty_; | 806 bool root_layers_dirty_; |
807 | 807 |
808 DISALLOW_COPY_AND_ASSIGN(Widget); | 808 DISALLOW_COPY_AND_ASSIGN(Widget); |
809 }; | 809 }; |
810 | 810 |
811 } // namespace views | 811 } // namespace views |
812 | 812 |
813 #endif // UI_VIEWS_WIDGET_WIDGET_H_ | 813 #endif // UI_VIEWS_WIDGET_WIDGET_H_ |
OLD | NEW |