Chromium Code Reviews| Index: services/ui/public/cpp/surface_id_handler.h |
| diff --git a/services/ui/public/cpp/surface_id_handler.h b/services/ui/public/cpp/surface_id_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6d5dbb63c89379823a154039365e4043589ab979 |
| --- /dev/null |
| +++ b/services/ui/public/cpp/surface_id_handler.h |
| @@ -0,0 +1,36 @@ |
| +// 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 SERVICES_UI_PUBLIC_CPP_SURFACE_ID_HANDLER_H_ |
| +#define SERVICES_UI_PUBLIC_CPP_SURFACE_ID_HANDLER_H_ |
| + |
| +#include "cc/surfaces/surface_id.h" |
| +#include "cc/surfaces/surface_sequence.h" |
| +#include "ui/gfx/geometry/size.h" |
| + |
| +namespace ui { |
| + |
| +class Window; |
| + |
| +struct SurfaceInfo { |
|
sky
2016/10/14 22:44:36
Please add a description.
Fady Samuel
2016/10/14 23:09:50
Done.
|
| + cc::SurfaceId surface_id; |
| + cc::SurfaceSequence surface_sequence; |
| + gfx::Size frame_size; |
| + float device_scale_factor; |
| +}; |
| + |
| +class SurfaceIdHandler { |
| + public: |
| + // Called when a child window allocates a new surface ID. |
| + // If the handler wishes to retain ownership of the |surface_info|, |
| + // it can move it. If a child's surface has been cleared then |
| + // |surface_info| will refer to a null pointer. |
| + virtual void OnChildWindowSurfaceChanged( |
| + Window* window, |
| + std::unique_ptr<SurfaceInfo>* surface_info) = 0; |
| +}; |
| + |
| +} // namespace ui |
| + |
| +#endif // SERVICES_UI_PUBLIC_CPP_SURFACE_ID_HANDLER_H_ |