Ozone: Remove the caca platform from the tree

This Ozone platform is not built by default, is not handled by the try
bots, does not have the required dependencies installed in the sysroot
and does not have any unit test. It is also really only useful as a
demo so instead of maintaining it, we can just update the documentation
to explain how to build the latest revision where it is known to work.

BUG=None

Review-Url: https://codereview.chromium.org/2445323002
Cr-Commit-Position: refs/heads/master@{#427635}
diff --git a/ui/ozone/BUILD.gn b/ui/ozone/BUILD.gn
index 70a0b92b..028ac6b1 100644
--- a/ui/ozone/BUILD.gn
+++ b/ui/ozone/BUILD.gn
@@ -24,11 +24,6 @@
   ozone_platform_deps += [ "platform/headless" ]
 }
 
-if (ozone_platform_caca) {
-  ozone_platforms += [ "caca" ]
-  ozone_platform_deps += [ "platform/caca" ]
-}
-
 if (ozone_platform_gbm) {
   ozone_platforms += [ "gbm" ]
   ozone_platform_deps += [ "platform/drm:gbm" ]
diff --git a/ui/ozone/ozone.gni b/ui/ozone/ozone.gni
index 629b75f..f6493c2 100644
--- a/ui/ozone/ozone.gni
+++ b/ui/ozone/ozone.gni
@@ -22,7 +22,6 @@
   ozone_platform = ""
 
   # Enable individual platforms.
-  ozone_platform_caca = false
   ozone_platform_cast = false
   ozone_platform_gbm = false
   ozone_platform_headless = false
@@ -59,7 +58,7 @@
   }
 }
 
