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 UI_AURA_WINDOW_H_ | 5 #ifndef UI_AURA_WINDOW_H_ |
6 #define UI_AURA_WINDOW_H_ | 6 #define UI_AURA_WINDOW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 virtual const ToplevelWindowContainer* AsToplevelWindowContainer() const; | 104 virtual const ToplevelWindowContainer* AsToplevelWindowContainer() const; |
105 | 105 |
106 // Assigns a LayoutManager to size and place child windows. | 106 // Assigns a LayoutManager to size and place child windows. |
107 // The Window takes ownership of the LayoutManager. | 107 // The Window takes ownership of the LayoutManager. |
108 void SetLayoutManager(LayoutManager* layout_manager); | 108 void SetLayoutManager(LayoutManager* layout_manager); |
109 | 109 |
110 // Changes the bounds of the window. | 110 // Changes the bounds of the window. |
111 void SetBounds(const gfx::Rect& new_bounds); | 111 void SetBounds(const gfx::Rect& new_bounds); |
112 const gfx::Rect& bounds() const; | 112 const gfx::Rect& bounds() const; |
113 | 113 |
114 // Sets the minimum size of the window that a user can resize to. | |
Ben Goodger (Google)
2011/10/14 15:40:05
can resize it to.
oshima
2011/10/15 02:10:50
Done.
| |
115 // A smaller size can still be set using SetBounds. | |
Ben Goodger (Google)
2011/10/14 15:40:05
SetBounds().
oshima
2011/10/15 02:10:50
Done.
| |
116 void SetMinimumSize(const gfx::Size& minimum_size); | |
Ben Goodger (Google)
2011/10/14 15:40:05
Since this is a pure setter, you can call it set_m
oshima
2011/10/15 02:10:50
Done.
| |
117 const gfx::Size& minimum_size() const { return minimum_size_; } | |
118 | |
114 // Marks the a portion of window as needing to be painted. | 119 // Marks the a portion of window as needing to be painted. |
115 void SchedulePaintInRect(const gfx::Rect& rect); | 120 void SchedulePaintInRect(const gfx::Rect& rect); |
116 | 121 |
117 // Sets the contents of the window. | 122 // Sets the contents of the window. |
118 void SetCanvas(const SkCanvas& canvas, const gfx::Point& origin); | 123 void SetCanvas(const SkCanvas& canvas, const gfx::Point& origin); |
119 | 124 |
120 // Sets the parent window of the window. If NULL, the window is parented to | 125 // Sets the parent window of the window. If NULL, the window is parented to |
121 // the desktop's window. | 126 // the desktop's window. |
122 void SetParent(Window* parent); | 127 void SetParent(Window* parent); |
123 Window* parent() { return parent_; } | 128 Window* parent() { return parent_; } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
227 | 232 |
228 // Returns an animation configured with the default duration. All animations | 233 // Returns an animation configured with the default duration. All animations |
229 // should use this. Caller owns returned value. | 234 // should use this. Caller owns returned value. |
230 static ui::Animation* CreateDefaultAnimation(); | 235 static ui::Animation* CreateDefaultAnimation(); |
231 | 236 |
232 protected: | 237 protected: |
233 // Returns the RootWindow or NULL if we don't yet have a RootWindow. | 238 // Returns the RootWindow or NULL if we don't yet have a RootWindow. |
234 virtual internal::RootWindow* GetRoot(); | 239 virtual internal::RootWindow* GetRoot(); |
235 | 240 |
236 private: | 241 private: |
242 // Changes the bounds of the window without condition. | |
243 void SetBoundsInternal(const gfx::Rect& new_bounds); | |
244 | |
237 // Updates the visible state of the layer, but does not make visible-state | 245 // Updates the visible state of the layer, but does not make visible-state |
238 // specific changes. Called from Show()/Hide(). | 246 // specific changes. Called from Show()/Hide(). |
239 void SetVisible(bool visible); | 247 void SetVisible(bool visible); |
240 | 248 |
241 // Schedules a paint for the Window's entire bounds. | 249 // Schedules a paint for the Window's entire bounds. |
242 void SchedulePaint(); | 250 void SchedulePaint(); |
243 | 251 |
244 // This window is currently stopping event propagation for any windows behind | 252 // This window is currently stopping event propagation for any windows behind |
245 // it in the z-order. | 253 // it in the z-order. |
246 bool StopsEventPropagation() const; | 254 bool StopsEventPropagation() const; |
(...skipping 17 matching lines...) Expand all Loading... | |
264 | 272 |
265 int type_; | 273 int type_; |
266 | 274 |
267 WindowDelegate* delegate_; | 275 WindowDelegate* delegate_; |
268 | 276 |
269 ui::WindowShowState show_state_; | 277 ui::WindowShowState show_state_; |
270 | 278 |
271 // The original bounds of a maximized/fullscreen window. | 279 // The original bounds of a maximized/fullscreen window. |
272 gfx::Rect restore_bounds_; | 280 gfx::Rect restore_bounds_; |
273 | 281 |
282 // The minimum size of the window a user can resize to. | |
283 gfx::Size minimum_size_; | |
284 | |
274 scoped_ptr<ui::Layer> layer_; | 285 scoped_ptr<ui::Layer> layer_; |
275 | 286 |
276 // The Window's parent. | 287 // The Window's parent. |
277 Window* parent_; | 288 Window* parent_; |
278 | 289 |
279 // Child windows. Topmost is last. | 290 // Child windows. Topmost is last. |
280 Windows children_; | 291 Windows children_; |
281 | 292 |
282 int id_; | 293 int id_; |
283 std::string name_; | 294 std::string name_; |
284 | 295 |
285 scoped_ptr<EventFilter> event_filter_; | 296 scoped_ptr<EventFilter> event_filter_; |
286 scoped_ptr<LayoutManager> layout_manager_; | 297 scoped_ptr<LayoutManager> layout_manager_; |
287 | 298 |
288 void* user_data_; | 299 void* user_data_; |
289 | 300 |
290 // When true, events are not sent to windows behind this one in the z-order, | 301 // When true, events are not sent to windows behind this one in the z-order, |
291 // provided this window has children. See set_stops_event_propagation(). | 302 // provided this window has children. See set_stops_event_propagation(). |
292 bool stops_event_propagation_; | 303 bool stops_event_propagation_; |
293 | 304 |
294 ObserverList<WindowObserver> observers_; | 305 ObserverList<WindowObserver> observers_; |
295 | 306 |
296 DISALLOW_COPY_AND_ASSIGN(Window); | 307 DISALLOW_COPY_AND_ASSIGN(Window); |
297 }; | 308 }; |
298 | 309 |
299 } // namespace aura | 310 } // namespace aura |
300 | 311 |
301 #endif // UI_AURA_WINDOW_H_ | 312 #endif // UI_AURA_WINDOW_H_ |
OLD | NEW |