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 <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 LayoutManager* layout_manager() { return layout_manager_.get(); } | 118 LayoutManager* layout_manager() { return layout_manager_.get(); } |
119 | 119 |
120 // Changes the bounds of the window. If present, the window's parent's | 120 // Changes the bounds of the window. If present, the window's parent's |
121 // LayoutManager may adjust the bounds. | 121 // LayoutManager may adjust the bounds. |
122 void SetBounds(const gfx::Rect& new_bounds); | 122 void SetBounds(const gfx::Rect& new_bounds); |
123 | 123 |
124 // Returns the target bounds of the window. If the window's layer is | 124 // Returns the target bounds of the window. If the window's layer is |
125 // not animating, it simply returns the current bounds. | 125 // not animating, it simply returns the current bounds. |
126 gfx::Rect GetTargetBounds() const; | 126 gfx::Rect GetTargetBounds() const; |
127 | 127 |
128 // Sets the minimum size of the window that a user can resize it to. | |
129 // A smaller size can still be set using SetBounds(). | |
130 void set_minimum_size(const gfx::Size& minimum_size) { | |
131 minimum_size_ = minimum_size; | |
132 } | |
133 const gfx::Size& minimum_size() const { return minimum_size_; } | |
134 | |
135 // Marks the a portion of window as needing to be painted. | 128 // Marks the a portion of window as needing to be painted. |
136 void SchedulePaintInRect(const gfx::Rect& rect); | 129 void SchedulePaintInRect(const gfx::Rect& rect); |
137 | 130 |
138 // Sets the contents of the window. | 131 // Sets the contents of the window. |
139 void SetCanvas(const SkCanvas& canvas, const gfx::Point& origin); | 132 void SetCanvas(const SkCanvas& canvas, const gfx::Point& origin); |
140 | 133 |
141 // Sets the parent window of the window. If NULL, the window is parented to | 134 // Sets the parent window of the window. If NULL, the window is parented to |
142 // the desktop's window. | 135 // the desktop's window. |
143 void SetParent(Window* parent); | 136 void SetParent(Window* parent); |
144 | 137 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 // Overridden from ui::LayerDelegate: | 296 // Overridden from ui::LayerDelegate: |
304 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; | 297 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; |
305 | 298 |
306 WindowType type_; | 299 WindowType type_; |
307 | 300 |
308 WindowDelegate* delegate_; | 301 WindowDelegate* delegate_; |
309 | 302 |
310 // The original bounds of a maximized/fullscreen window. | 303 // The original bounds of a maximized/fullscreen window. |
311 gfx::Rect restore_bounds_; | 304 gfx::Rect restore_bounds_; |
312 | 305 |
313 // The minimum size of the window a user can resize to. | |
314 gfx::Size minimum_size_; | |
315 | |
316 scoped_ptr<ui::Layer> layer_; | 306 scoped_ptr<ui::Layer> layer_; |
317 | 307 |
318 // The Window's parent. | 308 // The Window's parent. |
319 Window* parent_; | 309 Window* parent_; |
320 | 310 |
321 // Child windows. Topmost is last. | 311 // Child windows. Topmost is last. |
322 Windows children_; | 312 Windows children_; |
323 | 313 |
324 // Transient windows. | 314 // Transient windows. |
325 Windows transient_children_; | 315 Windows transient_children_; |
(...skipping 22 matching lines...) Expand all Loading... |
348 // TODO(oshima): Consolidcate ViewProp and aura::window property | 338 // TODO(oshima): Consolidcate ViewProp and aura::window property |
349 // implementation. | 339 // implementation. |
350 std::map<const char*, void*> prop_map_; | 340 std::map<const char*, void*> prop_map_; |
351 | 341 |
352 DISALLOW_COPY_AND_ASSIGN(Window); | 342 DISALLOW_COPY_AND_ASSIGN(Window); |
353 }; | 343 }; |
354 | 344 |
355 } // namespace aura | 345 } // namespace aura |
356 | 346 |
357 #endif // UI_AURA_WINDOW_H_ | 347 #endif // UI_AURA_WINDOW_H_ |
OLD | NEW |