Index: content/browser/renderer_host/delegated_frame_host_android.h |
diff --git a/content/browser/renderer_host/delegated_frame_host_android.h b/content/browser/renderer_host/delegated_frame_host_android.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..337593077f51d30bae8efc4951e5a4e6a74cb0d2 |
--- /dev/null |
+++ b/content/browser/renderer_host/delegated_frame_host_android.h |
@@ -0,0 +1,81 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_ANDROID_H_ |
+#define CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_ANDROID_H_ |
+ |
+#include "base/macros.h" |
+#include "base/memory/ref_counted.h" |
+#include "cc/resources/returned_resource.h" |
+#include "cc/surfaces/surface_factory.h" |
+#include "cc/surfaces/surface_factory_client.h" |
+#include "ui/gfx/selection_bound.h" |
+ |
+namespace cc { |
+ |
+class CompositorFrame; |
+class SurfaceId; |
+class SurfaceManager; |
+class SurfaceLayer; |
+class SurfaceIdAllocator; |
+enum class SurfaceDrawStatus; |
+ |
+} // namespace cc |
+ |
+namespace content { |
+ |
+class DelegatedFrameHostAndroidClient { |
+ public: |
+ virtual ~DelegatedFrameHostAndroidClient() {} |
+ |
+ virtual void AttachSurfaceLayer(scoped_refptr<cc::SurfaceLayer> layer) = 0; |
+ |
+ virtual void DetachSurfaceLayer() = 0; |
+ |
+ virtual void ReturnCompositorFrameResources( |
+ const cc::ReturnedResourceArray& resources) = 0; |
+}; |
+ |
+class DelegatedFrameHostAndroid : public cc::SurfaceFactoryClient { |
+ public: |
+ DelegatedFrameHostAndroid( |
+ cc::SurfaceManager* surface_manager, |
+ std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator, |
+ DelegatedFrameHostAndroidClient* client); |
+ |
+ ~DelegatedFrameHostAndroid(); |
+ |
+ void SubmitCompositorFrame(cc::CompositorFrame frame, |
+ cc::SurfaceFactory::DrawCallback draw_callback); |
+ |
+ bool HasDelegatedContent() const; |
+ |
+ void DestroyDelegatedContent(); |
+ |
+ uint32_t GetSurfaceIdNamespace(); |
+ |
+ private: |
+ // cc::SurfaceFactoryClient implementation. |
+ void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
+ void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; |
+ |
+ scoped_refptr<cc::SurfaceLayer> CreateSurfaceLayer(); |
+ |
+ cc::SurfaceManager* surface_manager_; |
+ std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; |
+ std::unique_ptr<cc::SurfaceFactory> surface_factory_; |
+ cc::SurfaceId surface_id_; |
+ gfx::Size current_surface_size_; |
+ |
+ gfx::Vector2dF location_bar_content_translation_; |
+ cc::Selection<gfx::SelectionBound> current_viewport_selection_; |
+ |
+ DelegatedFrameHostAndroidClient* client_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(DelegatedFrameHostAndroid); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_ANDROID_H_ |