-assert(use_ozone || !(ozone_platform_caca || ozone_platform_cast ||
-                          ozone_platform_gbm || ozone_platform_headless ||
-                          ozone_platform_x11 || ozone_platform_wayland),
+assert(use_ozone || !(ozone_platform_cast || ozone_platform_gbm ||
+                          ozone_platform_headless || ozone_platform_x11 ||
+                          ozone_platform_wayland),
        "Must set use_ozone to select ozone platforms")
diff --git a/ui/ozone/platform/caca/BUILD.gn b/ui/ozone/platform/caca/BUILD.gn
deleted file mode 100644
index be3fbb9..0000000
--- a/ui/ozone/platform/caca/BUILD.gn
+++ /dev/null
@@ -1,43 +0,0 @@
-# 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.
-
-import("//build/config/linux/pkg_config.gni")
-
-visibility = [ "//ui/ozone/*" ]
-
-source_set("caca") {
-  sources = [
-    "caca_event_source.cc",
-    "caca_event_source.h",
-    "caca_window.cc",
-    "caca_window.h",
-    "caca_window_manager.cc",
-    "caca_window_manager.h",
-    "client_native_pixmap_factory_caca.cc",
-    "client_native_pixmap_factory_caca.h",
-    "ozone_platform_caca.cc",
-    "ozone_platform_caca.h",
-    "scoped_caca_types.cc",
-    "scoped_caca_types.h",
-  ]
-
-  deps = [
-    "//base",
-    "//skia",
-    "//ui/events",
-    "//ui/events/ozone:events_ozone_layout",
-    "//ui/events/platform",
-    "//ui/gfx",
-    "//ui/gfx/geometry",
-    "//ui/ozone:ozone_base",
-    "//ui/ozone/common",
-    "//ui/platform_window",
-  ]
-
-  configs += [ ":libcaca" ]
-}
-
-pkg_config("libcaca") {
-  packages = [ "caca" ]
-}
diff --git a/ui/ozone/platform/caca/OWNERS b/ui/ozone/platform/caca/OWNERS
deleted file mode 100644
index 0d77c0e..0000000
--- a/ui/ozone/platform/caca/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-dnicoara@chromium.org
diff --git a/ui/ozone/platform/caca/caca_event_source.cc b/ui/ozone/platform/caca/caca_event_source.cc
deleted file mode 100644
index b430a8fe..0000000
--- a/ui/ozone/platform/caca/caca_event_source.cc
+++ /dev/null
@@ -1,234 +0,0 @@
-// 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.
-
-#include "ui/ozone/platform/caca/caca_event_source.h"
-
-#include <caca.h>
-
-#include "base/bind.h"
-#include "base/macros.h"
-#include "base/message_loop/message_loop.h"
-#include "base/strings/string_util.h"
-#include "ui/events/event.h"
-#include "ui/events/event_utils.h"
-#include "ui/events/keycodes/keyboard_codes.h"
-#include "ui/ozone/platform/caca/caca_window.h"
-
-namespace ui {
-
-namespace {
-
-ui::KeyboardCode GetKeyboardCode(const caca_event_t& event) {
-  // List of special mappings the Caca provides.
-  static const ui::KeyboardCode kCacaKeyMap[] = {
-    ui::VKEY_UNKNOWN,
-    ui::VKEY_A,
-    ui::VKEY_B,
-    ui::VKEY_C,
-    ui::VKEY_D,
-    ui::VKEY_E,
-    ui::VKEY_F,
-    ui::VKEY_G,
-    ui::VKEY_BACK,
-    ui::VKEY_TAB,
-    ui::VKEY_J,
-    ui::VKEY_K,
-    ui::VKEY_L,
-    ui::VKEY_RETURN,
-    ui::VKEY_N,
-    ui::VKEY_O,
-    ui::VKEY_P,
-    ui::VKEY_Q,
-    ui::VKEY_R,
-    ui::VKEY_PAUSE,
-    ui::VKEY_T,
-    ui::VKEY_U,
-    ui::VKEY_V,
-    ui::VKEY_W,
-    ui::VKEY_X,
-    ui::VKEY_Y,
-    ui::VKEY_Z,
-    ui::VKEY_ESCAPE,
-    ui::VKEY_DELETE,
-    ui::VKEY_UP,
-    ui::VKEY_DOWN,
-    ui::VKEY_LEFT,
-    ui::VKEY_RIGHT,
-    ui::VKEY_INSERT,
-    ui::VKEY_HOME,
-    ui::VKEY_END,
-    ui::VKEY_PRIOR,
-    ui::VKEY_NEXT,
-    ui::VKEY_F1,
-    ui::VKEY_F2,
-    ui::VKEY_F3,
-    ui::VKEY_F4,
-    ui::VKEY_F5,
-    ui::VKEY_F6,
-    ui::VKEY_F7,
-    ui::VKEY_F8,
-    ui::VKEY_F9,
-    ui::VKEY_F10,
-    ui::VKEY_F11,
-    ui::VKEY_F12,
-  };
-
-  int key_code = caca_get_event_key_ch(&event);
-  if (base::IsAsciiLower(key_code))
-    return static_cast<ui::KeyboardCode>(key_code - ('a' - 'A'));
-  if (key_code >= '0' && key_code <= 'Z')
-    return static_cast<ui::KeyboardCode>(key_code);
-  if (static_cast<unsigned int>(key_code) < arraysize(kCacaKeyMap))
-    return kCacaKeyMap[key_code];
-
-  return ui::VKEY_UNKNOWN;
-}
-
-int ModifierFromKey(const caca_event_t& event) {
-  int key_code = caca_get_event_key_ch(&event);
-  if (base::IsAsciiUpper(key_code))
-    return ui::EF_SHIFT_DOWN;
-  if ((key_code >= CACA_KEY_CTRL_A && key_code <= CACA_KEY_CTRL_G) ||
-      (key_code >= CACA_KEY_CTRL_J && key_code <= CACA_KEY_CTRL_L) ||
-      (key_code >= CACA_KEY_CTRL_N && key_code <= CACA_KEY_CTRL_R) ||
-      (key_code >= CACA_KEY_CTRL_T && key_code <= CACA_KEY_CTRL_Z))
-    return ui::EF_CONTROL_DOWN;
-
-  return ui::EF_NONE;
-}
-
-int ModifierFromButton(const caca_event_t& event) {
-  switch (caca_get_event_mouse_button(&event)) {
-    case 1:
-      return ui::EF_LEFT_MOUSE_BUTTON;
-    case 2:
-      return ui::EF_RIGHT_MOUSE_BUTTON;
-    case 3:
-      return ui::EF_MIDDLE_MOUSE_BUTTON;
-  }
-  return 0;
-}
-
-// Translate coordinates to bitmap coordinates.
-gfx::PointF TranslateLocation(const gfx::PointF& location, CacaWindow* window) {
-  gfx::Size physical_size = window->physical_size();
-  gfx::Size bitmap_size = window->bitmap_size();
-  return gfx::PointF(
-      location.x() * bitmap_size.width() / physical_size.width(),
-      location.y() * bitmap_size.height() / physical_size.height());
-}
-
-ui::EventType GetEventTypeFromNative(const caca_event_t& event) {
-  switch (caca_get_event_type(&event)) {
-    case CACA_EVENT_KEY_PRESS:
-      return ui::ET_KEY_PRESSED;
-    case CACA_EVENT_KEY_RELEASE:
-      return ui::ET_KEY_RELEASED;
-    case CACA_EVENT_MOUSE_PRESS:
-      return ui::ET_MOUSE_PRESSED;
-    case CACA_EVENT_MOUSE_RELEASE:
-      return ui::ET_MOUSE_RELEASED;
-    case CACA_EVENT_MOUSE_MOTION:
-      return ui::ET_MOUSE_MOVED;
-    default:
-      return ui::ET_UNKNOWN;
-  }
-}
-
-}  // namespace
-
-CacaEventSource::CacaEventSource() {
-}
-
-CacaEventSource::~CacaEventSource() {
-}
-
-void CacaEventSource::TryProcessingEvent(CacaWindow* window) {
-  if (!window->display())
-    return;
-
-  caca_event_t event;
-  int event_mask = CACA_EVENT_KEY_PRESS | CACA_EVENT_KEY_RELEASE |
-                   CACA_EVENT_MOUSE_PRESS | CACA_EVENT_MOUSE_RELEASE |
-                   CACA_EVENT_MOUSE_MOTION | CACA_EVENT_RESIZE |
-                   CACA_EVENT_QUIT;
-
-  if (!caca_get_event(window->display(), event_mask, &event, 0))
-    return;
-
-  switch (caca_get_event_type(&event)) {
-    case CACA_EVENT_KEY_PRESS:
-    case CACA_EVENT_KEY_RELEASE:
-    case CACA_EVENT_MOUSE_PRESS:
-    case CACA_EVENT_MOUSE_RELEASE:
-    case CACA_EVENT_MOUSE_MOTION:
-      OnInputEvent(&event, window);
-      break;
-    case CACA_EVENT_RESIZE:
-      window->OnCacaResize();
-      break;
-    case CACA_EVENT_QUIT:
-      window->OnCacaQuit();
-      break;
-    default:
-      NOTIMPLEMENTED();
-  }
-}
-
-void CacaEventSource::OnInputEvent(caca_event_t* event, CacaWindow* window) {
-  ui::EventType type = GetEventTypeFromNative(*event);
-  bool pressed = type == ui::ET_KEY_PRESSED || type == ui::ET_MOUSE_PRESSED;
-
-  switch (type) {
-    case ui::ET_KEY_PRESSED:
-    case ui::ET_KEY_RELEASED: {
-      if (pressed)
-        modifier_flags_ |= ModifierFromKey(*event);
-      else
-        modifier_flags_ &= ~ModifierFromKey(*event);
-
-      ui::KeyEvent key_event(
-          type, GetKeyboardCode(*event), modifier_flags_);
-      window->OnCacaEvent(&key_event);
-      break;
-    }
-    case ui::ET_MOUSE_MOVED:
-      last_cursor_location_.SetPoint(caca_get_event_mouse_x(event),
-                                     caca_get_event_mouse_y(event));
-      // Update cursor location.
-      caca_gotoxy(caca_get_canvas(window->display()),
-                  last_cursor_location_.x(),
-                  last_cursor_location_.y());
-
-    // fallthrough
-    case ui::ET_MOUSE_PRESSED:
-    case ui::ET_MOUSE_RELEASED: {
-      int flags = 0;
-      int changed_flags = 0;
-      if (type != ui::ET_MOUSE_MOVED) {
-        if (pressed) {
-          changed_flags = ModifierFromButton(*event);
-          modifier_flags_ |= changed_flags;
-        } else {
-          modifier_flags_ &= ~changed_flags;
-        }
-        // On release the button pressed is removed from |modifier_flags_|,
-        // but sending the event needs it set.
-        flags = modifier_flags_ | changed_flags;
-      }
-      gfx::PointF location = TranslateLocation(last_cursor_location_, window);
-      ui::MouseEvent mouse_event(type, gfx::Point(), gfx::Point(),
-                                 EventTimeForNow(), flags, changed_flags);
-      mouse_event.set_location_f(location);
-      mouse_event.set_root_location_f(location);
-      window->OnCacaEvent(&mouse_event);
-      break;
-    }
-    default:
-      NOTIMPLEMENTED();
-      break;
-  }
-}
-
-}  // namespace ui
diff --git a/ui/ozone/platform/caca/caca_event_source.h b/ui/ozone/platform/caca/caca_event_source.h
deleted file mode 100644
index c338842..0000000
--- a/ui/ozone/platform/caca/caca_event_source.h
+++ /dev/null
@@ -1,45 +0,0 @@
-// 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_CACA_CACA_EVENT_SOURCE_H_
-#define UI_OZONE_PLATFORM_CACA_CACA_EVENT_SOURCE_H_
-
-#include <caca.h>
-
-#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "base/time/time.h"
-#include "ui/events/platform/platform_event_source.h"
-#include "ui/events/platform/scoped_event_dispatcher.h"
-#include "ui/gfx/geometry/point_f.h"
-
-namespace ui {
-
-class CacaWindow;
-
-class CacaEventSource : public PlatformEventSource {
- public:
-  CacaEventSource();
-  ~CacaEventSource() override;
-
-  // Poll for an event on a particular window. Input events will be
-  // dispatched on the given dispatcher.
-  void TryProcessingEvent(CacaWindow* window);
-
-  // Process an input event on a particular window.
-  void OnInputEvent(caca_event_t* event, CacaWindow* window);
-
- private:
-  // Keep track of last cursor position to dispatch correct mouse push/release
-  // events.
-  gfx::PointF last_cursor_location_;
-
-  int modifier_flags_ = 0;
-
-  DISALLOW_COPY_AND_ASSIGN(CacaEventSource);
-};
-
-}  // namespace ui
-
-#endif  // UI_OZONE_PLATFORM_CACA_CACA_EVENT_SOURCE_H_
diff --git a/ui/ozone/platform/caca/caca_window.cc b/ui/ozone/platform/caca/caca_window.cc
deleted file mode 100644
index 821a898..0000000
--- a/ui/ozone/platform/caca/caca_window.cc
+++ /dev/null
@@ -1,157 +0,0 @@
-// 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.
-
-#include "ui/ozone/platform/caca/caca_window.h"
-
-#include "base/bind.h"
-#include "base/location.h"
-#include "base/logging.h"
-#include "base/single_thread_task_runner.h"
-#include "base/strings/utf_string_conversions.h"
-#include "base/threading/thread_task_runner_handle.h"
-#include "base/trace_event/trace_event.h"
-#include "ui/events/ozone/events_ozone.h"
-#include "ui/events/platform/platform_event_source.h"
-#include "ui/ozone/platform/caca/caca_event_source.h"
-#include "ui/ozone/platform/caca/caca_window_manager.h"
-#include "ui/platform_window/platform_window_delegate.h"
-
-namespace ui {
-
-namespace {
-
-// Size of initial cnavas (in characters).
-const int kDefaultCanvasWidth = 160;
-const int kDefaultCanvasHeight = 48;
-
-}  // namespace
-
-// TODO(dnicoara) As an optimization, |bitmap_size_| should be scaled based on
-// |physical_size_| and font size.
-CacaWindow::CacaWindow(PlatformWindowDelegate* delegate,
-                       CacaWindowManager* manager,
-                       CacaEventSource* event_source,
-                       const gfx::Rect& bounds)
-    : delegate_(delegate),
-      manager_(manager),
-      event_source_(event_source),
-      weak_ptr_factory_(this) {
-  widget_ = manager_->AddWindow(this);
-  ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
-  delegate_->OnAcceleratedWidgetAvailable(widget_, 1.f);
-}
-
-CacaWindow::~CacaWindow() {
-  ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
-  manager_->RemoveWindow(widget_, this);
-}
-
-bool CacaWindow::Initialize() {
-  if (display_)
-    return true;
-
-  canvas_.reset(caca_create_canvas(kDefaultCanvasWidth, kDefaultCanvasHeight));
-  if (!canvas_) {
-    PLOG(ERROR) << "failed to create libcaca canvas";
-    return false;
-  }
-
-  display_.reset(caca_create_display(canvas_.get()));
-  if (!display_) {
-    PLOG(ERROR) << "failed to initialize libcaca display";
-    return false;
-  }
-
-  caca_set_cursor(display_.get(), 1);
-  caca_set_display_title(display_.get(), "Ozone Content Shell");
-
-  UpdateDisplaySize();
-
-  TryProcessingEvent();
-
-  return true;
-}
-
-void CacaWindow::TryProcessingEvent() {
-  event_source_->TryProcessingEvent(this);
-
-  // Caca uses a poll based event retrieval. Since we don't want to block we'd
-  // either need to spin up a new thread or just poll. For simplicity just poll
-  // for messages.
-  base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
-      FROM_HERE, base::Bind(&CacaWindow::TryProcessingEvent,
-                            weak_ptr_factory_.GetWeakPtr()),
-      base::TimeDelta::FromMilliseconds(10));
-}
-
-void CacaWindow::UpdateDisplaySize() {
-  physical_size_.SetSize(caca_get_canvas_width(canvas_.get()),
-                         caca_get_canvas_height(canvas_.get()));
-
-  bitmap_size_.SetSize(caca_get_display_width(display_.get()),
-                       caca_get_display_height(display_.get()));
-}
-
-void CacaWindow::OnCacaResize() {
-  UpdateDisplaySize();
-
-  delegate_->OnBoundsChanged(gfx::Rect(bitmap_size_));
-}
-
-void CacaWindow::OnCacaQuit() {
-  delegate_->OnCloseRequest();
-}
-
-
-void CacaWindow::OnCacaEvent(ui::Event* event) {
-  DispatchEventFromNativeUiEvent(
-      event, base::Bind(&PlatformWindowDelegate::DispatchEvent,
-                        base::Unretained(delegate_)));
-}
-
-gfx::Rect CacaWindow::GetBounds() { return gfx::Rect(bitmap_size_); }
-
-void CacaWindow::SetBounds(const gfx::Rect& bounds) {}
-
-void CacaWindow::Show() {}
-
-void CacaWindow::Hide() {}
-
-void CacaWindow::Close() {}
-
-void CacaWindow::SetCapture() {}
-
-void CacaWindow::ReleaseCapture() {}
-
-void CacaWindow::ToggleFullscreen() {}
-
-void CacaWindow::Maximize() {}
-
-void CacaWindow::Minimize() {}
-
-void CacaWindow::Restore() {}
-
-void CacaWindow::SetCursor(PlatformCursor cursor) {}
-
-void CacaWindow::MoveCursorTo(const gfx::Point& location) {}
-
-void CacaWindow::ConfineCursorToBounds(const gfx::Rect& bounds) {}
-
-PlatformImeController* CacaWindow::GetPlatformImeController() {
-  return nullptr;
-}
-
-void CacaWindow::SetTitle(const base::string16& title) {
-  caca_set_display_title(display_.get(), UTF16ToUTF8(title).c_str());
-}
-
-bool CacaWindow::CanDispatchEvent(const PlatformEvent& event) { return true; }
-
-uint32_t CacaWindow::DispatchEvent(const PlatformEvent& ne) {
-  // We don't dispatch events via PlatformEventSource.
-  NOTREACHED();
-  return ui::POST_DISPATCH_STOP_PROPAGATION;
-}
-
-}  // namespace ui
diff --git a/ui/ozone/platform/caca/caca_window.h b/ui/ozone/platform/caca/caca_window.h
deleted file mode 100644
index 8ef7077..0000000
--- a/ui/ozone/platform/caca/caca_window.h
+++ /dev/null
@@ -1,101 +0,0 @@
-// 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_CACA_CACA_WINDOW_H_
-#define UI_OZONE_PLATFORM_CACA_CACA_WINDOW_H_
-
-#include <caca.h>
-#include <stdint.h>
-
-#include "base/debug/stack_trace.h"
-#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
-#include "ui/events/platform/platform_event_dispatcher.h"
-#include "ui/gfx/geometry/size.h"
-#include "ui/gfx/native_widget_types.h"
-#include "ui/ozone/platform/caca/scoped_caca_types.h"
-#include "ui/platform_window/platform_window.h"
-
-namespace ui {
-
-class CacaEventSource;
-class CacaWindowManager;
-class PlatformWindowDelegate;
-
-// Basic initialization of Libcaca. This needs to be shared between SFO and EFO
-// since both need the |display_| to draw and process events respectively.
-// Note, |canvas_| needs to be here since it is needed for creating a
-// |display_|.
-class CacaWindow : public PlatformWindow, public PlatformEventDispatcher {
- public:
-  CacaWindow(PlatformWindowDelegate* delegate,
-             CacaWindowManager* manager,
-             CacaEventSource* event_source,
-             const gfx::Rect& bounds);
-  ~CacaWindow() override;
-
-  bool Initialize();
-
-  // Handlers for events received from libcaca.
-  void OnCacaQuit();
-  void OnCacaResize();
-  void OnCacaEvent(ui::Event* event);
-
-  // This is the Caca canvas size.
-  gfx::Size physical_size() const { return physical_size_; }
-  gfx::Size bitmap_size() const { return bitmap_size_; }
-  caca_display_t* display() const { return display_.get(); }
-
-  // PlatformWindow:
-  gfx::Rect GetBounds() override;
-  void SetBounds(const gfx::Rect& bounds) override;
-  void Show() override;
-  void Hide() override;
-  void Close() override;
-  void SetCapture() override;
-  void ReleaseCapture() override;
-  void ToggleFullscreen() override;
-  void Maximize() override;
-  void Minimize() override;
-  void Restore() override;
-  void SetCursor(PlatformCursor cursor) override;
-  void MoveCursorTo(const gfx::Point& location) override;
-  void ConfineCursorToBounds(const gfx::Rect& bounds) override;
-  PlatformImeController* GetPlatformImeController() override;
-  void SetTitle(const base::string16& title) override;
-
-  // PlatformEventDispatcher:
-  bool CanDispatchEvent(const PlatformEvent& event) override;
-  uint32_t DispatchEvent(const PlatformEvent& event) override;
-
- private:
-  // Event polling.
-  void TryProcessingEvent();
-
-  // Sync sizes with libcaca.
-  void UpdateDisplaySize();
-
-  PlatformWindowDelegate* delegate_;
-  CacaWindowManager* manager_;
-  CacaEventSource* event_source_;
-  gfx::AcceleratedWidget widget_;
-
-  ScopedCacaCanvas canvas_;
-  ScopedCacaDisplay display_;
-
-  // Size of the console in characters. This can be changed by setting
-  // CACA_GEOMETRY environment variable.
-  gfx::Size physical_size_;
-
-  // Size of the backing buffer we draw into. Size in pixels.
-  gfx::Size bitmap_size_;
-
-  base::WeakPtrFactory<CacaWindow> weak_ptr_factory_;
-
-  DISALLOW_COPY_AND_ASSIGN(CacaWindow);
-};
-
-}  // namespace ui
-
-#endif  // UI_OZONE_PLATFORM_CACA_CACA_WINDOW_H_
diff --git a/ui/ozone/platform/caca/caca_window_manager.cc b/ui/ozone/platform/caca/caca_window_manager.cc
deleted file mode 100644
index 0246679..0000000
--- a/ui/ozone/platform/caca/caca_window_manager.cc
+++ /dev/null
@@ -1,135 +0,0 @@
-// 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.
-
-#include "ui/ozone/platform/caca/caca_window_manager.h"
-
-#include <stddef.h>
-
-#include "base/macros.h"
-#include "base/trace_event/trace_event.h"
-#include "third_party/skia/include/core/SkCanvas.h"
-#include "third_party/skia/include/core/SkRefCnt.h"
-#include "third_party/skia/include/core/SkSurface.h"
-#include "ui/gfx/skia_util.h"
-#include "ui/gfx/vsync_provider.h"
-#include "ui/ozone/platform/caca/caca_window.h"
-#include "ui/ozone/platform/caca/scoped_caca_types.h"
-#include "ui/ozone/public/surface_ozone_canvas.h"
-
-namespace ui {
-
-namespace {
-
-class CacaSurface : public ui::SurfaceOzoneCanvas {
- public:
-  explicit CacaSurface(CacaWindow* window);
-  ~CacaSurface() override;
-
-  bool Initialize();
-
-  // ui::SurfaceOzoneCanvas overrides:
-  sk_sp<SkSurface> GetSurface() override;
-  void ResizeCanvas(const gfx::Size& viewport_size) override;
-  void PresentCanvas(const gfx::Rect& damage) override;
-  std::unique_ptr<gfx::VSyncProvider> CreateVSyncProvider() override;
-
- private:
-  CacaWindow* window_;  // Not owned.
-
-  ScopedCacaDither dither_;
-
-  sk_sp<SkSurface> surface_;
-
-  DISALLOW_COPY_AND_ASSIGN(CacaSurface);
-};
-
-CacaSurface::CacaSurface(CacaWindow* window) : window_(window) {
-}
-
-CacaSurface::~CacaSurface() {
-}
-
-bool CacaSurface::Initialize() {
-  ResizeCanvas(window_->bitmap_size());
-  return true;
-}
-
-sk_sp<SkSurface> CacaSurface::GetSurface() {
-  return surface_;
-}
-
-void CacaSurface::ResizeCanvas(const gfx::Size& viewport_size) {
-  TRACE_EVENT0("ozone", "CacaSurface::ResizeCanvas");
-
-  VLOG(2) << "creating libcaca surface with from window " << (void*)window_;
-
-  SkImageInfo info = SkImageInfo::Make(window_->bitmap_size().width(),
-                                       window_->bitmap_size().height(),
-                                       kN32_SkColorType,
-                                       kPremul_SkAlphaType);
-
-  surface_ = SkSurface::MakeRaster(info);
-  if (!surface_)
-    LOG(ERROR) << "Failed to create SkSurface";
-
-  dither_.reset(caca_create_dither(info.bytesPerPixel() * 8,
-                                   info.width(),
-                                   info.height(),
-                                   info.minRowBytes(),
-                                   0x00ff0000,
-                                   0x0000ff00,
-                                   0x000000ff,
-                                   0xff000000));
-  if (!dither_)
-    LOG(ERROR) << "failed to create dither";
-}
-
-void CacaSurface::PresentCanvas(const gfx::Rect& damage) {
-  TRACE_EVENT0("ozone", "CacaSurface::PresentCanvas");
-
-  SkPixmap pixmap;
-  surface_->peekPixels(&pixmap);
-
-  caca_canvas_t* canvas = caca_get_canvas(window_->display());
-  caca_dither_bitmap(canvas, 0, 0, caca_get_canvas_width(canvas),
-                     caca_get_canvas_height(canvas), dither_.get(),
-                     static_cast<const uint8_t*>(pixmap.addr()));
-  caca_refresh_display(window_->display());
-}
-
-std::unique_ptr<gfx::VSyncProvider> CacaSurface::CreateVSyncProvider() {
-  return nullptr;
-}
-
-}  // namespace
-
-CacaWindowManager::CacaWindowManager() {
-}
-
-int32_t CacaWindowManager::AddWindow(CacaWindow* window) {
-  return windows_.Add(window);
-}
-
-void CacaWindowManager::RemoveWindow(int window_id, CacaWindow* window) {
-  DCHECK_EQ(window, windows_.Lookup(window_id));
-  windows_.Remove(window_id);
-}
-
-CacaWindowManager::~CacaWindowManager() {
-  DCHECK(thread_checker_.CalledOnValidThread());
-}
-
-std::unique_ptr<ui::SurfaceOzoneCanvas>
-CacaWindowManager::CreateCanvasForWidget(gfx::AcceleratedWidget widget) {
-  DCHECK(thread_checker_.CalledOnValidThread());
-  CacaWindow* window = windows_.Lookup(widget);
-  DCHECK(window);
-
-  std::unique_ptr<CacaSurface> canvas(new CacaSurface(window));
-  bool initialized = canvas->Initialize();
-  DCHECK(initialized);
-  return std::move(canvas);
-}
-
-}  // namespace ui
diff --git a/ui/ozone/platform/caca/caca_window_manager.h b/ui/ozone/platform/caca/caca_window_manager.h
deleted file mode 100644
index c31589c..0000000
--- a/ui/ozone/platform/caca/caca_window_manager.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// 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_CACA_CACA_WINDOW_MANAGER_H_
-#define UI_OZONE_PLATFORM_CACA_CACA_WINDOW_MANAGER_H_
-
-#include <stdint.h>
-
-#include <memory>
-
-#include "base/id_map.h"
-#include "base/macros.h"
-#include "base/threading/thread_checker.h"
-#include "ui/ozone/public/surface_factory_ozone.h"
-
-namespace gfx {
-class Rect;
-}
-
-namespace ui {
-
-class CacaWindow;
-
-class CacaWindowManager : public SurfaceFactoryOzone {
- public:
-  CacaWindowManager();
-  ~CacaWindowManager() override;
-
-  // Register a new libcaca window/instance. Returns the window id.
-  int32_t AddWindow(CacaWindow* window);
-
-  // Remove a libcaca window/instance.
-  void RemoveWindow(int32_t window_id, CacaWindow* window);
-
-  // ui::SurfaceFactoryOzone overrides:
-  std::unique_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget(
-      gfx::AcceleratedWidget widget) override;
-
- private:
-  IDMap<CacaWindow> windows_;
-  base::ThreadChecker thread_checker_;
-
-  DISALLOW_COPY_AND_ASSIGN(CacaWindowManager);
-};
-
-}  // namespace ui
-
-#endif  // UI_OZONE_PLATFORM_CACA_CACA_WINDOW_MANAGER_H_
diff --git a/ui/ozone/platform/caca/client_native_pixmap_factory_caca.cc b/ui/ozone/platform/caca/client_native_pixmap_factory_caca.cc
deleted file mode 100644
index ffea447..0000000
--- a/ui/ozone/platform/caca/client_native_pixmap_factory_caca.cc
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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.
-
-#include "ui/ozone/platform/caca/client_native_pixmap_factory_caca.h"
-
-#include "ui/ozone/common/stub_client_native_pixmap_factory.h"
-
-namespace ui {
-
-ClientNativePixmapFactory* CreateClientNativePixmapFactoryCaca() {
-  return CreateStubClientNativePixmapFactory();
-}
-
-}  // namespace ui
diff --git a/ui/ozone/platform/caca/client_native_pixmap_factory_caca.h b/ui/ozone/platform/caca/client_native_pixmap_factory_caca.h
deleted file mode 100644
index 1745e8e..0000000
--- a/ui/ozone/platform/caca/client_native_pixmap_factory_caca.h
+++ /dev/null
@@ -1,17 +0,0 @@
-// 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 UI_OZONE_PLATFORM_CACA_CLIENT_NATIVE_PIXMAP_FACTORY_CACA_H_
-#define UI_OZONE_PLATFORM_CACA_CLIENT_NATIVE_PIXMAP_FACTORY_CACA_H_
-
-namespace ui {
-
-class ClientNativePixmapFactory;
-
-// Constructor hook for use in constructor_list.cc
-ClientNativePixmapFactory* CreateClientNativePixmapFactoryCaca();
-
-}  // namespace ui
-
-#endif  // UI_OZONE_PLATFORM_CACA_CLIENT_NATIVE_PIXMAP_FACTORY_CACA_H_
diff --git a/ui/ozone/platform/caca/ozone_platform_caca.cc b/ui/ozone/platform/caca/ozone_platform_caca.cc
deleted file mode 100644
index 536a6d2..0000000
--- a/ui/ozone/platform/caca/ozone_platform_caca.cc
+++ /dev/null
@@ -1,101 +0,0 @@
-// 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.
-
-#include "ui/ozone/platform/caca/ozone_platform_caca.h"
-
-#include "base/macros.h"
-#include "base/memory/ptr_util.h"
-#include "ui/events/ozone/layout/keyboard_layout_engine_manager.h"
-#include "ui/events/ozone/layout/no/no_keyboard_layout_engine.h"
-#include "ui/ozone/common/native_display_delegate_ozone.h"
-#include "ui/ozone/common/stub_overlay_manager.h"
-#include "ui/ozone/platform/caca/caca_event_source.h"
-#include "ui/ozone/platform/caca/caca_window.h"
-#include "ui/ozone/platform/caca/caca_window_manager.h"
-#include "ui/ozone/public/cursor_factory_ozone.h"
-#include "ui/ozone/public/gpu_platform_support_host.h"
-#include "ui/ozone/public/input_controller.h"
-#include "ui/ozone/public/ozone_platform.h"
-#include "ui/ozone/public/system_input_injector.h"
-
-namespace ui {
-
-namespace {
-
-class OzonePlatformCaca : public OzonePlatform {
- public:
-  OzonePlatformCaca() {}
-  ~OzonePlatformCaca() override {}
-
-  // OzonePlatform:
-  ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override {
-    return window_manager_.get();
-  }
-  OverlayManagerOzone* GetOverlayManager() override {
-    return overlay_manager_.get();
-  }
-  CursorFactoryOzone* GetCursorFactoryOzone() override {
-    return cursor_factory_ozone_.get();
-  }
-  InputController* GetInputController() override {
-    return input_controller_.get();
-  }
-  GpuPlatformSupportHost* GetGpuPlatformSupportHost() override {
-    return gpu_platform_support_host_.get();
-  }
-  std::unique_ptr<SystemInputInjector> CreateSystemInputInjector() override {
-    return nullptr;  // no input injection support.
-  }
-  std::unique_ptr<PlatformWindow> CreatePlatformWindow(
-      PlatformWindowDelegate* delegate,
-      const gfx::Rect& bounds) override {
-    std::unique_ptr<CacaWindow> caca_window(new CacaWindow(
-        delegate, window_manager_.get(), event_source_.get(), bounds));
-    if (!caca_window->Initialize())
-      return nullptr;
-    return std::move(caca_window);
-  }
-  std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
-      override {
-    return base::MakeUnique<NativeDisplayDelegateOzone>();
-  }
-
-  void InitializeUI() override {
-    window_manager_.reset(new CacaWindowManager);
-    overlay_manager_.reset(new StubOverlayManager());
-    event_source_.reset(new CacaEventSource());
-    cursor_factory_ozone_.reset(new CursorFactoryOzone());
-    gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost());
-    input_controller_ = CreateStubInputController();
-    KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(
-        base::MakeUnique<NoKeyboardLayoutEngine>());
-  }
-
-  void InitializeGPU() override {
-    if (!window_manager_) {
-      // The return value of GetSurfaceFactoryOzone() must be non-null so a
-      // dummy instance of CacaWindowManager is needed to make the GPU
-      // initialization gracefully fail.
-      window_manager_.reset(new CacaWindowManager);
-    }
-  }
-
- private:
-  std::unique_ptr<CacaWindowManager> window_manager_;
-  std::unique_ptr<CacaEventSource> event_source_;
-  std::unique_ptr<CursorFactoryOzone> cursor_factory_ozone_;
-  std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_;
-  std::unique_ptr<InputController> input_controller_;
-  std::unique_ptr<OverlayManagerOzone> overlay_manager_;
-
-  DISALLOW_COPY_AND_ASSIGN(OzonePlatformCaca);
-};
-
-}  // namespace
-
-OzonePlatform* CreateOzonePlatformCaca() {
-  return new OzonePlatformCaca;
-}
-
-}  // namespace ui
diff --git a/ui/ozone/platform/caca/ozone_platform_caca.h b/ui/ozone/platform/caca/ozone_platform_caca.h
deleted file mode 100644
index bf1f735..0000000
--- a/ui/ozone/platform/caca/ozone_platform_caca.h
+++ /dev/null
@@ -1,17 +0,0 @@
-// 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_CACA_OZONE_PLATFORM_CACA_H_
-#define UI_OZONE_PLATFORM_CACA_OZONE_PLATFORM_CACA_H_
-
-namespace ui {
-
-class OzonePlatform;
-
-// Constructor hook for use in ozone_platform_list.cc
-OzonePlatform* CreateOzonePlatformCaca();
-
-}  // namespace ui
-
-#endif  // UI_OZONE_PLATFORM_CACA_OZONE_PLATFORM_CACA_H_
diff --git a/ui/ozone/platform/caca/scoped_caca_types.cc b/ui/ozone/platform/caca/scoped_caca_types.cc
deleted file mode 100644
index 093b7c9..0000000
--- a/ui/ozone/platform/caca/scoped_caca_types.cc
+++ /dev/null
@@ -1,23 +0,0 @@
-// 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.
-
-#include "ui/ozone/platform/caca/scoped_caca_types.h"
-
-#include <caca.h>
-
-namespace ui {
-
-void CacaCanvasDeleter::operator()(caca_canvas_t* canvas) const {
-  caca_free_canvas(canvas);
-}
-
-void CacaDisplayDeleter::operator()(caca_display_t* display) const {
-  caca_free_display(display);
-}
-
-void CacaDitherDeleter::operator()(caca_dither_t* dither) const {
-  caca_free_dither(dither);
-}
-
-}  // namespace ui
diff --git a/ui/ozone/platform/caca/scoped_caca_types.h b/ui/ozone/platform/caca/scoped_caca_types.h
deleted file mode 100644
index 0db7b15..0000000
--- a/ui/ozone/platform/caca/scoped_caca_types.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// 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_CACA_SCOPED_CACA_TYPES_H_
-#define UI_OZONE_PLATFORM_CACA_SCOPED_CACA_TYPES_H_
-
-#include <memory>
-
-typedef struct caca_canvas caca_canvas_t;
-typedef struct caca_dither caca_dither_t;
-typedef struct caca_display caca_display_t;
-
-namespace ui {
-
-struct CacaCanvasDeleter {
-  void operator()(caca_canvas_t* canvas) const;
-};
-
-struct CacaDisplayDeleter {
-  void operator()(caca_display_t* display) const;
-};
-
-struct CacaDitherDeleter {
-  void operator()(caca_dither_t* dither) const;
-};
-
-typedef std::unique_ptr<caca_canvas_t, CacaCanvasDeleter> ScopedCacaCanvas;
-typedef std::unique_ptr<caca_display_t, CacaDisplayDeleter> ScopedCacaDisplay;
-typedef std::unique_ptr<caca_dither_t, CacaDitherDeleter> ScopedCacaDither;
-
-}  // namespace ui
-
-#endif  // UI_OZONE_PLATFORM_CACA_SCOPED_CACA_TYPES_H_