| 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/gfx/compositor/layer.h" | 19 #include "ui/gfx/compositor/layer.h" |
| 20 #include "ui/gfx/compositor/layer_animator.h" | |
| 21 #include "ui/gfx/compositor/layer_delegate.h" | 20 #include "ui/gfx/compositor/layer_delegate.h" |
| 22 #include "ui/gfx/native_widget_types.h" | 21 #include "ui/gfx/native_widget_types.h" |
| 23 #include "ui/gfx/rect.h" | 22 #include "ui/gfx/rect.h" |
| 24 | 23 |
| 25 class SkCanvas; | 24 class SkCanvas; |
| 26 | 25 |
| 27 namespace ui { | 26 namespace ui { |
| 28 class Animation; | 27 class Animation; |
| 29 class Compositor; | 28 class Compositor; |
| 30 class Layer; | 29 class Layer; |
| 31 class LayerAnimationSequence; | |
| 32 class Transform; | 30 class Transform; |
| 33 class ViewProp; | 31 class ViewProp; |
| 34 } | 32 } |
| 35 | 33 |
| 36 namespace aura { | 34 namespace aura { |
| 37 | 35 |
| 38 class Desktop; | 36 class Desktop; |
| 39 class EventFilter; | 37 class EventFilter; |
| 40 class KeyEvent; | 38 class KeyEvent; |
| 41 class LayoutManager; | 39 class LayoutManager; |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 260 |
| 263 // Sets the window property |value| for given |name|. Setting NULL | 261 // Sets the window property |value| for given |name|. Setting NULL |
| 264 // removes the property. It uses |ui::ViewProp| to store the property. | 262 // removes the property. It uses |ui::ViewProp| to store the property. |
| 265 // Please see the description of |prop_map_| for more details. | 263 // Please see the description of |prop_map_| for more details. |
| 266 void SetProperty(const char* name, void* value); | 264 void SetProperty(const char* name, void* value); |
| 267 | 265 |
| 268 // Returns the window property for given |name|. Returns NULL if | 266 // Returns the window property for given |name|. Returns NULL if |
| 269 // the property does not exist. | 267 // the property does not exist. |
| 270 void* GetProperty(const char* name) const; | 268 void* GetProperty(const char* name) const; |
| 271 | 269 |
| 270 // Returns an animation configured with the default duration. All animations |
| 271 // should use this. Caller owns returned value. |
| 272 static ui::Animation* CreateDefaultAnimation(); |
| 273 |
| 272 protected: | 274 protected: |
| 273 // Returns the desktop or NULL if we aren't yet attached to a desktop. | 275 // Returns the desktop or NULL if we aren't yet attached to a desktop. |
| 274 virtual Desktop* GetDesktop(); | 276 virtual Desktop* GetDesktop(); |
| 275 | 277 |
| 276 private: | 278 private: |
| 277 friend class LayoutManager; | 279 friend class LayoutManager; |
| 278 | 280 |
| 279 // Changes the bounds of the window without condition. | 281 // Changes the bounds of the window without condition. |
| 280 void SetBoundsInternal(const gfx::Rect& new_bounds); | 282 void SetBoundsInternal(const gfx::Rect& new_bounds); |
| 281 | 283 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 299 // furthest down the hierarchy) Window containing the point; otherwise, | 301 // furthest down the hierarchy) Window containing the point; otherwise, |
| 300 // returns the loosest. If |for_event_handling| is true, then hit-test masks | 302 // returns the loosest. If |for_event_handling| is true, then hit-test masks |
| 301 // and StopsEventPropagation() are honored; otherwise, only bounds checks are | 303 // and StopsEventPropagation() are honored; otherwise, only bounds checks are |
| 302 // performed. | 304 // performed. |
| 303 Window* GetWindowForPoint(const gfx::Point& local_point, | 305 Window* GetWindowForPoint(const gfx::Point& local_point, |
| 304 bool return_tightest, | 306 bool return_tightest, |
| 305 bool for_event_handling); | 307 bool for_event_handling); |
| 306 | 308 |
| 307 // Overridden from ui::LayerDelegate: | 309 // Overridden from ui::LayerDelegate: |
| 308 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; | 310 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; |
| 309 virtual void OnLayerAnimationEnded( | 311 virtual void OnLayerAnimationEnded(const ui::Animation* animation) OVERRIDE; |
| 310 const ui::LayerAnimationSequence* animation) OVERRIDE; | |
| 311 | 312 |
| 312 int type_; | 313 int type_; |
| 313 | 314 |
| 314 WindowDelegate* delegate_; | 315 WindowDelegate* delegate_; |
| 315 | 316 |
| 316 ui::WindowShowState show_state_; | 317 ui::WindowShowState show_state_; |
| 317 | 318 |
| 318 // The original bounds of a maximized/fullscreen window. | 319 // The original bounds of a maximized/fullscreen window. |
| 319 gfx::Rect restore_bounds_; | 320 gfx::Rect restore_bounds_; |
| 320 | 321 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 // TODO(oshima): Consolidcate ViewProp and aura::window property | 355 // TODO(oshima): Consolidcate ViewProp and aura::window property |
| 355 // implementation. | 356 // implementation. |
| 356 std::map<const char*, ui::ViewProp*> prop_map_; | 357 std::map<const char*, ui::ViewProp*> prop_map_; |
| 357 | 358 |
| 358 DISALLOW_COPY_AND_ASSIGN(Window); | 359 DISALLOW_COPY_AND_ASSIGN(Window); |
| 359 }; | 360 }; |
| 360 | 361 |
| 361 } // namespace aura | 362 } // namespace aura |
| 362 | 363 |
| 363 #endif // UI_AURA_WINDOW_H_ | 364 #endif // UI_AURA_WINDOW_H_ |
| OLD | NEW |