Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ui / ozone / platform / caca / caca_window_manager.h
blob3113496542f1707ee8aa13e4fcc1ae5a34a3527b
1 // Copyright 2014 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 UI_OZONE_PLATFORM_CACA_CACA_WINDOW_MANAGER_H_
6 #define UI_OZONE_PLATFORM_CACA_CACA_WINDOW_MANAGER_H_
8 #include "base/id_map.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/threading/thread_checker.h"
11 #include "ui/ozone/public/surface_factory_ozone.h"
13 namespace gfx {
14 class Rect;
17 namespace ui {
19 class CacaWindow;
21 class CacaWindowManager : public SurfaceFactoryOzone {
22 public:
23 CacaWindowManager();
24 ~CacaWindowManager() override;
26 // Register a new libcaca window/instance. Returns the window id.
27 int32_t AddWindow(CacaWindow* window);
29 // Remove a libcaca window/instance.
30 void RemoveWindow(int32_t window_id, CacaWindow* window);
32 // ui::SurfaceFactoryOzone overrides:
33 bool LoadEGLGLES2Bindings(
34 AddGLLibraryCallback add_gl_library,
35 SetGLGetProcAddressProcCallback set_gl_get_proc_address) override;
36 scoped_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget(
37 gfx::AcceleratedWidget widget) override;
39 private:
40 IDMap<CacaWindow> windows_;
41 base::ThreadChecker thread_checker_;
43 DISALLOW_COPY_AND_ASSIGN(CacaWindowManager);
46 } // namespace ui
48 #endif // UI_OZONE_PLATFORM_CACA_CACA_WINDOW_MANAGER_H_