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 AURA_WINDOW_H_ | 5 #ifndef AURA_WINDOW_H_ |
6 #define AURA_WINDOW_H_ | 6 #define AURA_WINDOW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 void SetParent(Window* parent); | 80 void SetParent(Window* parent); |
81 Window* parent() { return parent_; } | 81 Window* parent() { return parent_; } |
82 | 82 |
83 // Returns true if this Window is the container for toplevel windows. | 83 // Returns true if this Window is the container for toplevel windows. |
84 virtual bool IsTopLevelWindowContainer() const; | 84 virtual bool IsTopLevelWindowContainer() const; |
85 | 85 |
86 // Move the specified child of this Window to the front of the z-order. | 86 // Move the specified child of this Window to the front of the z-order. |
87 // TODO(beng): this is (obviously) feeble. | 87 // TODO(beng): this is (obviously) feeble. |
88 void MoveChildToFront(Window* child); | 88 void MoveChildToFront(Window* child); |
89 | 89 |
90 // Draw the window and its children. | |
91 void DrawTree(); | |
92 | |
93 // Tree operations. | 90 // Tree operations. |
94 // TODO(beng): Child windows are currently not owned by the hierarchy. We | 91 // TODO(beng): Child windows are currently not owned by the hierarchy. We |
95 // should change this. | 92 // should change this. |
96 void AddChild(Window* child); | 93 void AddChild(Window* child); |
97 void RemoveChild(Window* child); | 94 void RemoveChild(Window* child); |
98 | 95 |
99 static void ConvertPointToWindow(Window* source, | 96 static void ConvertPointToWindow(Window* source, |
100 Window* target, | 97 Window* target, |
101 gfx::Point* point); | 98 gfx::Point* point); |
102 | 99 |
(...skipping 23 matching lines...) Expand all Loading... |
126 // The Window does not own this object. | 123 // The Window does not own this object. |
127 void set_user_data(void* user_data) { user_data_ = user_data; } | 124 void set_user_data(void* user_data) { user_data_ = user_data; } |
128 void* user_data() const { return user_data_; } | 125 void* user_data() const { return user_data_; } |
129 | 126 |
130 private: | 127 private: |
131 typedef std::vector<Window*> Windows; | 128 typedef std::vector<Window*> Windows; |
132 | 129 |
133 // If SchedulePaint has been invoked on the Window the delegate is notified. | 130 // If SchedulePaint has been invoked on the Window the delegate is notified. |
134 void UpdateLayerCanvas(); | 131 void UpdateLayerCanvas(); |
135 | 132 |
136 // Draws the Window's contents. | |
137 void Draw(); | |
138 | |
139 // Schedules a paint for the Window's entire bounds. | 133 // Schedules a paint for the Window's entire bounds. |
140 void SchedulePaint(); | 134 void SchedulePaint(); |
141 | 135 |
142 // Overridden from ui::LayerDelegate: | 136 // Overridden from ui::LayerDelegate: |
143 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 137 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; |
144 | 138 |
145 WindowDelegate* delegate_; | 139 WindowDelegate* delegate_; |
146 | 140 |
147 Visibility visibility_; | 141 Visibility visibility_; |
148 | 142 |
149 scoped_ptr<ui::Layer> layer_; | 143 scoped_ptr<ui::Layer> layer_; |
150 | 144 |
151 // Bounds of the window in the desktop's coordinate system. | 145 // Bounds of the window in the desktop's coordinate system. |
152 gfx::Rect bounds_; | 146 gfx::Rect bounds_; |
153 | 147 |
154 // The Window's parent. | 148 // The Window's parent. |
155 // TODO(beng): Implement NULL-ness for toplevels. | 149 // TODO(beng): Implement NULL-ness for toplevels. |
156 Window* parent_; | 150 Window* parent_; |
157 | 151 |
158 // Child windows. Topmost is last. | 152 // Child windows. Topmost is last. |
159 Windows children_; | 153 Windows children_; |
160 | 154 |
161 int id_; | 155 int id_; |
162 | 156 |
163 scoped_ptr<WindowManager> window_manager_; | 157 scoped_ptr<WindowManager> window_manager_; |
164 | 158 |
165 void* user_data_; | 159 void* user_data_; |
166 | 160 |
167 DISALLOW_COPY_AND_ASSIGN(Window); | 161 DISALLOW_COPY_AND_ASSIGN(Window); |
168 }; | 162 }; |
169 | 163 |
170 } // namespace aura | 164 } // namespace aura |
171 | 165 |
172 #endif // AURA_WINDOW_H_ | 166 #endif // AURA_WINDOW_H_ |
OLD | NEW |