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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 Widget(); | 84 Widget(); |
85 virtual ~Widget(); | 85 virtual ~Widget(); |
86 | 86 |
87 // Creates a Widget instance suitable for use as a transient popup. | 87 // Creates a Widget instance suitable for use as a transient popup. |
88 static Widget* CreatePopupWidget(const CreateParams& params); | 88 static Widget* CreatePopupWidget(const CreateParams& params); |
89 | 89 |
90 // Enumerates all windows pertaining to us and notifies their | 90 // Enumerates all windows pertaining to us and notifies their |
91 // view hierarchies that the locale has changed. | 91 // view hierarchies that the locale has changed. |
92 static void NotifyLocaleChanged(); | 92 static void NotifyLocaleChanged(); |
93 | 93 |
| 94 // Converts a rectangle from one Widget's coordinate system to another's. |
| 95 // Returns false if the conversion couldn't be made, because either these two |
| 96 // Widgets do not have a common ancestor or they are not on the screen yet. |
| 97 // The value of |*rect| won't be changed when false is returned. |
| 98 static bool ConvertRect(const Widget* source, |
| 99 const Widget* target, |
| 100 gfx::Rect* rect); |
| 101 |
94 // Unconverted methods ------------------------------------------------------- | 102 // Unconverted methods ------------------------------------------------------- |
95 | 103 |
96 // TODO(beng): | 104 // TODO(beng): |
97 // Widget subclasses are still implementing these methods by overriding from | 105 // Widget subclasses are still implementing these methods by overriding from |
98 // here rather than by implementing NativeWidget. | 106 // here rather than by implementing NativeWidget. |
99 | 107 |
100 // Initialize the Widget with a parent and an initial desired size. | 108 // Initialize the Widget with a parent and an initial desired size. |
101 // |contents_view| is the view that will be the single child of RootView | 109 // |contents_view| is the view that will be the single child of RootView |
102 // within this Widget. As contents_view is inserted into RootView's tree, | 110 // within this Widget. As contents_view is inserted into RootView's tree, |
103 // RootView assumes ownership of this view and cleaning it up. If you remove | 111 // RootView assumes ownership of this view and cleaning it up. If you remove |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 338 |
331 // The compositor for accelerated drawing. | 339 // The compositor for accelerated drawing. |
332 scoped_refptr<ui::Compositor> compositor_; | 340 scoped_refptr<ui::Compositor> compositor_; |
333 | 341 |
334 DISALLOW_COPY_AND_ASSIGN(Widget); | 342 DISALLOW_COPY_AND_ASSIGN(Widget); |
335 }; | 343 }; |
336 | 344 |
337 } // namespace views | 345 } // namespace views |
338 | 346 |
339 #endif // VIEWS_WIDGET_WIDGET_H_ | 347 #endif // VIEWS_WIDGET_WIDGET_H_ |
OLD | NEW |