Explicitly add python-numpy dependency to install-build-deps.
[chromium-blink-merge.git] / ui / ozone / platform / caca / ozone_platform_caca.cc
blob9cb9fd0706e46f3b70ce2c3a56a94a76de58e0d3
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 #include "ui/ozone/platform/caca/ozone_platform_caca.h"
7 #include "ui/ozone/common/native_display_delegate_ozone.h"
8 #include "ui/ozone/platform/caca/caca_event_source.h"
9 #include "ui/ozone/platform/caca/caca_window.h"
10 #include "ui/ozone/platform/caca/caca_window_manager.h"
11 #include "ui/ozone/public/cursor_factory_ozone.h"
12 #include "ui/ozone/public/ozone_platform.h"
14 namespace ui {
16 namespace {
18 class OzonePlatformCaca : public OzonePlatform {
19 public:
20 OzonePlatformCaca() {}
21 ~OzonePlatformCaca() override {}
23 // OzonePlatform:
24 ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override {
25 return window_manager_.get();
27 CursorFactoryOzone* GetCursorFactoryOzone() override {
28 return cursor_factory_ozone_.get();
30 GpuPlatformSupport* GetGpuPlatformSupport() override {
31 return NULL; // no GPU support
33 GpuPlatformSupportHost* GetGpuPlatformSupportHost() override {
34 return NULL; // no GPU support
36 scoped_ptr<PlatformWindow> CreatePlatformWindow(
37 PlatformWindowDelegate* delegate,
38 const gfx::Rect& bounds) override {
39 scoped_ptr<CacaWindow> caca_window(new CacaWindow(
40 delegate, window_manager_.get(), event_source_.get(), bounds));
41 if (!caca_window->Initialize())
42 return nullptr;
43 return caca_window.Pass();
45 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override {
46 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone());
49 void InitializeUI() override {
50 window_manager_.reset(new CacaWindowManager);
51 event_source_.reset(new CacaEventSource());
52 cursor_factory_ozone_.reset(new CursorFactoryOzone());
55 void InitializeGPU() override {}
57 private:
58 scoped_ptr<CacaWindowManager> window_manager_;
59 scoped_ptr<CacaEventSource> event_source_;
60 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_;
62 DISALLOW_COPY_AND_ASSIGN(OzonePlatformCaca);
65 } // namespace
67 OzonePlatform* CreateOzonePlatformCaca() { return new OzonePlatformCaca; }
69 } // namespace ui