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 <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "base/string16.h" | 16 #include "base/string16.h" |
17 #include "ui/base/events.h" | 17 #include "ui/base/events.h" |
18 #include "ui/aura/aura_export.h" | 18 #include "ui/aura/aura_export.h" |
19 #include "ui/aura/window_types.h" | 19 #include "ui/aura/client/window_types.h" |
20 #include "ui/gfx/compositor/layer.h" | 20 #include "ui/gfx/compositor/layer.h" |
21 #include "ui/gfx/compositor/layer_animator.h" | 21 #include "ui/gfx/compositor/layer_animator.h" |
22 #include "ui/gfx/compositor/layer_delegate.h" | 22 #include "ui/gfx/compositor/layer_delegate.h" |
23 #include "ui/gfx/native_widget_types.h" | 23 #include "ui/gfx/native_widget_types.h" |
24 #include "ui/gfx/rect.h" | 24 #include "ui/gfx/rect.h" |
25 | 25 |
26 class SkCanvas; | 26 class SkCanvas; |
27 | 27 |
28 namespace ui { | 28 namespace ui { |
29 class Layer; | 29 class Layer; |
(...skipping 20 matching lines...) Expand all Loading... |
50 typedef std::vector<Window*> Windows; | 50 typedef std::vector<Window*> Windows; |
51 | 51 |
52 explicit Window(WindowDelegate* delegate); | 52 explicit Window(WindowDelegate* delegate); |
53 virtual ~Window(); | 53 virtual ~Window(); |
54 | 54 |
55 void Init(ui::Layer::LayerType layer_type); | 55 void Init(ui::Layer::LayerType layer_type); |
56 | 56 |
57 // A type is used to identify a class of Windows and customize behavior such | 57 // A type is used to identify a class of Windows and customize behavior such |
58 // as event handling and parenting. This field should only be consumed by the | 58 // as event handling and parenting. This field should only be consumed by the |
59 // shell -- Aura itself shouldn't contain type-specific logic. | 59 // shell -- Aura itself shouldn't contain type-specific logic. |
60 WindowType type() const { return type_; } | 60 client::WindowType type() const { return type_; } |
61 void SetType(WindowType type); | 61 void SetType(client::WindowType type); |
62 | 62 |
63 int id() const { return id_; } | 63 int id() const { return id_; } |
64 void set_id(int id) { id_ = id; } | 64 void set_id(int id) { id_ = id; } |
65 | 65 |
66 const std::string& name() const { return name_; } | 66 const std::string& name() const { return name_; } |
67 void SetName(const std::string& name); | 67 void SetName(const std::string& name); |
68 | 68 |
69 const string16 title() const { return title_; } | 69 const string16 title() const { return title_; } |
70 void set_title(const string16& title) { title_ = title; } | 70 void set_title(const string16& title) { title_ = title; } |
71 | 71 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 291 |
292 // Called when this window's stacking order among its siblings is changed. | 292 // Called when this window's stacking order among its siblings is changed. |
293 void OnStackingChanged(); | 293 void OnStackingChanged(); |
294 | 294 |
295 // Overridden from ui::LayerDelegate: | 295 // Overridden from ui::LayerDelegate: |
296 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; | 296 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; |
297 | 297 |
298 // Updates the layer name with a name based on the window's name and id. | 298 // Updates the layer name with a name based on the window's name and id. |
299 void UpdateLayerName(const std::string& name); | 299 void UpdateLayerName(const std::string& name); |
300 | 300 |
301 WindowType type_; | 301 client::WindowType type_; |
302 | 302 |
303 WindowDelegate* delegate_; | 303 WindowDelegate* delegate_; |
304 | 304 |
305 scoped_ptr<ui::Layer> layer_; | 305 scoped_ptr<ui::Layer> layer_; |
306 | 306 |
307 // The Window's parent. | 307 // The Window's parent. |
308 Window* parent_; | 308 Window* parent_; |
309 | 309 |
310 // Child windows. Topmost is last. | 310 // Child windows. Topmost is last. |
311 Windows children_; | 311 Windows children_; |
(...skipping 28 matching lines...) Expand all Loading... |
340 // TODO(oshima): Consolidcate ViewProp and aura::window property | 340 // TODO(oshima): Consolidcate ViewProp and aura::window property |
341 // implementation. | 341 // implementation. |
342 std::map<const char*, void*> prop_map_; | 342 std::map<const char*, void*> prop_map_; |
343 | 343 |
344 DISALLOW_COPY_AND_ASSIGN(Window); | 344 DISALLOW_COPY_AND_ASSIGN(Window); |
345 }; | 345 }; |
346 | 346 |
347 } // namespace aura | 347 } // namespace aura |
348 | 348 |
349 #endif // UI_AURA_WINDOW_H_ | 349 #endif // UI_AURA_WINDOW_H_ |
OLD | NEW |