Chromium Code Reviews| Index: ui/ozone/platform/dri/native_window_manager.h |
| diff --git a/ui/ozone/platform/dri/native_window_manager.h b/ui/ozone/platform/dri/native_window_manager.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..92a31c32e165a0be6655c8e50c6307a7032d1252 |
| --- /dev/null |
| +++ b/ui/ozone/platform/dri/native_window_manager.h |
| @@ -0,0 +1,51 @@ |
| +// Copyright 2014 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 UI_OZONE_PLATFORM_DRI_NATIVE_WINDOW_MANAGER_H_ |
| +#define UI_OZONE_PLATFORM_DRI_NATIVE_WINDOW_MANAGER_H_ |
| + |
| +#include <map> |
| + |
| +#include "ui/gfx/native_widget_types.h" |
| + |
| +namespace ui { |
| + |
| +class NativeWindowDelegate; |
| + |
| +class NativeWindowManager { |
| + public: |
| + NativeWindowManager(); |
| + ~NativeWindowManager(); |
| + |
| + gfx::AcceleratedWidget AllocateAcceleratedWidget(); |
|
spang
2014/08/18 19:31:30
For consistency: NextAcceleratedWidget();
dnicoara
2014/08/19 15:53:38
Done.
|
| + |
| + // Adds a delegate for |widget|. Note: |widget| should not be associated with |
| + // a delegate when calling this function. |
| + void AddNativeWindowDelegate(gfx::AcceleratedWidget widget, |
| + NativeWindowDelegate* surface); |
| + |
| + // Removes the delegate for |widget|. Note: |widget| must have a delegate |
| + // associated with it when calling this function. |
| + void RemoveNativeWindowDelegate(gfx::AcceleratedWidget widget); |
| + |
| + // Returns the delegate associated with |widget|. Note: This function should |
| + // be called only if a valid delegate has been associated with |widget|. |
| + NativeWindowDelegate* GetNativeWindowDelegate(gfx::AcceleratedWidget widget); |
| + |
| + // Check if |widget| has a valid delegate associated with it. |
| + bool HasNativeWindowDelegate(gfx::AcceleratedWidget widget); |
| + |
| + private: |
| + typedef std::map<gfx::AcceleratedWidget, NativeWindowDelegate*> |
| + WidgetToDelegateMap; |
| + |
| + WidgetToDelegateMap delegate_map_; |
| + gfx::AcceleratedWidget allocated_widgets_; |
|
spang
2014/08/18 19:31:30
next/last_accelerated_widget_
dnicoara
2014/08/19 15:53:38
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(NativeWindowManager); |
| +}; |
| + |
| +} // namespace ui |
| + |
| +#endif // UI_OZONE_PLATFORM_DRI_NATIVE_WINDOW_MANAGER_H_ |