OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
8 #include "app/gfx/native_widget_types.h" | 8 #include "app/gfx/native_widget_types.h" |
9 | 9 |
10 class ThemeProvider; | 10 class ThemeProvider; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 enum DeleteParam { | 56 enum DeleteParam { |
57 DeleteOnDestroy, | 57 DeleteOnDestroy, |
58 NotDeleteOnDestroy | 58 NotDeleteOnDestroy |
59 }; | 59 }; |
60 | 60 |
61 // Creates a transient popup widget specific to the current platform. | 61 // Creates a transient popup widget specific to the current platform. |
62 static Widget* CreatePopupWidget(TransparencyParam transparent, | 62 static Widget* CreatePopupWidget(TransparencyParam transparent, |
63 EventsParam accept_events, | 63 EventsParam accept_events, |
64 DeleteParam delete_on_destroy); | 64 DeleteParam delete_on_destroy); |
65 | 65 |
| 66 // Returns the root view for |native_window|. If |native_window| does not have |
| 67 // a rootview, this recurses through all of |native_window|'s children until |
| 68 // one is found. If a root view isn't found, null is returned. |
| 69 static RootView* FindRootView(gfx::NativeWindow native_window); |
| 70 |
66 // Initialize the Widget with a parent and an initial desired size. | 71 // Initialize the Widget with a parent and an initial desired size. |
67 // |contents_view| is the view that will be the single child of RootView | 72 // |contents_view| is the view that will be the single child of RootView |
68 // within this Widget. As contents_view is inserted into RootView's tree, | 73 // within this Widget. As contents_view is inserted into RootView's tree, |
69 // RootView assumes ownership of this view and cleaning it up. If you remove | 74 // RootView assumes ownership of this view and cleaning it up. If you remove |
70 // this view, you are responsible for its destruction. If this value is NULL, | 75 // this view, you are responsible for its destruction. If this value is NULL, |
71 // the caller is responsible for populating the RootView, and sizing its | 76 // the caller is responsible for populating the RootView, and sizing its |
72 // contents as the window is sized. | 77 // contents as the window is sized. |
73 virtual void Init(gfx::NativeView parent, const gfx::Rect& bounds) = 0; | 78 virtual void Init(gfx::NativeView parent, const gfx::Rect& bounds) = 0; |
74 | 79 |
75 // Sets the specified view as the contents of this Widget. There can only | 80 // Sets the specified view as the contents of this Widget. There can only |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 virtual FocusManager* GetFocusManager() { return NULL; } | 172 virtual FocusManager* GetFocusManager() { return NULL; } |
168 | 173 |
169 // Forwarded from the RootView so that the widget can do any cleanup. | 174 // Forwarded from the RootView so that the widget can do any cleanup. |
170 virtual void ViewHierarchyChanged(bool is_add, View *parent, | 175 virtual void ViewHierarchyChanged(bool is_add, View *parent, |
171 View *child) = 0; | 176 View *child) = 0; |
172 }; | 177 }; |
173 | 178 |
174 } // namespace views | 179 } // namespace views |
175 | 180 |
176 #endif // VIEWS_WIDGET_WIDGET_H_ | 181 #endif // VIEWS_WIDGET_WIDGET_H_ |
OLD | NEW |