| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 const std::string& name() const { return name_; } | 56 const std::string& name() const { return name_; } |
| 57 void set_name(const std::string& name) { name_ = name; } | 57 void set_name(const std::string& name) { name_ = name; } |
| 58 | 58 |
| 59 ui::Layer* layer() { return layer_.get(); } | 59 ui::Layer* layer() { return layer_.get(); } |
| 60 const ui::Layer* layer() const { return layer_.get(); } | 60 const ui::Layer* layer() const { return layer_.get(); } |
| 61 | 61 |
| 62 // Changes the visibility of the window. | 62 // Changes the visibility of the window. |
| 63 void Show(); | 63 void Show(); |
| 64 void Hide(); | 64 void Hide(); |
| 65 bool visible() const { return visible_; } | 65 // Returns true if this window and all its ancestors are visible. |
| 66 bool IsVisible() const; |
| 66 | 67 |
| 67 // Assigns a LayoutManager to size and place child windows. | 68 // Assigns a LayoutManager to size and place child windows. |
| 68 // The Window takes ownership of the LayoutManager. | 69 // The Window takes ownership of the LayoutManager. |
| 69 void SetLayoutManager(LayoutManager* layout_manager); | 70 void SetLayoutManager(LayoutManager* layout_manager); |
| 70 | 71 |
| 71 // Changes the bounds of the window. | 72 // Changes the bounds of the window. |
| 72 void SetBounds(const gfx::Rect& new_bounds); | 73 void SetBounds(const gfx::Rect& new_bounds); |
| 73 const gfx::Rect& bounds() const; | 74 const gfx::Rect& bounds() const; |
| 74 | 75 |
| 75 // Marks the a portion of window as needing to be painted. | 76 // Marks the a portion of window as needing to be painted. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 void SetVisible(bool visible); | 164 void SetVisible(bool visible); |
| 164 | 165 |
| 165 // Schedules a paint for the Window's entire bounds. | 166 // Schedules a paint for the Window's entire bounds. |
| 166 void SchedulePaint(); | 167 void SchedulePaint(); |
| 167 | 168 |
| 168 // Overridden from ui::LayerDelegate: | 169 // Overridden from ui::LayerDelegate: |
| 169 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; | 170 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; |
| 170 | 171 |
| 171 WindowDelegate* delegate_; | 172 WindowDelegate* delegate_; |
| 172 | 173 |
| 173 bool visible_; | |
| 174 | |
| 175 scoped_ptr<ui::Layer> layer_; | 174 scoped_ptr<ui::Layer> layer_; |
| 176 | 175 |
| 177 // The Window's parent. | 176 // The Window's parent. |
| 178 // TODO(beng): Implement NULL-ness for toplevels. | 177 // TODO(beng): Implement NULL-ness for toplevels. |
| 179 Window* parent_; | 178 Window* parent_; |
| 180 | 179 |
| 181 // Child windows. Topmost is last. | 180 // Child windows. Topmost is last. |
| 182 Windows children_; | 181 Windows children_; |
| 183 | 182 |
| 184 int id_; | 183 int id_; |
| 185 std::string name_; | 184 std::string name_; |
| 186 | 185 |
| 187 scoped_ptr<EventFilter> event_filter_; | 186 scoped_ptr<EventFilter> event_filter_; |
| 188 scoped_ptr<LayoutManager> layout_manager_; | 187 scoped_ptr<LayoutManager> layout_manager_; |
| 189 | 188 |
| 190 void* user_data_; | 189 void* user_data_; |
| 191 | 190 |
| 192 DISALLOW_COPY_AND_ASSIGN(Window); | 191 DISALLOW_COPY_AND_ASSIGN(Window); |
| 193 }; | 192 }; |
| 194 | 193 |
| 195 } // namespace aura | 194 } // namespace aura |
| 196 | 195 |
| 197 #endif // UI_AURA_WINDOW_H_ | 196 #endif // UI_AURA_WINDOW_H_ |
| OLD | NEW |