| 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> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 15 #include "base/string16.h" | 15 #include "base/string16.h" |
| 16 #include "ui/base/events.h" | 16 #include "ui/base/events.h" |
| 17 #include "ui/base/ui_base_types.h" | 17 #include "ui/base/ui_base_types.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/gfx/compositor/layer.h" | 20 #include "ui/gfx/compositor/layer.h" |
| 20 #include "ui/gfx/compositor/layer_animator.h" | 21 #include "ui/gfx/compositor/layer_animator.h" |
| 21 #include "ui/gfx/compositor/layer_delegate.h" | 22 #include "ui/gfx/compositor/layer_delegate.h" |
| 22 #include "ui/gfx/native_widget_types.h" | 23 #include "ui/gfx/native_widget_types.h" |
| 23 #include "ui/gfx/rect.h" | 24 #include "ui/gfx/rect.h" |
| 24 | 25 |
| 25 class SkCanvas; | 26 class SkCanvas; |
| 26 | 27 |
| 27 namespace ui { | 28 namespace ui { |
| 28 class Animation; | 29 class Animation; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 55 class AURA_EXPORT Window : public ui::LayerDelegate { | 56 class AURA_EXPORT Window : public ui::LayerDelegate { |
| 56 public: | 57 public: |
| 57 typedef std::vector<Window*> Windows; | 58 typedef std::vector<Window*> Windows; |
| 58 | 59 |
| 59 explicit Window(WindowDelegate* delegate); | 60 explicit Window(WindowDelegate* delegate); |
| 60 virtual ~Window(); | 61 virtual ~Window(); |
| 61 | 62 |
| 62 void Init(ui::Layer::LayerType layer_type); | 63 void Init(ui::Layer::LayerType layer_type); |
| 63 | 64 |
| 64 // A type is used to identify a class of Windows and customize behavior such | 65 // A type is used to identify a class of Windows and customize behavior such |
| 65 // as event handling and parenting. The value can be any of those in | 66 // as event handling and parenting. This field should only be consumed by the |
| 66 // window_types.h or a user defined value. | 67 // shell -- Aura itself shouldn't contain type-specific logic. |
| 67 int type() const { return type_; } | 68 WindowType type() const { return type_; } |
| 68 void SetType(int type); | 69 void SetType(WindowType type); |
| 69 | 70 |
| 70 int id() const { return id_; } | 71 int id() const { return id_; } |
| 71 void set_id(int id) { id_ = id; } | 72 void set_id(int id) { id_ = id; } |
| 72 | 73 |
| 73 const std::string& name() const { return name_; } | 74 const std::string& name() const { return name_; } |
| 74 void set_name(const std::string& name) { name_ = name; } | 75 void set_name(const std::string& name) { name_ = name; } |
| 75 | 76 |
| 76 ui::Layer* layer() { return layer_.get(); } | 77 ui::Layer* layer() { return layer_.get(); } |
| 77 const ui::Layer* layer() const { return layer_.get(); } | 78 const ui::Layer* layer() const { return layer_.get(); } |
| 78 | 79 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 // performed. | 309 // performed. |
| 309 Window* GetWindowForPoint(const gfx::Point& local_point, | 310 Window* GetWindowForPoint(const gfx::Point& local_point, |
| 310 bool return_tightest, | 311 bool return_tightest, |
| 311 bool for_event_handling); | 312 bool for_event_handling); |
| 312 | 313 |
| 313 // Overridden from ui::LayerDelegate: | 314 // Overridden from ui::LayerDelegate: |
| 314 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; | 315 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; |
| 315 virtual void OnLayerAnimationEnded( | 316 virtual void OnLayerAnimationEnded( |
| 316 const ui::LayerAnimationSequence* animation) OVERRIDE; | 317 const ui::LayerAnimationSequence* animation) OVERRIDE; |
| 317 | 318 |
| 318 int type_; | 319 WindowType type_; |
| 319 | 320 |
| 320 WindowDelegate* delegate_; | 321 WindowDelegate* delegate_; |
| 321 | 322 |
| 322 ui::WindowShowState show_state_; | 323 ui::WindowShowState show_state_; |
| 323 | 324 |
| 324 // The original bounds of a maximized/fullscreen window. | 325 // The original bounds of a maximized/fullscreen window. |
| 325 gfx::Rect restore_bounds_; | 326 gfx::Rect restore_bounds_; |
| 326 | 327 |
| 327 // The minimum size of the window a user can resize to. | 328 // The minimum size of the window a user can resize to. |
| 328 gfx::Size minimum_size_; | 329 gfx::Size minimum_size_; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 // TODO(oshima): Consolidcate ViewProp and aura::window property | 361 // TODO(oshima): Consolidcate ViewProp and aura::window property |
| 361 // implementation. | 362 // implementation. |
| 362 std::map<const char*, ui::ViewProp*> prop_map_; | 363 std::map<const char*, ui::ViewProp*> prop_map_; |
| 363 | 364 |
| 364 DISALLOW_COPY_AND_ASSIGN(Window); | 365 DISALLOW_COPY_AND_ASSIGN(Window); |
| 365 }; | 366 }; |
| 366 | 367 |
| 367 } // namespace aura | 368 } // namespace aura |
| 368 | 369 |
| 369 #endif // UI_AURA_WINDOW_H_ | 370 #endif // UI_AURA_WINDOW_H_ |
| OLD | NEW |