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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 virtual ToplevelWindowContainer* AsToplevelWindowContainer(); | 116 virtual ToplevelWindowContainer* AsToplevelWindowContainer(); |
117 virtual const ToplevelWindowContainer* AsToplevelWindowContainer() const; | 117 virtual const ToplevelWindowContainer* AsToplevelWindowContainer() const; |
118 | 118 |
119 // Assigns a LayoutManager to size and place child windows. | 119 // Assigns a LayoutManager to size and place child windows. |
120 // The Window takes ownership of the LayoutManager. | 120 // The Window takes ownership of the LayoutManager. |
121 void SetLayoutManager(LayoutManager* layout_manager); | 121 void SetLayoutManager(LayoutManager* layout_manager); |
122 | 122 |
123 // Changes the bounds of the window. | 123 // Changes the bounds of the window. |
124 void SetBounds(const gfx::Rect& new_bounds); | 124 void SetBounds(const gfx::Rect& new_bounds); |
125 | 125 |
| 126 // Sets the minimum size of the window that a user can resize it to. |
| 127 // A smaller size can still be set using SetBounds(). |
| 128 void set_minimum_size(const gfx::Size& minimum_size) { |
| 129 minimum_size_ = minimum_size; |
| 130 } |
| 131 const gfx::Size& minimum_size() const { return minimum_size_; } |
| 132 |
126 // Marks the a portion of window as needing to be painted. | 133 // Marks the a portion of window as needing to be painted. |
127 void SchedulePaintInRect(const gfx::Rect& rect); | 134 void SchedulePaintInRect(const gfx::Rect& rect); |
128 | 135 |
129 // Sets the contents of the window. | 136 // Sets the contents of the window. |
130 void SetCanvas(const SkCanvas& canvas, const gfx::Point& origin); | 137 void SetCanvas(const SkCanvas& canvas, const gfx::Point& origin); |
131 | 138 |
132 // Sets the parent window of the window. If NULL, the window is parented to | 139 // Sets the parent window of the window. If NULL, the window is parented to |
133 // the desktop's window. | 140 // the desktop's window. |
134 void SetParent(Window* parent); | 141 void SetParent(Window* parent); |
135 | 142 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 244 |
238 // Returns an animation configured with the default duration. All animations | 245 // Returns an animation configured with the default duration. All animations |
239 // should use this. Caller owns returned value. | 246 // should use this. Caller owns returned value. |
240 static ui::Animation* CreateDefaultAnimation(); | 247 static ui::Animation* CreateDefaultAnimation(); |
241 | 248 |
242 protected: | 249 protected: |
243 // Returns the RootWindow or NULL if we don't yet have a RootWindow. | 250 // Returns the RootWindow or NULL if we don't yet have a RootWindow. |
244 virtual internal::RootWindow* GetRoot(); | 251 virtual internal::RootWindow* GetRoot(); |
245 | 252 |
246 private: | 253 private: |
| 254 // Changes the bounds of the window without condition. |
| 255 void SetBoundsInternal(const gfx::Rect& new_bounds); |
| 256 |
247 // Updates the visible state of the layer, but does not make visible-state | 257 // Updates the visible state of the layer, but does not make visible-state |
248 // specific changes. Called from Show()/Hide(). | 258 // specific changes. Called from Show()/Hide(). |
249 void SetVisible(bool visible); | 259 void SetVisible(bool visible); |
250 | 260 |
251 // Schedules a paint for the Window's entire bounds. | 261 // Schedules a paint for the Window's entire bounds. |
252 void SchedulePaint(); | 262 void SchedulePaint(); |
253 | 263 |
254 // This window is currently stopping event propagation for any windows behind | 264 // This window is currently stopping event propagation for any windows behind |
255 // it in the z-order. | 265 // it in the z-order. |
256 bool StopsEventPropagation() const; | 266 bool StopsEventPropagation() const; |
(...skipping 17 matching lines...) Expand all Loading... |
274 | 284 |
275 int type_; | 285 int type_; |
276 | 286 |
277 WindowDelegate* delegate_; | 287 WindowDelegate* delegate_; |
278 | 288 |
279 ui::WindowShowState show_state_; | 289 ui::WindowShowState show_state_; |
280 | 290 |
281 // The original bounds of a maximized/fullscreen window. | 291 // The original bounds of a maximized/fullscreen window. |
282 gfx::Rect restore_bounds_; | 292 gfx::Rect restore_bounds_; |
283 | 293 |
| 294 // The minimum size of the window a user can resize to. |
| 295 gfx::Size minimum_size_; |
| 296 |
284 scoped_ptr<ui::Layer> layer_; | 297 scoped_ptr<ui::Layer> layer_; |
285 | 298 |
286 // The Window's parent. | 299 // The Window's parent. |
287 Window* parent_; | 300 Window* parent_; |
288 | 301 |
289 // Child windows. Topmost is last. | 302 // Child windows. Topmost is last. |
290 Windows children_; | 303 Windows children_; |
291 | 304 |
292 int id_; | 305 int id_; |
293 std::string name_; | 306 std::string name_; |
294 | 307 |
295 scoped_ptr<EventFilter> event_filter_; | 308 scoped_ptr<EventFilter> event_filter_; |
296 scoped_ptr<LayoutManager> layout_manager_; | 309 scoped_ptr<LayoutManager> layout_manager_; |
297 | 310 |
298 void* user_data_; | 311 void* user_data_; |
299 | 312 |
300 // When true, events are not sent to windows behind this one in the z-order, | 313 // When true, events are not sent to windows behind this one in the z-order, |
301 // provided this window has children. See set_stops_event_propagation(). | 314 // provided this window has children. See set_stops_event_propagation(). |
302 bool stops_event_propagation_; | 315 bool stops_event_propagation_; |
303 | 316 |
304 ObserverList<WindowObserver> observers_; | 317 ObserverList<WindowObserver> observers_; |
305 | 318 |
306 DISALLOW_COPY_AND_ASSIGN(Window); | 319 DISALLOW_COPY_AND_ASSIGN(Window); |
307 }; | 320 }; |
308 | 321 |
309 } // namespace aura | 322 } // namespace aura |
310 | 323 |
311 #endif // UI_AURA_WINDOW_H_ | 324 #endif // UI_AURA_WINDOW_H_ |
OLD | NEW |