| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_ROOT_WINDOW_H_ | 5 #ifndef UI_AURA_ROOT_WINDOW_H_ |
| 6 #define UI_AURA_ROOT_WINDOW_H_ | 6 #define UI_AURA_ROOT_WINDOW_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
| 15 #include "base/time.h" |
| 15 #include "ui/aura/aura_export.h" | 16 #include "ui/aura/aura_export.h" |
| 16 #include "ui/aura/client/capture_delegate.h" | 17 #include "ui/aura/client/capture_delegate.h" |
| 17 #include "ui/aura/root_window_host_delegate.h" | 18 #include "ui/aura/root_window_host_delegate.h" |
| 18 #include "ui/aura/window.h" | 19 #include "ui/aura/window.h" |
| 19 #include "ui/base/cursor/cursor.h" | 20 #include "ui/base/cursor/cursor.h" |
| 20 #include "ui/base/events/event_constants.h" | 21 #include "ui/base/events/event_constants.h" |
| 21 #include "ui/base/events/event_dispatcher.h" | 22 #include "ui/base/events/event_dispatcher.h" |
| 22 #include "ui/base/gestures/gesture_recognizer.h" | 23 #include "ui/base/gestures/gesture_recognizer.h" |
| 23 #include "ui/base/gestures/gesture_types.h" | 24 #include "ui/base/gestures/gesture_types.h" |
| 24 #include "ui/compositor/compositor.h" | 25 #include "ui/compositor/compositor.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 virtual RootWindow* GetRootWindow() OVERRIDE; | 236 virtual RootWindow* GetRootWindow() OVERRIDE; |
| 236 virtual const RootWindow* GetRootWindow() const OVERRIDE; | 237 virtual const RootWindow* GetRootWindow() const OVERRIDE; |
| 237 virtual void SetTransform(const gfx::Transform& transform) OVERRIDE; | 238 virtual void SetTransform(const gfx::Transform& transform) OVERRIDE; |
| 238 | 239 |
| 239 // Overridden from ui::EventTarget: | 240 // Overridden from ui::EventTarget: |
| 240 virtual ui::EventTarget* GetParentTarget() OVERRIDE; | 241 virtual ui::EventTarget* GetParentTarget() OVERRIDE; |
| 241 | 242 |
| 242 // Overridden from ui::CompositorDelegate: | 243 // Overridden from ui::CompositorDelegate: |
| 243 virtual void ScheduleDraw() OVERRIDE; | 244 virtual void ScheduleDraw() OVERRIDE; |
| 244 | 245 |
| 246 // Make ScheduleDraw use a delay when scheduling draws. |
| 247 void DelayDrawsForTesting(base::TimeDelta delay); |
| 248 |
| 245 // Overridden from ui::CompositorObserver: | 249 // Overridden from ui::CompositorObserver: |
| 246 virtual void OnCompositingDidCommit(ui::Compositor*) OVERRIDE; | 250 virtual void OnCompositingDidCommit(ui::Compositor*) OVERRIDE; |
| 247 virtual void OnCompositingStarted(ui::Compositor*, | 251 virtual void OnCompositingStarted(ui::Compositor*, |
| 248 base::TimeTicks start_time) OVERRIDE; | 252 base::TimeTicks start_time) OVERRIDE; |
| 249 virtual void OnCompositingEnded(ui::Compositor*) OVERRIDE; | 253 virtual void OnCompositingEnded(ui::Compositor*) OVERRIDE; |
| 250 virtual void OnCompositingAborted(ui::Compositor*) OVERRIDE; | 254 virtual void OnCompositingAborted(ui::Compositor*) OVERRIDE; |
| 251 virtual void OnCompositingLockStateChanged(ui::Compositor*) OVERRIDE; | 255 virtual void OnCompositingLockStateChanged(ui::Compositor*) OVERRIDE; |
| 252 virtual void OnUpdateVSyncParameters(ui::Compositor* compositor, | 256 virtual void OnUpdateVSyncParameters(ui::Compositor* compositor, |
| 253 base::TimeTicks timebase, | 257 base::TimeTicks timebase, |
| 254 base::TimeDelta interval) OVERRIDE; | 258 base::TimeDelta interval) OVERRIDE; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 | 399 |
| 396 // The gesture_recognizer_ for this. | 400 // The gesture_recognizer_ for this. |
| 397 scoped_ptr<ui::GestureRecognizer> gesture_recognizer_; | 401 scoped_ptr<ui::GestureRecognizer> gesture_recognizer_; |
| 398 | 402 |
| 399 bool synthesize_mouse_move_; | 403 bool synthesize_mouse_move_; |
| 400 bool waiting_on_compositing_end_; | 404 bool waiting_on_compositing_end_; |
| 401 bool draw_on_compositing_end_; | 405 bool draw_on_compositing_end_; |
| 402 | 406 |
| 403 bool defer_draw_scheduling_; | 407 bool defer_draw_scheduling_; |
| 404 | 408 |
| 409 base::TimeDelta draw_scheduling_delay_for_testing_; |
| 410 |
| 405 // How many holds are outstanding. We try to defer dispatching mouse moves | 411 // How many holds are outstanding. We try to defer dispatching mouse moves |
| 406 // while the count is > 0. | 412 // while the count is > 0. |
| 407 int mouse_move_hold_count_; | 413 int mouse_move_hold_count_; |
| 408 scoped_ptr<ui::MouseEvent> held_mouse_move_; | 414 scoped_ptr<ui::MouseEvent> held_mouse_move_; |
| 409 // Used to schedule DispatchHeldMouseMove() when |mouse_move_hold_count_| goes | 415 // Used to schedule DispatchHeldMouseMove() when |mouse_move_hold_count_| goes |
| 410 // to 0. | 416 // to 0. |
| 411 base::WeakPtrFactory<RootWindow> held_mouse_event_factory_; | 417 base::WeakPtrFactory<RootWindow> held_mouse_event_factory_; |
| 412 | 418 |
| 413 scoped_ptr<ui::ViewProp> prop_; | 419 scoped_ptr<ui::ViewProp> prop_; |
| 414 | 420 |
| 415 DISALLOW_COPY_AND_ASSIGN(RootWindow); | 421 DISALLOW_COPY_AND_ASSIGN(RootWindow); |
| 416 }; | 422 }; |
| 417 | 423 |
| 418 } // namespace aura | 424 } // namespace aura |
| 419 | 425 |
| 420 #endif // UI_AURA_ROOT_WINDOW_H_ | 426 #endif // UI_AURA_ROOT_WINDOW_H_ |
| OLD | NEW |