Index: components/view_manager/public/cpp/surface.h |
diff --git a/components/view_manager/public/cpp/surface.h b/components/view_manager/public/cpp/surface.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ef6e3c9999ae4cb0a6cd35834506b929658f367c |
--- /dev/null |
+++ b/components/view_manager/public/cpp/surface.h |
@@ -0,0 +1,59 @@ |
+// Copyright 2015 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 COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_SURFACE_H_ |
+#define COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_SURFACE_H_ |
+ |
+#include "base/observer_list.h" |
+#include "components/view_manager/public/interfaces/compositor_frame.mojom.h" |
+#include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" |
+#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr_info.h" |
+ |
+namespace cc { |
+class CompositorFrame; |
sky
2015/08/26 22:58:03
This shouldn't be needed.
Fady Samuel
2015/08/26 23:51:00
Removed.
|
+} |
+ |
+namespace mojo { |
+class View; |
+} |
+ |
+namespace uip { |
sky
2015/08/26 22:58:03
Why is this in the namespace uip? It's in the view
Fady Samuel
2015/08/26 23:51:00
Changed to mojo for now.
|
+ |
+class SurfaceClient; |
+class SurfaceObserver; |
sky
2015/08/26 22:58:03
You don't seem to use this.
Fady Samuel
2015/08/26 23:51:00
Removed.
|
+ |
+class Surface : public mojo::SurfaceClient { |
sky
2015/08/26 22:58:03
Add description.
Fady Samuel
2015/08/26 23:51:00
Done.
|
+ public: |
+ ~Surface() override; |
+ |
+ // Called to indicate that the current thread has assumed control of this |
+ // object. |
+ void BindToThread(); |
+ |
+ // TODO(fsamuel): Add a callback. |
+ void SubmitCompositorFrame(mojo::CompositorFramePtr frame); |
+ |
+ void set_client(uip::SurfaceClient* client) { client_ = client; } |
+ |
+ private: |
+ friend class mojo::View; |
+ |
+ Surface(mojo::InterfacePtrInfo<mojo::Surface> surface_info, |
+ mojo::InterfaceRequest<mojo::SurfaceClient> client_request); |
+ |
+ // SurfaceClient implementation: |
+ void ReturnResources( |
+ mojo::Array<mojo::ReturnedResourcePtr> resources) override; |
+ |
+ uip::SurfaceClient* client_; |
+ mojo::InterfacePtrInfo<mojo::Surface> surface_info_; |
+ mojo::InterfaceRequest<mojo::SurfaceClient> client_request_; |
+ mojo::SurfacePtr surface_; |
+ mojo::Binding<mojo::SurfaceClient> client_binding_; |
+ bool bound_to_thread_; |
+}; |
+ |
+} // namespace uip |
+ |
+#endif // COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_SURFACE_H_ |