Chromium Code Reviews| Index: ui/gfx/compositor/compositor.h |
| diff --git a/ui/gfx/compositor/compositor.h b/ui/gfx/compositor/compositor.h |
| index 1251b6a42108ed2a00474e3e958b400244aedbe0..b45f10f1e2ea15cbe43d49784d7440ae4ffed340 100644 |
| --- a/ui/gfx/compositor/compositor.h |
| +++ b/ui/gfx/compositor/compositor.h |
| @@ -139,6 +139,15 @@ 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())( |
|
sky
2011/10/14 20:52:41
newline between 145 and 146.
danakj
2011/10/17 14:52:13
Done.
|
| + ui::CompositorDelegate* owner) { |
| + return compositor_factory_; |
| + } |
| + |
| protected: |
| Compositor(CompositorDelegate* delegate, const gfx::Size& size); |
| virtual ~Compositor(); |
| @@ -169,6 +178,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>; |
| }; |