Refactor management of overview window copy lifetime into a separate class.
[chromium-blink-merge.git] / content / test / web_layer_tree_view_impl_for_testing.h
blob8811ac042ad2817201287734fe9b79df89e11768
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_TEST_WEB_LAYER_TREE_VIEW_IMPL_FOR_TESTING_H_
6 #define CONTENT_TEST_WEB_LAYER_TREE_VIEW_IMPL_FOR_TESTING_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "cc/trees/layer_tree_host_client.h"
10 #include "third_party/WebKit/public/platform/WebLayerTreeView.h"
12 namespace cc {
13 class LayerTreeHost;
16 namespace WebKit { class WebLayer; }
18 namespace webkit {
20 class WebLayerTreeViewImplForTesting : public WebKit::WebLayerTreeView,
21 public cc::LayerTreeHostClient {
22 public:
23 WebLayerTreeViewImplForTesting();
24 virtual ~WebLayerTreeViewImplForTesting();
26 bool Initialize();
28 // WebKit::WebLayerTreeView implementation.
29 virtual void setSurfaceReady();
30 virtual void setRootLayer(const WebKit::WebLayer& layer);
31 virtual void clearRootLayer();
32 virtual void setViewportSize(const WebKit::WebSize& unused_deprecated,
33 const WebKit::WebSize& device_viewport_size);
34 virtual WebKit::WebSize layoutViewportSize() const;
35 virtual WebKit::WebSize deviceViewportSize() const;
36 virtual void setDeviceScaleFactor(float scale_factor);
37 virtual float deviceScaleFactor() const;
38 virtual void setBackgroundColor(WebKit::WebColor);
39 virtual void setHasTransparentBackground(bool transparent);
40 virtual void setVisible(bool visible);
41 virtual void setPageScaleFactorAndLimits(float page_scale_factor,
42 float minimum,
43 float maximum);
44 virtual void startPageScaleAnimation(const WebKit::WebPoint& destination,
45 bool use_anchor,
46 float new_page_scale,
47 double duration_sec);
48 virtual void setNeedsAnimate();
49 virtual void setNeedsRedraw();
50 virtual bool commitRequested() const;
51 virtual void composite();
52 virtual void didStopFlinging();
53 virtual bool compositeAndReadback(void* pixels, const WebKit::WebRect& rect);
54 virtual void finishAllRendering();
55 virtual void setDeferCommits(bool defer_commits);
56 virtual void renderingStats(
57 WebKit::WebRenderingStats& stats) const; // NOLINT(runtime/references)
59 // cc::LayerTreeHostClient implementation.
60 virtual void WillBeginMainFrame() OVERRIDE {}
61 virtual void DidBeginMainFrame() OVERRIDE {}
62 virtual void Animate(double frame_begin_time) OVERRIDE {}
63 virtual void Layout() OVERRIDE;
64 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, float page_scale)
65 OVERRIDE;
66 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback)
67 OVERRIDE;
68 virtual void DidInitializeOutputSurface(bool success) OVERRIDE {}
69 virtual void WillCommit() OVERRIDE {}
70 virtual void DidCommit() OVERRIDE {}
71 virtual void DidCommitAndDrawFrame() OVERRIDE {}
72 virtual void DidCompleteSwapBuffers() OVERRIDE {}
73 virtual void ScheduleComposite() OVERRIDE;
74 virtual scoped_refptr<cc::ContextProvider>
75 OffscreenContextProvider() OVERRIDE;
77 private:
78 scoped_ptr<cc::LayerTreeHost> layer_tree_host_;
80 DISALLOW_COPY_AND_ASSIGN(WebLayerTreeViewImplForTesting);
83 } // namespace webkit
85 #endif // CONTENT_TEST_WEB_LAYER_TREE_VIEW_IMPL_FOR_TESTING_H_