| Index: ui/gfx/compositor/compositor.h
|
| diff --git a/ui/gfx/compositor/compositor.h b/ui/gfx/compositor/compositor.h
|
| index 1251b6a42108ed2a00474e3e958b400244aedbe0..5f254d06a94746ef02e20d85eaf2ee5630579fe3 100644
|
| --- a/ui/gfx/compositor/compositor.h
|
| +++ b/ui/gfx/compositor/compositor.h
|
| @@ -139,6 +139,16 @@ class COMPOSITOR_EXPORT Compositor : public base::RefCounted<Compositor> {
|
| void RemoveObserver(CompositorObserver* observer);
|
| bool HasObserver(CompositorObserver* observer);
|
|
|
| + static void set_compositor_factory_for_testing(
|
| + ui::Compositor*(*factory)(ui::CompositorDelegate* owner)) {
|
| + compositor_factory_ = factory;
|
| + }
|
| +
|
| + static ui::Compositor* (*compositor_factory())(
|
| + ui::CompositorDelegate* owner) {
|
| + return compositor_factory_;
|
| + }
|
| +
|
| protected:
|
| Compositor(CompositorDelegate* delegate, const gfx::Size& size);
|
| virtual ~Compositor();
|
| @@ -169,6 +179,12 @@ class COMPOSITOR_EXPORT Compositor : public base::RefCounted<Compositor> {
|
|
|
| ObserverList<CompositorObserver> observer_list_;
|
|
|
| + // Factory used to create Compositors. Settable by tests.
|
| + // The delegate can be NULL if you don't wish to catch the ScheduleDraw()
|
| + // calls to it.
|
| + static ui::Compositor*(*compositor_factory_)(
|
| + ui::CompositorDelegate* delegate);
|
| +
|
| friend class base::RefCounted<Compositor>;
|
| };
|
|
|
|
|