Chromium Code Reviews| 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 #include "ui/base/events.h" | 15 #include "ui/base/events.h" |
| 16 #include "ui/base/ui_base_types.h" | 16 #include "ui/base/ui_base_types.h" |
| 17 #include "ui/aura/aura_export.h" | 17 #include "ui/aura/aura_export.h" |
| 18 #include "ui/gfx/compositor/layer_animator.h" | |
| 18 #include "ui/gfx/compositor/layer_delegate.h" | 19 #include "ui/gfx/compositor/layer_delegate.h" |
| 19 #include "ui/gfx/native_widget_types.h" | 20 #include "ui/gfx/native_widget_types.h" |
| 20 #include "ui/gfx/rect.h" | 21 #include "ui/gfx/rect.h" |
| 21 | 22 |
| 22 class SkCanvas; | 23 class SkCanvas; |
| 23 | 24 |
| 24 namespace ui { | 25 namespace ui { |
| 25 class Animation; | 26 class Animation; |
| 26 class Compositor; | 27 class Compositor; |
| 27 class Layer; | 28 class Layer; |
| 29 class LayerAnimationSequence; | |
| 28 class Transform; | 30 class Transform; |
| 29 } | 31 } |
| 30 | 32 |
| 31 namespace aura { | 33 namespace aura { |
| 32 | 34 |
| 33 class Desktop; | 35 class Desktop; |
| 34 class EventFilter; | 36 class EventFilter; |
| 35 class KeyEvent; | 37 class KeyEvent; |
| 36 class LayoutManager; | 38 class LayoutManager; |
| 37 class MouseEvent; | 39 class MouseEvent; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 // Returns true if this window has a mouse capture. | 247 // Returns true if this window has a mouse capture. |
| 246 bool HasCapture(); | 248 bool HasCapture(); |
| 247 | 249 |
| 248 // Returns the first ancestor whose parent window returns true from | 250 // Returns the first ancestor whose parent window returns true from |
| 249 // IsToplevelWindowContainer. | 251 // IsToplevelWindowContainer. |
| 250 Window* GetToplevelWindow(); | 252 Window* GetToplevelWindow(); |
| 251 | 253 |
| 252 // Returns true if this window is fullscreen or contains a fullscreen window. | 254 // Returns true if this window is fullscreen or contains a fullscreen window. |
| 253 bool IsOrContainsFullscreenWindow() const; | 255 bool IsOrContainsFullscreenWindow() const; |
| 254 | 256 |
| 255 // Returns an animation configured with the default duration. All animations | 257 // Applies the default animation settings. Currently just the default duration |
| 256 // should use this. Caller owns returned value. | 258 // although it is conceivable that it would set the default tween type, etc. |
| 257 static ui::Animation* CreateDefaultAnimation(); | 259 // The settings are restored when the object is destroyed. |
| 260 class ScopedAnimationSettings : public ui::LayerAnimator::ScopedSettings { | |
|
sky
2011/10/26 15:39:15
Could we make ui::LayerAnimator::ScopedSettings se
| |
| 261 public: | |
| 262 ScopedAnimationSettings(ui::LayerAnimator* animator); | |
| 263 virtual ~ScopedAnimationSettings(); | |
| 264 }; | |
| 258 | 265 |
| 259 protected: | 266 protected: |
| 260 // Returns the desktop or NULL if we aren't yet attached to a desktop. | 267 // Returns the desktop or NULL if we aren't yet attached to a desktop. |
| 261 virtual Desktop* GetDesktop(); | 268 virtual Desktop* GetDesktop(); |
| 262 | 269 |
| 263 private: | 270 private: |
| 264 friend class LayoutManager; | 271 friend class LayoutManager; |
| 265 | 272 |
| 266 // Changes the bounds of the window without condition. | 273 // Changes the bounds of the window without condition. |
| 267 void SetBoundsInternal(const gfx::Rect& new_bounds); | 274 void SetBoundsInternal(const gfx::Rect& new_bounds); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 286 // furthest down the hierarchy) Window containing the point; otherwise, | 293 // furthest down the hierarchy) Window containing the point; otherwise, |
| 287 // returns the loosest. If |for_event_handling| is true, then hit-test masks | 294 // returns the loosest. If |for_event_handling| is true, then hit-test masks |
| 288 // and StopsEventPropagation() are honored; otherwise, only bounds checks are | 295 // and StopsEventPropagation() are honored; otherwise, only bounds checks are |
| 289 // performed. | 296 // performed. |
| 290 Window* GetWindowForPoint(const gfx::Point& local_point, | 297 Window* GetWindowForPoint(const gfx::Point& local_point, |
| 291 bool return_tightest, | 298 bool return_tightest, |
| 292 bool for_event_handling); | 299 bool for_event_handling); |
| 293 | 300 |
| 294 // Overridden from ui::LayerDelegate: | 301 // Overridden from ui::LayerDelegate: |
| 295 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; | 302 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; |
| 296 virtual void OnLayerAnimationEnded(const ui::Animation* animation) OVERRIDE; | 303 virtual void OnLayerAnimationEnded( |
| 304 const ui::LayerAnimationSequence* animation) OVERRIDE; | |
| 297 | 305 |
| 298 int type_; | 306 int type_; |
| 299 | 307 |
| 300 WindowDelegate* delegate_; | 308 WindowDelegate* delegate_; |
| 301 | 309 |
| 302 ui::WindowShowState show_state_; | 310 ui::WindowShowState show_state_; |
| 303 | 311 |
| 304 // The original bounds of a maximized/fullscreen window. | 312 // The original bounds of a maximized/fullscreen window. |
| 305 gfx::Rect restore_bounds_; | 313 gfx::Rect restore_bounds_; |
| 306 | 314 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 328 bool stops_event_propagation_; | 336 bool stops_event_propagation_; |
| 329 | 337 |
| 330 ObserverList<WindowObserver> observers_; | 338 ObserverList<WindowObserver> observers_; |
| 331 | 339 |
| 332 DISALLOW_COPY_AND_ASSIGN(Window); | 340 DISALLOW_COPY_AND_ASSIGN(Window); |
| 333 }; | 341 }; |
| 334 | 342 |
| 335 } // namespace aura | 343 } // namespace aura |
| 336 | 344 |
| 337 #endif // UI_AURA_WINDOW_H_ | 345 #endif // UI_AURA_WINDOW_H_ |
| OLD | NEW |