chromeos: removes some of the window-service mojoms

Some are still in use, so I can't remove them all.

BUG=964460
TEST=none
TBR=palmer@chromium.org

Change-Id: I64cba650dd8a852780fe48c820d38a67276d1f8f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1620385
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Chris Palmer <palmer@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661551}
diff --git a/chrome/browser/browser_process_platform_part_chromeos.cc b/chrome/browser/browser_process_platform_part_chromeos.cc
index 65334bee..366a5872 100644
--- a/chrome/browser/browser_process_platform_part_chromeos.cc
+++ b/chrome/browser/browser_process_platform_part_chromeos.cc
@@ -44,8 +44,6 @@
 #include "services/service_manager/public/cpp/service.h"
 #include "services/ws/public/cpp/input_devices/input_device_controller.h"
 #include "services/ws/public/cpp/input_devices/input_device_controller_client.h"
-#include "services/ws/public/mojom/constants.mojom.h"
-#include "ui/base/ui_base_features.h"
 
 BrowserProcessPlatformPart::BrowserProcessPlatformPart()
     : created_profile_helper_(false),
@@ -201,13 +199,10 @@
 ws::InputDeviceControllerClient*
 BrowserProcessPlatformPart::GetInputDeviceControllerClient() {
   if (!input_device_controller_client_) {
-    const std::string service_name = !features::IsMultiProcessMash()
-                                         ? chromeos::kChromeServiceName
-                                         : ws::mojom::kServiceName;
     input_device_controller_client_ =
         std::make_unique<ws::InputDeviceControllerClient>(
             content::ServiceManagerConnection::GetForProcess()->GetConnector(),
-            service_name);
+            chromeos::kChromeServiceName);
   }
   return input_device_controller_client_.get();
 }
diff --git a/chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.cc b/chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.cc
index eef36d9..f796d9b 100644
--- a/chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.cc
+++ b/chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.cc
@@ -30,8 +30,6 @@
 #include "mojo/public/cpp/system/platform_handle.h"
 #include "services/service_manager/public/cpp/connector.h"
 #include "services/ws/public/mojom/arc_gpu.mojom.h"
-#include "services/ws/public/mojom/constants.mojom.h"
-#include "ui/base/ui_base_features.h"
 
 namespace arc {
 
@@ -58,7 +56,7 @@
 
 class VideoAcceleratorFactoryService : public mojom::VideoAcceleratorFactory {
  public:
-  VideoAcceleratorFactoryService() { DCHECK(!features::IsMultiProcessMash()); }
+  VideoAcceleratorFactoryService() = default;
 
   ~VideoAcceleratorFactoryService() override = default;
 
@@ -93,54 +91,6 @@
   DISALLOW_COPY_AND_ASSIGN(VideoAcceleratorFactoryService);
 };
 
-class VideoAcceleratorFactoryServiceViz
-    : public mojom::VideoAcceleratorFactory {
- public:
-  VideoAcceleratorFactoryServiceViz() {
-    DCHECK(features::IsMultiProcessMash());
-    DETACH_FROM_THREAD(thread_checker_);
-    auto* connector =
-        content::ServiceManagerConnection::GetForProcess()->GetConnector();
-    connector->BindInterface(ws::mojom::kServiceName, &arc_gpu_);
-  }
-
-  ~VideoAcceleratorFactoryServiceViz() override {
-    DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
-  }
-
-  void CreateDecodeAccelerator(
-      mojom::VideoDecodeAcceleratorRequest request) override {
-    DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
-    arc_gpu_->CreateVideoDecodeAccelerator(std::move(request));
-  }
-
-  void CreateEncodeAccelerator(
-      mojom::VideoEncodeAcceleratorRequest request) override {
-    DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
-    arc_gpu_->CreateVideoEncodeAccelerator(std::move(request));
-  }
-
-  void CreateProtectedBufferAllocator(
-      mojom::VideoProtectedBufferAllocatorRequest request) override {
-    DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
-    arc_gpu_->CreateVideoProtectedBufferAllocator(std::move(request));
-  }
-
- private:
-  THREAD_CHECKER(thread_checker_);
-
-  ws::mojom::ArcGpuPtr arc_gpu_;
-
-  DISALLOW_COPY_AND_ASSIGN(VideoAcceleratorFactoryServiceViz);
-};
-
-std::unique_ptr<mojom::VideoAcceleratorFactory>
-CreateVideoAcceleratorFactory() {
-  if (features::IsMultiProcessMash())
-    return std::make_unique<VideoAcceleratorFactoryServiceViz>();
-  return std::make_unique<VideoAcceleratorFactoryService>();
-}
-
 }  // namespace
 
 // static
@@ -152,7 +102,8 @@
 GpuArcVideoServiceHost::GpuArcVideoServiceHost(content::BrowserContext* context,
                                                ArcBridgeService* bridge_service)
     : arc_bridge_service_(bridge_service),
-      video_accelerator_factory_(CreateVideoAcceleratorFactory()) {
+      video_accelerator_factory_(
+          std::make_unique<VideoAcceleratorFactoryService>()) {
   DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
   arc_bridge_service_->video()->SetHost(this);
 }
diff --git a/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.cc b/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.cc
index d4b0d14..97b8797e 100644
--- a/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.cc
+++ b/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.cc
@@ -79,7 +79,6 @@
 #include "mojo/public/cpp/bindings/associated_binding.h"
 #include "net/base/filename_util.h"
 #include "services/service_manager/public/cpp/connector.h"
-#include "services/ws/public/mojom/constants.mojom.h"
 #include "ui/base/ime/ime_bridge.h"
 #include "ui/base/ui_base_features.h"
 #include "ui/display/display.h"
@@ -1542,63 +1541,6 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-// AutotestPrivateEnsureWindowServiceClientHasDrawnWindowFunction
-///////////////////////////////////////////////////////////////////////////////
-
-AutotestPrivateEnsureWindowServiceClientHasDrawnWindowFunction::
-    AutotestPrivateEnsureWindowServiceClientHasDrawnWindowFunction() = default;
-AutotestPrivateEnsureWindowServiceClientHasDrawnWindowFunction::
-    ~AutotestPrivateEnsureWindowServiceClientHasDrawnWindowFunction() = default;
-
-ExtensionFunction::ResponseAction
-AutotestPrivateEnsureWindowServiceClientHasDrawnWindowFunction::Run() {
-  auto params = api::autotest_private::EnsureWindowServiceClientHasDrawnWindow::
-      Params::Create(*args_);
-  EXTENSION_FUNCTION_VALIDATE(params);
-
-  service_manager::Connector* connector =
-      content::ServiceManagerConnection::GetForProcess()->GetConnector();
-  connector->BindInterface(
-      service_manager::ServiceFilter::ByName(ws::mojom::kServiceName),
-      mojo::MakeRequest(&window_server_test_ptr_));
-  window_server_test_ptr_->EnsureClientHasDrawnWindow(
-      params->client_name,
-      base::BindOnce(
-          &AutotestPrivateEnsureWindowServiceClientHasDrawnWindowFunction::
-              OnEnsureClientHasDrawnWindowCallback,
-          this));
-
-  timeout_timer_.Start(
-      FROM_HERE, base::TimeDelta::FromMilliseconds(params->timeout_ms),
-      base::BindOnce(
-          &AutotestPrivateEnsureWindowServiceClientHasDrawnWindowFunction::
-              OnTimeout,
-          this));
-
-  return RespondLater();
-}
-
-void AutotestPrivateEnsureWindowServiceClientHasDrawnWindowFunction::
-    OnEnsureClientHasDrawnWindowCallback(bool success) {
-  if (did_respond()) {
-    LOG(ERROR) << "EnsureClientHasDrawnWindow returned after timeout: "
-               << success;
-    return;
-  }
-
-  Respond(OneArgument(std::make_unique<base::Value>(success)));
-  timeout_timer_.AbandonAndStop();
-}
-
-void AutotestPrivateEnsureWindowServiceClientHasDrawnWindowFunction::
-    OnTimeout() {
-  if (did_respond())
-    return;
-
-  Respond(Error("EnsureWindowServiceClientHasDrawnWindowFunction timeout."));
-}
-
-///////////////////////////////////////////////////////////////////////////////
 // AutotestPrivateGetPrimaryDisplayScaleFactorFunction
 ///////////////////////////////////////////////////////////////////////////////
 
diff --git a/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h b/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h
index f95a886..49badeb 100644
--- a/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h
+++ b/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h
@@ -22,7 +22,6 @@
 #include "chromeos/services/machine_learning/public/mojom/machine_learning_service.mojom.h"
 #include "chromeos/services/machine_learning/public/mojom/model.mojom.h"
 #include "extensions/browser/browser_context_keyed_api_factory.h"
-#include "services/ws/public/mojom/window_server_test.mojom.h"
 #include "ui/message_center/public/cpp/notification_types.h"
 #include "ui/snapshot/screenshot_grabber.h"
 
@@ -567,26 +566,6 @@
   ResponseAction Run() override;
 };
 
-// Ensure a Window Service client has drawn windows with a timeout.
-class AutotestPrivateEnsureWindowServiceClientHasDrawnWindowFunction
-    : public UIThreadExtensionFunction {
- public:
-  AutotestPrivateEnsureWindowServiceClientHasDrawnWindowFunction();
-  DECLARE_EXTENSION_FUNCTION(
-      "autotestPrivate.ensureWindowServiceClientHasDrawnWindow",
-      AUTOTESTPRIVATE_ENSUREWINDOWSERVICECLIENTHASDRAWNWINDOW)
-
- private:
-  ~AutotestPrivateEnsureWindowServiceClientHasDrawnWindowFunction() override;
-  ResponseAction Run() override;
-
-  void OnEnsureClientHasDrawnWindowCallback(bool success);
-  void OnTimeout();
-
-  ws::mojom::WindowServerTestPtr window_server_test_ptr_;
-  base::OneShotTimer timeout_timer_;
-};
-
 // The profile-keyed service that manages the autotestPrivate extension API.
 class AutotestPrivateAPI : public BrowserContextKeyedAPI {
  public:
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
index 9c7f737..78a50181 100644
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -1525,8 +1525,6 @@
       "views/frame/native_browser_frame_factory_chromeos.cc",
       "views/frame/top_controls_slide_controller_chromeos.cc",
       "views/frame/top_controls_slide_controller_chromeos.h",
-      "views/ime_driver/input_method_bridge_chromeos.cc",
-      "views/ime_driver/input_method_bridge_chromeos.h",
       "views/platform_keys_certificate_selector_chromeos.cc",
       "views/platform_keys_certificate_selector_chromeos.h",
       "views/profiles/profile_indicator_icon.cc",
@@ -3073,17 +3071,6 @@
       ]
     }
 
-    if (enable_mus) {
-      sources += [
-        "views/ime_driver/ime_driver_mus.cc",
-        "views/ime_driver/ime_driver_mus.h",
-        "views/ime_driver/remote_text_input_client.cc",
-        "views/ime_driver/remote_text_input_client.h",
-        "views/ime_driver/simple_input_method.cc",
-        "views/ime_driver/simple_input_method.h",
-      ]
-    }
-
     if (is_win) {
       sources += [ "views/chrome_views_delegate_win.cc" ]
     }
diff --git a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc
index efb656b..fc67f4c41 100644
--- a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc
+++ b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc
@@ -43,7 +43,6 @@
 #include "chrome/browser/ui/ash/tablet_mode_client.h"
 #include "chrome/browser/ui/ash/vpn_list_forwarder.h"
 #include "chrome/browser/ui/ash/wallpaper_controller_client.h"
-#include "chrome/browser/ui/views/ime_driver/ime_driver_mus.h"
 #include "chrome/browser/ui/views/select_file_dialog_extension.h"
 #include "chrome/browser/ui/views/select_file_dialog_extension_factory.h"
 #include "chromeos/network/network_connect.h"
@@ -62,7 +61,6 @@
 #include "content/public/common/service_manager_connection.h"
 #include "services/network/public/cpp/shared_url_loader_factory.h"
 #include "services/service_manager/public/cpp/connector.h"
-#include "services/ws/public/mojom/user_activity_monitor.mojom.h"
 #include "ui/base/ime/chromeos/input_method_manager.h"
 #include "ui/base/ui_base_features.h"
 
@@ -120,9 +118,6 @@
 }
 
 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() {
-  // IME driver must be available at login screen, so initialize before profile.
-  IMEDriverMus::Register();
-
   // NetworkConnect handles the network connection state machine for the UI.
   network_connect_delegate_ =
       std::make_unique<NetworkConnectDelegateChromeOS>();
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
index d762118..79581831 100644
--- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
+++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
@@ -27,7 +27,6 @@
 #include "content/public/common/service_manager_connection.h"
 #include "services/service_manager/public/cpp/connector.h"
 #include "services/ws/public/cpp/gpu/gpu.h"  // nogncheck
-#include "services/ws/public/mojom/constants.mojom.h"
 #include "ui/display/screen.h"
 #include "ui/views/widget/desktop_aura/desktop_screen.h"
 #include "ui/wm/core/wm_state.h"
diff --git a/chrome/browser/ui/views/ime_driver/OWNERS b/chrome/browser/ui/views/ime_driver/OWNERS
deleted file mode 100644
index 1d9f31f..0000000
--- a/chrome/browser/ui/views/ime_driver/OWNERS
+++ /dev/null
@@ -1,5 +0,0 @@
-# For mash / mustash.
-xiyuan@chromium.org
-
-# For general IME.
-file://ui/base/ime/OWNERS
diff --git a/chrome/browser/ui/views/ime_driver/ime_driver_mus.cc b/chrome/browser/ui/views/ime_driver/ime_driver_mus.cc
deleted file mode 100644
index a7e2d97..0000000
--- a/chrome/browser/ui/views/ime_driver/ime_driver_mus.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// 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.
-
-#include "chrome/browser/ui/views/ime_driver/ime_driver_mus.h"
-
-#include <memory>
-#include <utility>
-
-#include "chrome/browser/ui/views/ime_driver/remote_text_input_client.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/common/service_manager_connection.h"
-#include "mojo/public/cpp/bindings/strong_binding.h"
-#include "services/service_manager/public/cpp/connector.h"
-#include "services/ws/public/mojom/constants.mojom.h"
-#include "services/ws/public/mojom/ime/ime.mojom.h"
-#include "ui/base/ime/ime_bridge.h"
-
-#if defined(OS_CHROMEOS)
-#include "chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos.h"
-#else
-#include "chrome/browser/ui/views/ime_driver/simple_input_method.h"
-#endif  // defined(OS_CHROMEOS)
-
-IMEDriverMus::IMEDriverMus() {
-  ui::IMEBridge::Initialize();
-}
-
-IMEDriverMus::~IMEDriverMus() {}
-
-// static
-void IMEDriverMus::Register() {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-  ws::mojom::IMEDriverPtr ime_driver_ptr;
-  mojo::MakeStrongBinding(std::make_unique<IMEDriverMus>(),
-                          MakeRequest(&ime_driver_ptr));
-  ws::mojom::IMERegistrarPtr ime_registrar;
-  content::ServiceManagerConnection::GetForProcess()
-      ->GetConnector()
-      ->BindInterface(ws::mojom::kServiceName, &ime_registrar);
-  ime_registrar->RegisterDriver(std::move(ime_driver_ptr));
-}
-
-void IMEDriverMus::StartSession(
-    ws::mojom::InputMethodRequest input_method_request,
-    ws::mojom::TextInputClientPtr client,
-    ws::mojom::SessionDetailsPtr details) {
-#if defined(OS_CHROMEOS)
-  std::unique_ptr<RemoteTextInputClient> remote_client =
-      std::make_unique<RemoteTextInputClient>(std::move(client),
-                                              std::move(details));
-  mojo::MakeStrongBinding(
-      std::make_unique<InputMethodBridge>(std::move(remote_client)),
-      std::move(input_method_request));
-#else
-  mojo::MakeStrongBinding(std::make_unique<SimpleInputMethod>(),
-                          std::move(input_method_request));
-#endif
-}
diff --git a/chrome/browser/ui/views/ime_driver/ime_driver_mus.h b/chrome/browser/ui/views/ime_driver/ime_driver_mus.h
deleted file mode 100644
index 53ed4ba..0000000
--- a/chrome/browser/ui/views/ime_driver/ime_driver_mus.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// 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 CHROME_BROWSER_UI_VIEWS_IME_DRIVER_IME_DRIVER_MUS_H_
-#define CHROME_BROWSER_UI_VIEWS_IME_DRIVER_IME_DRIVER_MUS_H_
-
-#include "base/macros.h"
-#include "services/ws/public/mojom/ime/ime.mojom.h"
-
-// Creates an InputMethodBridge when an IME session is started via mojo.
-class IMEDriverMus : public ws::mojom::IMEDriver {
- public:
-  IMEDriverMus();
-  ~IMEDriverMus() override;
-
-  // Instantiate the IME driver and register it to the UI service.
-  static void Register();
-
- private:
-  // ws::mojom::IMEDriver:
-  void StartSession(ws::mojom::InputMethodRequest input_method_request,
-                    ws::mojom::TextInputClientPtr client,
-                    ws::mojom::SessionDetailsPtr details) override;
-
-  DISALLOW_COPY_AND_ASSIGN(IMEDriverMus);
-};
-
-#endif  // CHROME_BROWSER_UI_VIEWS_IME_DRIVER_IME_DRIVER_MUS_H_
diff --git a/chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos.cc b/chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos.cc
deleted file mode 100644
index 18470f0..0000000
--- a/chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-// 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.
-
-#include "chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos.h"
-
-#include <memory>
-#include <utility>
-
-#include "chrome/browser/chromeos/accessibility/accessibility_input_method_observer.h"
-#include "chrome/browser/ui/views/ime_driver/remote_text_input_client.h"
-#include "ui/base/ime/chromeos/input_method_chromeos.h"
-#include "ui/base/ime/ime_bridge.h"
-
-namespace {
-
-bool IsActiveInputContextHandler(ui::InputMethodChromeOS* input_method) {
-  ui::IMEBridge* bridge = ui::IMEBridge::Get();
-  return bridge && bridge->GetInputContextHandler() == input_method;
-}
-
-}  // namespace
-
-InputMethodBridge::InputMethodBridge(
-    std::unique_ptr<RemoteTextInputClient> client)
-    : client_(std::move(client)),
-      input_method_chromeos_(
-          std::make_unique<ui::InputMethodChromeOS>(client_.get())),
-      accessibility_input_method_observer_(
-          std::make_unique<AccessibilityInputMethodObserver>(
-              input_method_chromeos_.get())) {
-  input_method_chromeos_->OnFocus();
-  input_method_chromeos_->SetFocusedTextInputClient(client_.get());
-}
-
-InputMethodBridge::~InputMethodBridge() {
-  // IME session is ending.
-  if (IsActiveInputContextHandler(input_method_chromeos_.get()))
-    accessibility_input_method_observer_->ResetCaretBounds();
-}
-
-void InputMethodBridge::OnTextInputStateChanged(
-    ws::mojom::TextInputStatePtr text_input_state) {
-  client_->SetTextInputState(std::move(text_input_state));
-
-  if (IsActiveInputContextHandler(input_method_chromeos_.get()))
-    input_method_chromeos_->OnTextInputTypeChanged(client_.get());
-}
-
-void InputMethodBridge::OnCaretBoundsChanged(const gfx::Rect& caret_bounds) {
-  client_->SetCaretBounds(caret_bounds);
-
-  if (IsActiveInputContextHandler(input_method_chromeos_.get()))
-    input_method_chromeos_->OnCaretBoundsChanged(client_.get());
-}
-
-void InputMethodBridge::OnTextInputClientDataChanged(
-    ws::mojom::TextInputClientDataPtr data) {
-  client_->SetTextInputClientData(std::move(data));
-}
-
-void InputMethodBridge::ProcessKeyEvent(std::unique_ptr<ui::Event> event,
-                                        ProcessKeyEventCallback callback) {
-  DCHECK(event->IsKeyEvent());
-  ui::KeyEvent* key_event = event->AsKeyEvent();
-  if (IsActiveInputContextHandler(input_method_chromeos_.get()) &&
-      !key_event->is_char()) {
-    input_method_chromeos_->DispatchKeyEventAsync(key_event,
-                                                  std::move(callback));
-  } else {
-    const bool handled = false;
-    std::move(callback).Run(handled);
-  }
-}
-
-void InputMethodBridge::CancelComposition() {
-  if (IsActiveInputContextHandler(input_method_chromeos_.get()))
-    input_method_chromeos_->CancelComposition(client_.get());
-}
-
-void InputMethodBridge::ShowVirtualKeyboardIfEnabled() {
-  if (IsActiveInputContextHandler(input_method_chromeos_.get()))
-    input_method_chromeos_->ShowVirtualKeyboardIfEnabled();
-}
diff --git a/chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos.h b/chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos.h
deleted file mode 100644
index b98d214..0000000
--- a/chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// 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 CHROME_BROWSER_UI_VIEWS_IME_DRIVER_INPUT_METHOD_BRIDGE_CHROMEOS_H_
-#define CHROME_BROWSER_UI_VIEWS_IME_DRIVER_INPUT_METHOD_BRIDGE_CHROMEOS_H_
-
-#include "chrome/browser/ui/views/ime_driver/remote_text_input_client.h"
-#include "services/ws/public/mojom/ime/ime.mojom.h"
-
-class AccessibilityInputMethodObserver;
-
-namespace ui {
-class InputMethodChromeOS;
-}
-
-// This bridges between mojo InputMethod API and ui::InputMethodChromeOS. It
-// forwards the received events to an instance of ui::InputMethodChromeOS.
-// Under mash this object is created and destroyed as top-level windows gain
-// focus and start IME sessions.
-// NOTE: There may be multiple instances of InputMethodChromeOS. In classic ash
-// there is one instance shared by ash and browser, plus one per remote app
-// (e.g. shortcut viewer).
-class InputMethodBridge : public ws::mojom::InputMethod {
- public:
-  explicit InputMethodBridge(std::unique_ptr<RemoteTextInputClient> client);
-  ~InputMethodBridge() override;
-
-  // ws::mojom::InputMethod:
-  void OnTextInputStateChanged(
-      ws::mojom::TextInputStatePtr text_input_state) override;
-  void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) override;
-  void OnTextInputClientDataChanged(
-      ws::mojom::TextInputClientDataPtr data) override;
-  void ProcessKeyEvent(std::unique_ptr<ui::Event> key_event,
-                       ProcessKeyEventCallback callback) override;
-  void CancelComposition() override;
-  void ShowVirtualKeyboardIfEnabled() override;
-
- private:
-  std::unique_ptr<RemoteTextInputClient> client_;
-  std::unique_ptr<ui::InputMethodChromeOS> input_method_chromeos_;
-  // Must be destroyed before |input_method_chromeos_|.
-  std::unique_ptr<AccessibilityInputMethodObserver>
-      accessibility_input_method_observer_;
-
-  DISALLOW_COPY_AND_ASSIGN(InputMethodBridge);
-};
-
-#endif  // CHROME_BROWSER_UI_VIEWS_IME_DRIVER_INPUT_METHOD_BRIDGE_CHROMEOS_H_
diff --git a/chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos_unittest.cc b/chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos_unittest.cc
deleted file mode 100644
index e44aa19bb..0000000
--- a/chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos_unittest.cc
+++ /dev/null
@@ -1,275 +0,0 @@
-// 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.
-
-#include <stdint.h>
-
-#include <memory>
-
-#include "base/bind.h"
-#include "base/bind_helpers.h"
-#include "base/run_loop.h"
-#include "base/stl_util.h"
-#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos.h"
-#include "content/public/test/test_browser_thread_bundle.h"
-#include "mojo/public/cpp/bindings/binding.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/base/ime/ime_bridge.h"
-#include "ui/events/event.h"
-#include "ui/events/event_constants.h"
-#include "ui/events/event_utils.h"
-#include "ui/events/keycodes/dom/dom_code.h"
-#include "ui/events/keycodes/dom/dom_key.h"
-#include "ui/events/keycodes/keyboard_code_conversion.h"
-#include "ui/events/keycodes/keyboard_codes.h"
-
-enum class CompositionEventType {
-  SET,
-  CONFIRM,
-  CLEAR,
-  INSERT_TEXT,
-  INSERT_CHAR
-};
-
-struct CompositionEvent {
-  CompositionEventType type;
-  base::string16 text_data;
-  base::char16 char_data;
-};
-
-class TestTextInputClient : public ws::mojom::TextInputClient {
- public:
-  explicit TestTextInputClient(ws::mojom::TextInputClientRequest request)
-      : binding_(this, std::move(request)) {}
-
-  CompositionEvent WaitUntilCompositionEvent() {
-    if (!receieved_event_.has_value()) {
-      run_loop_ = std::make_unique<base::RunLoop>();
-      run_loop_->Run();
-      run_loop_.reset();
-    }
-    CompositionEvent result = receieved_event_.value();
-    receieved_event_.reset();
-    return result;
-  }
-
-  void set_manual_ack_dispatch_key_event_post_ime_callback(bool manual) {
-    manual_ack_dispatch_key_event_post_ime_callback_ = manual;
-  }
-
-  void AckDispatchKeyEventPostIMECallback() {
-    DCHECK(manual_ack_dispatch_key_event_post_ime_callback_);
-
-    if (!pending_dispatch_key_event_post_ime_callback_) {
-      pending_dispatch_key_event_post_ime_callback_wait_loop_ =
-          std::make_unique<base::RunLoop>();
-      pending_dispatch_key_event_post_ime_callback_wait_loop_->Run();
-      pending_dispatch_key_event_post_ime_callback_wait_loop_.reset();
-    }
-
-    std::move(pending_dispatch_key_event_post_ime_callback_).Run(false, false);
-  }
-
- private:
-  void SetCompositionText(const ui::CompositionText& composition) override {
-    CompositionEvent ev = {CompositionEventType::SET, composition.text, 0};
-    receieved_event_ = ev;
-    if (run_loop_)
-      run_loop_->Quit();
-  }
-  void ConfirmCompositionText() override {
-    CompositionEvent ev = {CompositionEventType::CONFIRM, base::string16(), 0};
-    receieved_event_ = ev;
-    if (run_loop_)
-      run_loop_->Quit();
-  }
-  void ClearCompositionText() override {
-    CompositionEvent ev = {CompositionEventType::CLEAR, base::string16(), 0};
-    receieved_event_ = ev;
-    if (run_loop_)
-      run_loop_->Quit();
-  }
-  void InsertText(const base::string16& text) override {
-    CompositionEvent ev = {CompositionEventType::INSERT_TEXT, text, 0};
-    receieved_event_ = ev;
-    if (run_loop_)
-      run_loop_->Quit();
-  }
-  void InsertChar(std::unique_ptr<ui::Event> event) override {
-    ASSERT_TRUE(event->IsKeyEvent());
-    CompositionEvent ev = {CompositionEventType::INSERT_CHAR, base::string16(),
-                           event->AsKeyEvent()->GetCharacter()};
-    receieved_event_ = ev;
-    if (run_loop_)
-      run_loop_->Quit();
-  }
-  void DispatchKeyEventPostIME(
-      std::unique_ptr<ui::Event> event,
-      DispatchKeyEventPostIMECallback callback) override {
-    if (manual_ack_dispatch_key_event_post_ime_callback_) {
-      // Only one pending callback is expected.
-      EXPECT_FALSE(pending_dispatch_key_event_post_ime_callback_);
-      pending_dispatch_key_event_post_ime_callback_ = std::move(callback);
-      if (pending_dispatch_key_event_post_ime_callback_wait_loop_)
-        pending_dispatch_key_event_post_ime_callback_wait_loop_->Quit();
-      return;
-    }
-
-    std::move(callback).Run(false, false);
-  }
-  void EnsureCaretNotInRect(const gfx::Rect& rect) override {}
-  void SetEditableSelectionRange(const gfx::Range& range) override {}
-  void DeleteRange(const gfx::Range& range) override {}
-  void OnInputMethodChanged() override {}
-  void ChangeTextDirectionAndLayoutAlignment(
-      base::i18n::TextDirection direction) override {}
-  void ExtendSelectionAndDelete(uint32_t before, uint32_t after) override {}
-
-  mojo::Binding<ws::mojom::TextInputClient> binding_;
-  std::unique_ptr<base::RunLoop> run_loop_;
-  base::Optional<CompositionEvent> receieved_event_;
-
-  bool manual_ack_dispatch_key_event_post_ime_callback_ = false;
-  DispatchKeyEventPostIMECallback pending_dispatch_key_event_post_ime_callback_;
-  std::unique_ptr<base::RunLoop>
-      pending_dispatch_key_event_post_ime_callback_wait_loop_;
-
-  DISALLOW_COPY_AND_ASSIGN(TestTextInputClient);
-};
-
-class InputMethodBridgeChromeOSTest : public testing::Test {
- public:
-  InputMethodBridgeChromeOSTest()
-      : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {}
-  ~InputMethodBridgeChromeOSTest() override {}
-
-  void SetUp() override {
-    ui::IMEBridge::Initialize();
-
-    ws::mojom::TextInputClientPtr client_ptr;
-    client_ = std::make_unique<TestTextInputClient>(MakeRequest(&client_ptr));
-    ws::mojom::SessionDetailsPtr details = ws::mojom::SessionDetails::New();
-    details->state = ws::mojom::TextInputState::New(
-        ui::TEXT_INPUT_TYPE_TEXT, ui::TEXT_INPUT_MODE_DEFAULT,
-        base::i18n::LEFT_TO_RIGHT, 0);
-    details->data = ws::mojom::TextInputClientData::New();
-    input_method_ = std::make_unique<InputMethodBridge>(
-        std::make_unique<RemoteTextInputClient>(std::move(client_ptr),
-                                                std::move(details)));
-  }
-
-  bool ProcessKeyEvent(std::unique_ptr<ui::Event> event) {
-    handled_.reset();
-
-    input_method_->ProcessKeyEvent(
-        std::move(event),
-        base::Bind(&InputMethodBridgeChromeOSTest::ProcessKeyEventCallback,
-                   base::Unretained(this)));
-
-    if (!handled_.has_value()) {
-      run_loop_ = std::make_unique<base::RunLoop>();
-      run_loop_->Run();
-      run_loop_.reset();
-    }
-
-    return handled_.value();
-  }
-
-  std::unique_ptr<ui::Event> UnicodeKeyPress(ui::KeyboardCode vkey,
-                                             ui::DomCode code,
-                                             int flags,
-                                             base::char16 character) const {
-    return std::make_unique<ui::KeyEvent>(ui::ET_KEY_PRESSED, vkey, code, flags,
-                                          ui::DomKey::FromCharacter(character),
-                                          ui::EventTimeForNow());
-  }
-
- protected:
-  void ProcessKeyEventCallback(bool handled) {
-    handled_ = handled;
-    if (run_loop_)
-      run_loop_->Quit();
-  }
-
-  content::TestBrowserThreadBundle thread_bundle_;
-  std::unique_ptr<TestTextInputClient> client_;
-  std::unique_ptr<InputMethodBridge> input_method_;
-  std::unique_ptr<base::RunLoop> run_loop_;
-  base::Optional<bool> handled_;
-
-  DISALLOW_COPY_AND_ASSIGN(InputMethodBridgeChromeOSTest);
-};
-
-// Tests if hexadecimal composition provided by ui::CharacterComposer works
-// correctly. ui::CharacterComposer is tried if no input method extensions
-// have been registered yet.
-TEST_F(InputMethodBridgeChromeOSTest, HexadecimalComposition) {
-  struct {
-    ui::KeyboardCode vkey;
-    ui::DomCode code;
-    int flags;
-    base::char16 character;
-    std::string composition_text;
-  } kTestSequence[] = {
-      {ui::VKEY_U, ui::DomCode::US_U, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
-       'U', "u"},
-      {ui::VKEY_3, ui::DomCode::DIGIT3, 0, '3', "u3"},
-      {ui::VKEY_0, ui::DomCode::DIGIT0, 0, '0', "u30"},
-      {ui::VKEY_4, ui::DomCode::DIGIT4, 0, '4', "u304"},
-      {ui::VKEY_2, ui::DomCode::DIGIT2, 0, '2', "u3042"},
-  };
-
-  // Send the Ctrl-Shift-U,3,4,0,2 sequence.
-  for (size_t i = 0; i < base::size(kTestSequence); i++) {
-    EXPECT_TRUE(ProcessKeyEvent(
-        UnicodeKeyPress(kTestSequence[i].vkey, kTestSequence[i].code,
-                        kTestSequence[i].flags, kTestSequence[i].character)));
-    CompositionEvent ev = client_->WaitUntilCompositionEvent();
-    EXPECT_EQ(CompositionEventType::SET, ev.type);
-    EXPECT_EQ(base::UTF8ToUTF16(kTestSequence[i].composition_text),
-              ev.text_data);
-  }
-
-  // Press the return key and verify that the composition text was converted
-  // to the desired text.
-  EXPECT_TRUE(ProcessKeyEvent(
-      UnicodeKeyPress(ui::VKEY_RETURN, ui::DomCode::ENTER, 0, '\r')));
-  CompositionEvent ev = client_->WaitUntilCompositionEvent();
-  EXPECT_EQ(CompositionEventType::INSERT_TEXT, ev.type);
-  EXPECT_EQ(base::string16(1, 0x3042), ev.text_data);
-}
-
-// Test that Ctrl-C, Ctrl-X, and Ctrl-V are not handled.
-TEST_F(InputMethodBridgeChromeOSTest, ClipboardAccelerators) {
-  EXPECT_FALSE(ProcessKeyEvent(UnicodeKeyPress(ui::VKEY_C, ui::DomCode::US_C,
-                                               ui::EF_CONTROL_DOWN, 'C')));
-  EXPECT_FALSE(ProcessKeyEvent(UnicodeKeyPress(ui::VKEY_X, ui::DomCode::US_X,
-                                               ui::EF_CONTROL_DOWN, 'X')));
-  EXPECT_FALSE(ProcessKeyEvent(UnicodeKeyPress(ui::VKEY_V, ui::DomCode::US_V,
-                                               ui::EF_CONTROL_DOWN, 'V')));
-}
-
-// Test that multiple DispatchKeyEventPostIME calls are handled serially.
-TEST_F(InputMethodBridgeChromeOSTest, SerialDispatchKeyEventPostIME) {
-  client_->set_manual_ack_dispatch_key_event_post_ime_callback(true);
-
-  // Send multiple key events.
-  input_method_->ProcessKeyEvent(
-      std::make_unique<ui::KeyEvent>(ui::ET_KEY_PRESSED, ui::VKEY_A,
-                                     ui::EF_NONE),
-      base::DoNothing());
-  input_method_->ProcessKeyEvent(
-      std::make_unique<ui::KeyEvent>(ui::ET_KEY_RELEASED, ui::VKEY_A,
-                                     ui::EF_NONE),
-      base::DoNothing());
-
-  // TestTextInputClient::DispatchKeyEventPostIME is called via mojo.
-  // RemoteTextInputClient should make the calls serially. Spin message loop to
-  // see whether |client_| complains about more than one call at a time.
-  base::RunLoop().RunUntilIdle();
-
-  // Ack the pending key events.
-  client_->AckDispatchKeyEventPostIMECallback();
-  client_->AckDispatchKeyEventPostIMECallback();
-}
diff --git a/chrome/browser/ui/views/ime_driver/remote_text_input_client.cc b/chrome/browser/ui/views/ime_driver/remote_text_input_client.cc
deleted file mode 100644
index 6ef3e425..0000000
--- a/chrome/browser/ui/views/ime_driver/remote_text_input_client.cc
+++ /dev/null
@@ -1,251 +0,0 @@
-// 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.
-
-#include "chrome/browser/ui/views/ime_driver/remote_text_input_client.h"
-
-#include <memory>
-#include <utility>
-
-#include "base/bind.h"
-#include "base/bind_helpers.h"
-#include "ui/events/event_dispatcher.h"
-
-struct RemoteTextInputClient::QueuedEvent {
-  QueuedEvent(std::unique_ptr<ui::Event> event,
-              DispatchKeyEventPostIMECallback callback)
-      : event(std::move(event)), callback(std::move(callback)) {}
-
-  std::unique_ptr<ui::Event> event;
-  DispatchKeyEventPostIMECallback callback;
-};
-
-RemoteTextInputClient::RemoteTextInputClient(
-    ws::mojom::TextInputClientPtr client,
-    ws::mojom::SessionDetailsPtr details)
-    : remote_client_(std::move(client)), details_(std::move(details)) {}
-
-RemoteTextInputClient::~RemoteTextInputClient() {
-  while (!queued_events_.empty()) {
-    RunNextPendingCallback(/* handled */ false,
-                           /* stopped_propagation */ false);
-  }
-}
-
-void RemoteTextInputClient::SetTextInputState(
-    ws::mojom::TextInputStatePtr text_input_state) {
-  details_->state = std::move(text_input_state);
-}
-
-void RemoteTextInputClient::SetCaretBounds(const gfx::Rect& caret_bounds) {
-  details_->caret_bounds = caret_bounds;
-}
-
-void RemoteTextInputClient::SetTextInputClientData(
-    ws::mojom::TextInputClientDataPtr data) {
-  details_->data = std::move(data);
-}
-
-void RemoteTextInputClient::OnDispatchKeyEventPostIMECompleted(
-    bool handled,
-    bool stopped_propagation) {
-  RunNextPendingCallback(handled, stopped_propagation);
-  DispatchQueuedEvent();
-}
-
-void RemoteTextInputClient::SetCompositionText(
-    const ui::CompositionText& composition) {
-  remote_client_->SetCompositionText(composition);
-}
-
-void RemoteTextInputClient::ConfirmCompositionText() {
-  remote_client_->ConfirmCompositionText();
-}
-
-void RemoteTextInputClient::ClearCompositionText() {
-  remote_client_->ClearCompositionText();
-}
-
-void RemoteTextInputClient::InsertText(const base::string16& text) {
-  remote_client_->InsertText(text);
-}
-
-void RemoteTextInputClient::InsertChar(const ui::KeyEvent& event) {
-  remote_client_->InsertChar(ui::Event::Clone(event));
-}
-
-ui::TextInputType RemoteTextInputClient::GetTextInputType() const {
-  return details_->state->text_input_type;
-}
-
-ui::TextInputMode RemoteTextInputClient::GetTextInputMode() const {
-  return details_->state->text_input_mode;
-}
-
-base::i18n::TextDirection RemoteTextInputClient::GetTextDirection() const {
-  return details_->state->text_direction;
-}
-
-int RemoteTextInputClient::GetTextInputFlags() const {
-  return details_->state->text_input_flags;
-}
-
-bool RemoteTextInputClient::CanComposeInline() const {
-  // If we return false here, ui::InputMethodChromeOS will try to create a
-  // composition window. But here we are at IMEDriver, and composition
-  // window shouldn't be created by IMEDriver.
-  return true;
-}
-
-gfx::Rect RemoteTextInputClient::GetCaretBounds() const {
-  return details_->caret_bounds;
-}
-
-bool RemoteTextInputClient::GetCompositionCharacterBounds(
-    uint32_t index,
-    gfx::Rect* rect) const {
-  // TODO(moshayedi): crbug.com/631527.
-  NOTIMPLEMENTED_LOG_ONCE();
-  return false;
-}
-
-bool RemoteTextInputClient::HasCompositionText() const {
-  return details_->data->has_composition_text;
-}
-
-ui::TextInputClient::FocusReason RemoteTextInputClient::GetFocusReason() const {
-  return details_->focus_reason;
-}
-
-bool RemoteTextInputClient::GetTextRange(gfx::Range* range) const {
-  if (!details_->data->text_range.has_value())
-    return false;
-
-  *range = details_->data->text_range.value();
-  return true;
-}
-
-bool RemoteTextInputClient::GetCompositionTextRange(gfx::Range* range) const {
-  if (!details_->data->composition_text_range.has_value())
-    return false;
-
-  *range = details_->data->composition_text_range.value();
-  return true;
-}
-
-bool RemoteTextInputClient::GetEditableSelectionRange(gfx::Range* range) const {
-  if (!details_->data->editable_selection_range.has_value())
-    return false;
-
-  *range = details_->data->editable_selection_range.value();
-  return true;
-}
-
-bool RemoteTextInputClient::SetEditableSelectionRange(const gfx::Range& range) {
-  remote_client_->SetEditableSelectionRange(range);
-  // Note that we assume the client side always succeeds.
-  return true;
-}
-
-bool RemoteTextInputClient::DeleteRange(const gfx::Range& range) {
-  remote_client_->DeleteRange(range);
-  // Note that we assume the client side always succeeds.
-  return true;
-}
-
-bool RemoteTextInputClient::GetTextFromRange(const gfx::Range& range,
-                                             base::string16* text) const {
-  if (!details_->data->text.has_value() ||
-      !details_->data->text_range.has_value() ||
-      !details_->data->text_range->Contains(range)) {
-    return false;
-  }
-
-  *text = details_->data->text->substr(range.GetMin(), range.length());
-  return true;
-}
-
-void RemoteTextInputClient::OnInputMethodChanged() {
-  remote_client_->OnInputMethodChanged();
-}
-
-bool RemoteTextInputClient::ChangeTextDirectionAndLayoutAlignment(
-    base::i18n::TextDirection direction) {
-  remote_client_->ChangeTextDirectionAndLayoutAlignment(direction);
-  // Note that we assume the client side always succeeds.
-  return true;
-}
-
-void RemoteTextInputClient::ExtendSelectionAndDelete(size_t before,
-                                                     size_t after) {
-  remote_client_->ExtendSelectionAndDelete(before, after);
-}
-
-void RemoteTextInputClient::EnsureCaretNotInRect(const gfx::Rect& rect) {
-  remote_client_->EnsureCaretNotInRect(rect);
-}
-
-bool RemoteTextInputClient::IsTextEditCommandEnabled(
-    ui::TextEditCommand command) const {
-  if (!details_->data->edit_command_enabled.has_value())
-    return false;
-
-  const size_t index = static_cast<size_t>(command);
-  if (index >= details_->data->edit_command_enabled->size())
-    return false;
-
-  return details_->data->edit_command_enabled->at(index);
-}
-
-void RemoteTextInputClient::SetTextEditCommandForNextKeyEvent(
-    ui::TextEditCommand command) {
-  // TODO(moshayedi): crbug.com/631527.
-  NOTIMPLEMENTED_LOG_ONCE();
-}
-
-ukm::SourceId RemoteTextInputClient::GetClientSourceForMetrics() const {
-  return details_->client_source_for_metrics;
-}
-
-bool RemoteTextInputClient::ShouldDoLearning() {
-  return details_->should_do_learning;
-}
-
-bool RemoteTextInputClient::SetCompositionFromExistingText(
-    const gfx::Range& range,
-    const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) {
-  // TODO(https://crbug.com/952757): Implement this method.
-  NOTIMPLEMENTED_LOG_ONCE();
-  return false;
-}
-
-ui::EventDispatchDetails RemoteTextInputClient::DispatchKeyEventPostIME(
-    ui::KeyEvent* event,
-    DispatchKeyEventPostIMECallback callback) {
-  const bool is_first_event = queued_events_.empty();
-  queued_events_.emplace(ui::Event::Clone(*event), std::move(callback));
-  if (is_first_event)
-    DispatchQueuedEvent();
-  return ui::EventDispatchDetails();
-}
-
-void RemoteTextInputClient::DispatchQueuedEvent() {
-  if (queued_events_.empty())
-    return;
-
-  DCHECK(queued_events_.front().event);
-  remote_client_->DispatchKeyEventPostIME(
-      std::move(queued_events_.front().event),
-      base::BindOnce(&RemoteTextInputClient::OnDispatchKeyEventPostIMECompleted,
-                     weak_ptr_factory_.GetWeakPtr()));
-}
-
-void RemoteTextInputClient::RunNextPendingCallback(bool handled,
-                                                   bool stopped_propagation) {
-  DCHECK(!queued_events_.empty());
-  DispatchKeyEventPostIMECallback callback =
-      std::move(queued_events_.front().callback);
-  queued_events_.pop();
-  if (callback)
-    std::move(callback).Run(handled, stopped_propagation);
-}
diff --git a/chrome/browser/ui/views/ime_driver/remote_text_input_client.h b/chrome/browser/ui/views/ime_driver/remote_text_input_client.h
deleted file mode 100644
index c920125..0000000
--- a/chrome/browser/ui/views/ime_driver/remote_text_input_client.h
+++ /dev/null
@@ -1,103 +0,0 @@
-// 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 CHROME_BROWSER_UI_VIEWS_IME_DRIVER_REMOTE_TEXT_INPUT_CLIENT_H_
-#define CHROME_BROWSER_UI_VIEWS_IME_DRIVER_REMOTE_TEXT_INPUT_CLIENT_H_
-
-#include "base/containers/queue.h"
-#include "base/memory/weak_ptr.h"
-#include "services/ws/public/mojom/ime/ime.mojom.h"
-#include "ui/base/ime/input_method_delegate.h"
-#include "ui/base/ime/text_input_client.h"
-
-// This implementation of ui::TextInputClient sends all updates via mojo IPC to
-// a remote client. This is intended to be passed to the overrides of
-// ui::InputMethod::SetFocusedTextInputClient().
-// NOTE: Under SingleProcessMash this is used by ash code, for example by the
-// virtual keyboard controller in //ash/keyboard/ui.
-class RemoteTextInputClient : public ui::TextInputClient,
-                              public ui::internal::InputMethodDelegate {
- public:
-  RemoteTextInputClient(ws::mojom::TextInputClientPtr client,
-                        ws::mojom::SessionDetailsPtr details);
-  ~RemoteTextInputClient() override;
-
-  void SetTextInputState(ws::mojom::TextInputStatePtr text_input_state);
-  void SetCaretBounds(const gfx::Rect& caret_bounds);
-  void SetTextInputClientData(ws::mojom::TextInputClientDataPtr data);
-
- private:
-  struct QueuedEvent;
-
-  // See |pending_callbacks_| for details.
-  void OnDispatchKeyEventPostIMECompleted(bool handled,
-                                          bool stopped_propagation);
-
-  // ui::TextInputClient:
-  void SetCompositionText(const ui::CompositionText& composition) override;
-  void ConfirmCompositionText() override;
-  void ClearCompositionText() override;
-  void InsertText(const base::string16& text) override;
-  void InsertChar(const ui::KeyEvent& event) override;
-  ui::TextInputType GetTextInputType() const override;
-  ui::TextInputMode GetTextInputMode() const override;
-  base::i18n::TextDirection GetTextDirection() const override;
-  int GetTextInputFlags() const override;
-  bool CanComposeInline() const override;
-  gfx::Rect GetCaretBounds() const override;
-  bool GetCompositionCharacterBounds(uint32_t index,
-                                     gfx::Rect* rect) const override;
-  bool HasCompositionText() const override;
-  FocusReason GetFocusReason() const override;
-  bool GetTextRange(gfx::Range* range) const override;
-  bool GetCompositionTextRange(gfx::Range* range) const override;
-  bool GetEditableSelectionRange(gfx::Range* range) const override;
-  bool SetEditableSelectionRange(const gfx::Range& range) override;
-  bool DeleteRange(const gfx::Range& range) override;
-  bool GetTextFromRange(const gfx::Range& range,
-                        base::string16* text) const override;
-  void OnInputMethodChanged() override;
-  bool ChangeTextDirectionAndLayoutAlignment(
-      base::i18n::TextDirection direction) override;
-  void ExtendSelectionAndDelete(size_t before, size_t after) override;
-  void EnsureCaretNotInRect(const gfx::Rect& rect) override;
-  bool IsTextEditCommandEnabled(ui::TextEditCommand command) const override;
-  void SetTextEditCommandForNextKeyEvent(ui::TextEditCommand command) override;
-  ukm::SourceId GetClientSourceForMetrics() const override;
-  bool ShouldDoLearning() override;
-  bool SetCompositionFromExistingText(
-      const gfx::Range& range,
-      const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) override;
-
-  // ui::internal::InputMethodDelegate:
-  ui::EventDispatchDetails DispatchKeyEventPostIME(
-      ui::KeyEvent* event,
-      DispatchKeyEventPostIMECallback callback) override;
-
-  // Dispatches the first queued event.
-  void DispatchQueuedEvent();
-
-  // Removes the queue event at the front of |queued_events_| and runs its
-  // callback with |handled| and |stopped_propagation| as arguments.
-  void RunNextPendingCallback(bool handled, bool stopped_propagation);
-
-  ws::mojom::TextInputClientPtr remote_client_;
-  ws::mojom::SessionDetailsPtr details_;
-
-  // Events to be dispatched with DispatchKeyEventPostIME(). Only one event is
-  // dispatched at a time and others are queued here until the current one
-  // finished processing, i.e. the response from the remote side is received
-  // (OnDispatchKeyEventPostIMECompleted()), the dispatched event is removed
-  // from the queue and its callback is invoked. This is done to avoid
-  // overlapping of key events processing (https://crbug.com/938808).
-  // Note that when we are destroyed all the callbacks needs to run. This is
-  // necessary as the callbacks may have originated from a remote client.
-  base::queue<QueuedEvent> queued_events_;
-
-  base::WeakPtrFactory<RemoteTextInputClient> weak_ptr_factory_{this};
-
-  DISALLOW_COPY_AND_ASSIGN(RemoteTextInputClient);
-};
-
-#endif  // CHROME_BROWSER_UI_VIEWS_IME_DRIVER_REMOTE_TEXT_INPUT_CLIENT_H_
diff --git a/chrome/browser/ui/views/ime_driver/simple_input_method.cc b/chrome/browser/ui/views/ime_driver/simple_input_method.cc
deleted file mode 100644
index 2849773a..0000000
--- a/chrome/browser/ui/views/ime_driver/simple_input_method.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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.
-
-#include "chrome/browser/ui/views/ime_driver/simple_input_method.h"
-
-#include <utility>
-
-SimpleInputMethod::SimpleInputMethod() {}
-
-SimpleInputMethod::~SimpleInputMethod() {}
-
-void SimpleInputMethod::OnTextInputStateChanged(
-    ws::mojom::TextInputStatePtr text_input_state) {
-  NOTIMPLEMENTED_LOG_ONCE();
-}
-
-void SimpleInputMethod::OnCaretBoundsChanged(const gfx::Rect& caret_bounds) {
-  NOTIMPLEMENTED_LOG_ONCE();
-}
-
-void SimpleInputMethod::OnTextInputClientDataChanged(
-    ws::mojom::TextInputClientDataPtr data) {
-  NOTIMPLEMENTED_LOG_ONCE();
-}
-
-void SimpleInputMethod::ProcessKeyEvent(std::unique_ptr<ui::Event> key_event,
-                                        ProcessKeyEventCallback callback) {
-  NOTIMPLEMENTED_LOG_ONCE();
-  std::move(callback).Run(false);
-}
-
-void SimpleInputMethod::CancelComposition() {
-  NOTIMPLEMENTED_LOG_ONCE();
-}
-
-void SimpleInputMethod::ShowVirtualKeyboardIfEnabled() {
-  NOTIMPLEMENTED_LOG_ONCE();
-}
diff --git a/chrome/browser/ui/views/ime_driver/simple_input_method.h b/chrome/browser/ui/views/ime_driver/simple_input_method.h
deleted file mode 100644
index 62c9abb5..0000000
--- a/chrome/browser/ui/views/ime_driver/simple_input_method.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// 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 CHROME_BROWSER_UI_VIEWS_IME_DRIVER_SIMPLE_INPUT_METHOD_H_
-#define CHROME_BROWSER_UI_VIEWS_IME_DRIVER_SIMPLE_INPUT_METHOD_H_
-
-#include "services/ws/public/mojom/ime/ime.mojom.h"
-
-// This is to be used on platforms where a proper implementation of
-// ws::mojom::InputMethod is missing. It doesn't handle any events and calls
-// the callback with false, which will result in client code handling events
-// locally.
-class SimpleInputMethod : public ws::mojom::InputMethod {
- public:
-  SimpleInputMethod();
-  ~SimpleInputMethod() override;
-
-  // ws::mojom::InputMethod:
-  void OnTextInputStateChanged(
-      ws::mojom::TextInputStatePtr text_input_state) override;
-  void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) override;
-  void OnTextInputClientDataChanged(
-      ws::mojom::TextInputClientDataPtr data) override;
-  void ProcessKeyEvent(std::unique_ptr<ui::Event> key_event,
-                       ProcessKeyEventCallback callback) override;
-  void CancelComposition() override;
-  void ShowVirtualKeyboardIfEnabled() override;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(SimpleInputMethod);
-};
-
-#endif  // CHROME_BROWSER_UI_VIEWS_IME_DRIVER_SIMPLE_INPUT_METHOD_H_
diff --git a/chrome/common/extensions/api/autotest_private.idl b/chrome/common/extensions/api/autotest_private.idl
index 856f660..69c6a85 100644
--- a/chrome/common/extensions/api/autotest_private.idl
+++ b/chrome/common/extensions/api/autotest_private.idl
@@ -159,9 +159,6 @@
 
   callback TakeScreenshotCallback = void (DOMString base64Png);
 
-  callback EnsureWindowServiceClientHasDrawnWindowCallback =
-      void(boolean success);
-
   callback GetPrimaryDisplayScaleFactorCallback = void (double scaleFactor);
 
   callback IsTabletModeEnabledCallback = void (boolean enabled);
@@ -338,15 +335,6 @@
     static void setCrostiniAppScaled(DOMString appId, boolean scaled,
                                      VoidCallback callback);
 
-    // Ensure that the Window Service client identified by |clientName| has
-    // drawn any window. |callback| is invoked with true if the client has drawn
-    // anything or when it does so before the time out. Otherwise, an error
-    // is raised when timeout happens.
-    static void ensureWindowServiceClientHasDrawnWindow(
-        DOMString clientName,
-        long timeout_ms,
-        EnsureWindowServiceClientHasDrawnWindowCallback callback);
-
     // Get the primary display scale factor.
     // |callback| is invoked with the scale factor.
     static void getPrimaryDisplayScaleFactor(
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 986fc8ef7..2d6c4cb 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -4706,9 +4706,6 @@
     if (is_mac) {
       sources += [ "../browser/ui/views/frame/browser_non_client_frame_view_mac_unittest.mm" ]
     }
-    if (is_chromeos) {
-      sources += [ "../browser/ui/views/ime_driver/input_method_bridge_chromeos_unittest.cc" ]
-    }
     if (!is_chromeos) {
       sources += [
         "../browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc",
diff --git a/components/services/pdf_compositor/DEPS b/components/services/pdf_compositor/DEPS
index 0c41bb8..1f84ab9 100644
--- a/components/services/pdf_compositor/DEPS
+++ b/components/services/pdf_compositor/DEPS
@@ -9,7 +9,6 @@
   "+printing/common",
   "+services/service_manager/public/cpp",
   "+services/service_manager/public/mojom",
-  "+services/ws/public/mojom/constants.mojom.h",   # UI service name.
   "+skia",
   "+third_party/skia",
   "+third_party/blink/public/platform", # Test web sandbox support.
diff --git a/components/services/pdf_compositor/pdf_compositor_service.cc b/components/services/pdf_compositor/pdf_compositor_service.cc
index 517ed845..cc751c3 100644
--- a/components/services/pdf_compositor/pdf_compositor_service.cc
+++ b/components/services/pdf_compositor/pdf_compositor_service.cc
@@ -18,7 +18,6 @@
 #include "content/public/utility/utility_thread.h"
 #include "mojo/public/cpp/bindings/strong_binding.h"
 #include "services/service_manager/public/cpp/connector.h"
-#include "services/ws/public/mojom/constants.mojom.h"
 
 #if defined(OS_WIN)
 #include "content/public/child/dwrite_font_proxy_init_win.h"
diff --git a/mojo/public/tools/bindings/chromium_bindings_configuration.gni b/mojo/public/tools/bindings/chromium_bindings_configuration.gni
index ecbb510..d70eb62d 100644
--- a/mojo/public/tools/bindings/chromium_bindings_configuration.gni
+++ b/mojo/public/tools/bindings/chromium_bindings_configuration.gni
@@ -41,7 +41,6 @@
   "//services/resource_coordinator/public/cpp/typemaps.gni",
   "//services/service_manager/public/cpp/typemaps.gni",
   "//services/tracing/public/mojom/typemaps.gni",
-  "//services/ws/public/mojom/ime/typemaps.gni",
   "//services/viz/privileged/cpp/typemaps.gni",
   "//services/viz/privileged/interfaces/compositing/typemaps.gni",
   "//services/viz/public/cpp/compositing/typemaps.gni",
diff --git a/services/BUILD.gn b/services/BUILD.gn
index 0f33ba75..773980e 100644
--- a/services/BUILD.gn
+++ b/services/BUILD.gn
@@ -48,7 +48,6 @@
     deps += [
       "//services/ws/input_devices:tests",
       "//services/ws/public/cpp/tests",
-      "//services/ws/public/mojom:tests",
     ]
   }
 
diff --git a/services/ws/public/cpp/gpu/client_gpu_memory_buffer_manager.cc b/services/ws/public/cpp/gpu/client_gpu_memory_buffer_manager.cc
index 1b0f0128..499c2a35 100644
--- a/services/ws/public/cpp/gpu/client_gpu_memory_buffer_manager.cc
+++ b/services/ws/public/cpp/gpu/client_gpu_memory_buffer_manager.cc
@@ -16,7 +16,6 @@
 #include "mojo/public/cpp/system/buffer.h"
 #include "mojo/public/cpp/system/platform_handle.h"
 #include "services/service_manager/public/cpp/connector.h"
-#include "services/ws/public/mojom/constants.mojom.h"
 #include "ui/gfx/buffer_format_util.h"
 
 namespace ws {
diff --git a/services/ws/public/cpp/gpu/gpu.cc b/services/ws/public/cpp/gpu/gpu.cc
index 942dbeb..0a55112 100644
--- a/services/ws/public/cpp/gpu/gpu.cc
+++ b/services/ws/public/cpp/gpu/gpu.cc
@@ -19,7 +19,6 @@
 #include "services/service_manager/public/cpp/connector.h"
 #include "services/ws/public/cpp/gpu/client_gpu_memory_buffer_manager.h"
 #include "services/ws/public/cpp/gpu/context_provider_command_buffer.h"
-#include "services/ws/public/mojom/constants.mojom.h"
 #include "services/ws/public/mojom/gpu.mojom.h"
 
 namespace ws {
diff --git a/services/ws/public/cpp/input_devices/input_device_controller_client.cc b/services/ws/public/cpp/input_devices/input_device_controller_client.cc
index ccbd655..4decb45 100644
--- a/services/ws/public/cpp/input_devices/input_device_controller_client.cc
+++ b/services/ws/public/cpp/input_devices/input_device_controller_client.cc
@@ -8,7 +8,6 @@
 
 #include "base/bind_helpers.h"
 #include "services/service_manager/public/cpp/connector.h"
-#include "services/ws/public/mojom/constants.mojom.h"
 
 namespace ws {
 
@@ -16,9 +15,8 @@
     service_manager::Connector* connector,
     const std::string& service_name)
     : binding_(this) {
-  connector->BindInterface(
-      service_name.empty() ? mojom::kServiceName : service_name,
-      &input_device_controller_);
+  DCHECK(!service_name.empty());
+  connector->BindInterface(service_name, &input_device_controller_);
   mojom::KeyboardDeviceObserverPtr ptr;
   binding_.Bind(mojo::MakeRequest(&ptr));
   input_device_controller_->AddKeyboardDeviceObserver(std::move(ptr));
diff --git a/services/ws/public/mojom/BUILD.gn b/services/ws/public/mojom/BUILD.gn
index 504d20d..3eb3b00 100644
--- a/services/ws/public/mojom/BUILD.gn
+++ b/services/ws/public/mojom/BUILD.gn
@@ -7,14 +7,8 @@
 
 mojom("mojom") {
   sources = [
-    "event_injector.mojom",
     "gpu.mojom",
-    "remoting_event_injector.mojom",
-    "screen_provider_observer.mojom",
-    "user_activity_monitor.mojom",
     "window_manager.mojom",
-    "window_server_test.mojom",
-    "window_tree.mojom",
     "window_tree_constants.mojom",
   ]
 
@@ -29,7 +23,6 @@
     "//media/mojo/interfaces",
     "//mojo/public/mojom/base",
     "//services/viz/public/interfaces",
-    "//services/ws/public/mojom/ime",
     "//skia/public/interfaces",
     "//ui/base/ime/mojo",
     "//ui/base/mojo",
@@ -55,19 +48,3 @@
     "constants.mojom",
   ]
 }
-
-source_set("tests") {
-  testonly = true
-
-  sources = [
-    "ime/ime_struct_traits_unittest.cc",
-  ]
-
-  deps = [
-    "//base",
-    "//base/test:test_support",
-    "//services/ws/public/mojom/ime",
-    "//testing/gtest",
-    "//ui/gfx:test_support",
-  ]
-}
diff --git a/services/ws/public/mojom/event_injector.mojom b/services/ws/public/mojom/event_injector.mojom
deleted file mode 100644
index 4eaeb8c..0000000
--- a/services/ws/public/mojom/event_injector.mojom
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2017 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.
-
-module ws.mojom;
-
-import "ui/events/mojo/event.mojom";
-
-// An interface offered by the window service which allows clients to inject
-// events. This class is mainly provided for tests, but is also used for timing
-// (telemetry).
-interface EventInjector {
-  // Takes an event and dispatches it as if it came from the native platform.
-  // Responds with false on bad |display_id| or bad |event|; true once the
-  // event has completed processing.
-  //
-  // If |event| is a LocatedEvent, then the coordinates must be in DIPs, and
-  // relative to the origin of the display identified by |display_id|.
-  InjectEvent(int64 display_id, ui.mojom.Event event) => (bool result);
-
-  // Takes an event and dispatches it as if it came from the native platform.
-  // Similar to InjectEvent() but does not respond when processing is complete.
-  InjectEventNoAck(int64 display_id, ui.mojom.Event event);
-
-  // Similar to InjectEventNoAck(), but skips event rewriters.
-  InjectEventNoAckNoRewriters(int64 display_id, ui.mojom.Event event);
-};
diff --git a/services/ws/public/mojom/ime/BUILD.gn b/services/ws/public/mojom/ime/BUILD.gn
deleted file mode 100644
index 9484f1f..0000000
--- a/services/ws/public/mojom/ime/BUILD.gn
+++ /dev/null
@@ -1,20 +0,0 @@
-# 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.
-
-import("//mojo/public/tools/bindings/mojom.gni")
-
-mojom("ime") {
-  sources = [
-    "ime.mojom",
-  ]
-
-  public_deps = [
-    "//mojo/public/mojom/base",
-    "//ui/base/ime/mojo",
-    "//ui/events/mojo:interfaces",
-    "//ui/gfx/geometry/mojo",
-    "//ui/gfx/range/mojo",
-    "//ui/platform_window/mojo:interfaces",
-  ]
-}
diff --git a/services/ws/public/mojom/ime/OWNERS b/services/ws/public/mojom/ime/OWNERS
deleted file mode 100644
index e75daf74..0000000
--- a/services/ws/public/mojom/ime/OWNERS
+++ /dev/null
@@ -1,8 +0,0 @@
-per-file *_struct_traits*.*=set noparent
-per-file *_struct_traits*.*=file://ipc/SECURITY_OWNERS
-
-per-file *.mojom=set noparent
-per-file *.mojom=file://ipc/SECURITY_OWNERS
-
-per-file *.typemap=set noparent
-per-file *.typemap=file://ipc/SECURITY_OWNERS
diff --git a/services/ws/public/mojom/ime/ime.mojom b/services/ws/public/mojom/ime/ime.mojom
deleted file mode 100644
index 04ca6de..0000000
--- a/services/ws/public/mojom/ime/ime.mojom
+++ /dev/null
@@ -1,212 +0,0 @@
-// 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.
-
-module ws.mojom;
-
-import "mojo/public/mojom/base/text_direction.mojom";
-import "mojo/public/mojom/base/string16.mojom";
-import "ui/base/ime/mojo/ime_types.mojom";
-import "ui/events/mojo/event.mojom";
-import "ui/gfx/geometry/mojo/geometry.mojom";
-import "ui/gfx/range/mojo/range.mojom";
-import "ui/platform_window/mojo/text_input_state.mojom";
-
-// Specifies where to display the candidate window.
-enum CandidateWindowPosition {
-  // Candidate window follows the cursor.
-  kCursor,
-
-  // Candidate window is locked to the beginning of the composition.
-  kComposition
-};
-
-struct CandidateWindowProperties {
-  // Number of candidates to display per page.
-  int32 page_size;
-
-  // Should candidate window be rendered vertical or horizontal.
-  bool vertical;
-
-  // Text that is shown at the bottom of the candidate window.
-  string auxiliary_text;
-
-  // True to display auxiliary text, false to hide it.
-  bool auxiliary_text_visible;
-
-  // Position and visibility of cursor in the candidate window.
-  int32 cursor_position;
-  bool cursor_visible;
-
-  // Where to display the candidate window.
-  CandidateWindowPosition window_position;
-};
-
-// Represents a candidate window entry.
-struct CandidateWindowEntry {
-  // Value of the candidate.
-  mojo_base.mojom.String16 value;
-
-  // Short string displayed next to the candidate, often the shortcut key or
-  // index.
-  mojo_base.mojom.String16 label;
-
-  // Additional text describing the candidate.
-  mojo_base.mojom.String16 annotation;
-
-  // The usage or detailed description of the candidate.
-  mojo_base.mojom.String16 description_title;
-  mojo_base.mojom.String16 description_body;
-};
-
-// Represents the text input state of a client.
-struct TextInputState {
-  ui.mojom.TextInputType text_input_type;
-  ui.mojom.TextInputMode text_input_mode;
-  mojo_base.mojom.TextDirection text_direction;
-  int32 text_input_flags;  // A bitfield of ui::TextInputFlags.
-};
-
-// Cached input context information so that RemoteTextInputClient could support
-// synchronous getters.
-struct TextInputClientData {
-  gfx.mojom.Range? text_range;
-  mojo_base.mojom.String16? text;
-  bool has_composition_text;
-  gfx.mojom.Range? composition_text_range;
-  gfx.mojom.Range? editable_selection_range;
-  // Contains a boolean indicating the enabled state of each of the
-  // ui::TextEditCommands, where the index is the command. For example,
-  // edit_command_enabled[TextCommand::DELETE_BACKWARD] gives the enabled
-  // state of TextCommand::DELETE_BACKWARD.
-  array<bool>? edit_command_enabled;
-};
-
-// Detailed data of an IME session.
-struct SessionDetails {
-  // State of the text input client.
-  TextInputState state;
-
-  // Caret bounds of the text input client.
-  gfx.mojom.Rect caret_bounds;
-
-  // Data of the text input client.
-  TextInputClientData data;
-
-  // How the text input client was focused.
-  ui.mojom.FocusReason focus_reason;
-
-  // ukm::SourceId for identifying the text input client.
-  int64 client_source_for_metrics;
-
-  // Whether the text entered into this text input client should be used to
-  // improve IME suggestions.
-  bool should_do_learning;
-};
-
-// A service which provides the IMEDriver interface is responsible for doing
-// the composition logic. After starting a session, it receives events from
-// the client via the InputMethod interface, and sends composition events to
-// the client via the TextInputClient.
-interface IMEDriver {
-  StartSession(InputMethod& input_method_request,
-               TextInputClient client,
-               SessionDetails details);
-};
-
-// An IME driver register should register itself to Mus using the IMERegistrar
-// interface.
-interface IMERegistrar {
-  RegisterDriver(IMEDriver driver);
-};
-
-// A client sends updates to the IME driver using the InputMethod interface.
-// This interface is provided by IME drivers, and also by Mus as a lightweight
-// proxy between IME drivers and clients.
-interface InputMethod {
-  // Called when the text input state of client is changed.
-  OnTextInputStateChanged(TextInputState text_input_state);
-
-  // Client sends |caret_bounds| in focused window coordinates,
-  // Mus translates it to global coordinates and sends it to IME app.
-  OnCaretBoundsChanged(gfx.mojom.Rect caret_bounds);
-
-  // Update the cached text input client data.
-  OnTextInputClientDataChanged(TextInputClientData data);
-
-  // Called to process a key event. The callback function will be called to
-  // notify the client if the event was handled or not. A handled event may
-  // generate zero or more composition events which will be sent to the client
-  // using the "input method result" functions of TextInputClient interface.
-  ProcessKeyEvent(ui.mojom.Event key_event) => (bool handled);
-
-  CancelComposition();
-
-  // Plumbs requests to show the virtual keyboard.
-  ShowVirtualKeyboardIfEnabled();
-};
-
-// IME drivers send updates to clients using the TextInputClient interface.
-interface TextInputClient {
-  // Functions corresponding to "input method result" functions of
-  // ui::TextInputClient. See comments for InputMethod::ProcessKeyEvent() for
-  // when these are called.
-
-  // Sets composition text and attributes. See comments for
-  // ui::TextInputClient::SetCompositionText() for more details.
-  SetCompositionText(ui.mojom.CompositionText composition);
-
-  // Converts current composition text into final content.
-  ConfirmCompositionText();
-
-  // Removes current composition text.
-  ClearCompositionText();
-
-  // Inserts a given text at the insertion point. Current composition text or
-  // selection will be removed. This method should never be called when the
-  // current text input type is TEXT_INPUT_TYPE_NONE.
-  InsertText(mojo_base.mojom.String16 text);
-
-  // Inserts a single character at the insertion point. Unlike InsertText(),
-  // the character is not processed. See ui::TextInputClient::InsertChar()
-  // for more details.
-  InsertChar(ui.mojom.Event event);
-
-  // Dispatch a key event after minimal processing by the IME. The results of
-  // the callback indicated whether the event was handled, and whether any
-  // further processing should be performed. That is, if |stopped_propagation|
-  // is true, IME does no further processing.
-  DispatchKeyEventPostIME(ui.mojom.Event event) => (
-      bool handled,
-      bool stopped_propagation);
-
-  // Ensure the caret is not in |rect|.  |rect| is in dip screen coordinates
-  // and may extend beyond the bounds of this TextInputClient.
-  EnsureCaretNotInRect(gfx.mojom.Rect rect);
-
-  // Selects the given UTF-16 based character range. Current composition text
-  // will be confirmed before selecting the range.
-  SetEditableSelectionRange(gfx.mojom.Range range);
-
-  // Deletes contents in the given UTF-16 based character range. Current
-  // composition text will be confirmed before deleting the range.
-  DeleteRange(gfx.mojom.Range range);
-
-  // Called whenever current keyboard layout or input method is changed.
-  OnInputMethodChanged();
-
-  // Called whenever the user requests to change the text direction and layout
-  // alignment of the current text box.
-  ChangeTextDirectionAndLayoutAlignment(
-      mojo_base.mojom.TextDirection direction);
-
-  // Deletes the current selection plus the specified number of characters
-  // before and after the selection or caret.
-  ExtendSelectionAndDelete(uint32 before, uint32 after);
-
-  // TODO(moshayedi): Add functions corresponding to ui::TextInputClient for:
-  // - Input context information
-  // - Document content operations
-  // - Miscellaneous functions
-  // crbug.com/631527.
-};
diff --git a/services/ws/public/mojom/ime/ime.typemap b/services/ws/public/mojom/ime/ime.typemap
deleted file mode 100644
index c2a508d6..0000000
--- a/services/ws/public/mojom/ime/ime.typemap
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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.
-
-mojom = "//services/ws/public/mojom/ime/ime.mojom"
-public_headers = [ "//ui/base/ime/candidate_window.h" ]
-traits_headers = [ "//services/ws/public/mojom/ime/ime_struct_traits.h" ]
-sources = [
-  "//services/ws/public/mojom/ime/ime_struct_traits.cc",
-]
-public_deps = [
-  "//ui/base/ime",
-]
-
-type_mappings = [
-  "ws.mojom.CandidateWindowEntry=ui::CandidateWindow::Entry",
-  "ws.mojom.CandidateWindowProperties=ui::CandidateWindow::CandidateWindowProperty",
-]
diff --git a/services/ws/public/mojom/ime/ime_struct_traits.cc b/services/ws/public/mojom/ime/ime_struct_traits.cc
deleted file mode 100644
index a5bc13b..0000000
--- a/services/ws/public/mojom/ime/ime_struct_traits.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-// 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.
-
-#include "services/ws/public/mojom/ime/ime_struct_traits.h"
-
-#include "mojo/public/cpp/base/string16_mojom_traits.h"
-
-namespace mojo {
-
-// static
-bool StructTraits<ws::mojom::CandidateWindowPropertiesDataView,
-                  ui::CandidateWindow::CandidateWindowProperty>::
-    Read(ws::mojom::CandidateWindowPropertiesDataView data,
-         ui::CandidateWindow::CandidateWindowProperty* out) {
-  if (data.is_null())
-    return false;
-  if (!data.ReadAuxiliaryText(&out->auxiliary_text))
-    return false;
-  out->page_size = data.page_size();
-  out->is_vertical = data.vertical();
-  out->is_auxiliary_text_visible = data.auxiliary_text_visible();
-  out->cursor_position = data.cursor_position();
-  out->is_cursor_visible = data.cursor_visible();
-  out->show_window_at_composition =
-      data.window_position() ==
-      ws::mojom::CandidateWindowPosition::kComposition;
-  return true;
-}
-
-// static
-bool StructTraits<ws::mojom::CandidateWindowEntryDataView,
-                  ui::CandidateWindow::Entry>::
-    Read(ws::mojom::CandidateWindowEntryDataView data,
-         ui::CandidateWindow::Entry* out) {
-  return !data.is_null() && data.ReadValue(&out->value) &&
-         data.ReadLabel(&out->label) && data.ReadAnnotation(&out->annotation) &&
-         data.ReadDescriptionTitle(&out->description_title) &&
-         data.ReadDescriptionBody(&out->description_body);
-}
-
-}  // namespace mojo
diff --git a/services/ws/public/mojom/ime/ime_struct_traits.h b/services/ws/public/mojom/ime/ime_struct_traits.h
deleted file mode 100644
index 0d7e959..0000000
--- a/services/ws/public/mojom/ime/ime_struct_traits.h
+++ /dev/null
@@ -1,73 +0,0 @@
-// 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_WS_PUBLIC_MOJOM_IME_IME_STRUCT_TRAITS_H_
-#define SERVICES_WS_PUBLIC_MOJOM_IME_IME_STRUCT_TRAITS_H_
-
-#include "services/ws/public/mojom/ime/ime.mojom-shared.h"
-#include "ui/base/ime/candidate_window.h"
-
-namespace mojo {
-
-template <>
-struct StructTraits<ws::mojom::CandidateWindowPropertiesDataView,
-                    ui::CandidateWindow::CandidateWindowProperty> {
-  static int32_t page_size(
-      const ui::CandidateWindow::CandidateWindowProperty& p) {
-    return p.page_size;
-  }
-  static bool vertical(const ui::CandidateWindow::CandidateWindowProperty& p) {
-    return p.is_vertical;
-  }
-  static std::string auxiliary_text(
-      const ui::CandidateWindow::CandidateWindowProperty& p) {
-    return p.auxiliary_text;
-  }
-  static bool auxiliary_text_visible(
-      const ui::CandidateWindow::CandidateWindowProperty& p) {
-    return p.is_auxiliary_text_visible;
-  }
-  static int32_t cursor_position(
-      const ui::CandidateWindow::CandidateWindowProperty& p) {
-    return p.cursor_position;
-  }
-  static bool cursor_visible(
-      const ui::CandidateWindow::CandidateWindowProperty& p) {
-    return p.is_cursor_visible;
-  }
-  static ws::mojom::CandidateWindowPosition window_position(
-      const ui::CandidateWindow::CandidateWindowProperty& p) {
-    return p.show_window_at_composition
-               ? ws::mojom::CandidateWindowPosition::kComposition
-               : ws::mojom::CandidateWindowPosition::kCursor;
-  }
-  static bool Read(ws::mojom::CandidateWindowPropertiesDataView data,
-                   ui::CandidateWindow::CandidateWindowProperty* out);
-};
-
-template <>
-struct StructTraits<ws::mojom::CandidateWindowEntryDataView,
-                    ui::CandidateWindow::Entry> {
-  static base::string16 value(const ui::CandidateWindow::Entry& e) {
-    return e.value;
-  }
-  static base::string16 label(const ui::CandidateWindow::Entry& e) {
-    return e.label;
-  }
-  static base::string16 annotation(const ui::CandidateWindow::Entry& e) {
-    return e.annotation;
-  }
-  static base::string16 description_title(const ui::CandidateWindow::Entry& e) {
-    return e.description_title;
-  }
-  static base::string16 description_body(const ui::CandidateWindow::Entry& e) {
-    return e.description_body;
-  }
-  static bool Read(ws::mojom::CandidateWindowEntryDataView data,
-                   ui::CandidateWindow::Entry* out);
-};
-
-}  // namespace mojo
-
-#endif  // SERVICES_WS_PUBLIC_MOJOM_IME_IME_STRUCT_TRAITS_H_
diff --git a/services/ws/public/mojom/ime/ime_struct_traits_unittest.cc b/services/ws/public/mojom/ime/ime_struct_traits_unittest.cc
deleted file mode 100644
index ad28ee1..0000000
--- a/services/ws/public/mojom/ime/ime_struct_traits_unittest.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-// 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.
-
-#include "services/ws/public/mojom/ime/ime_struct_traits.h"
-
-#include <utility>
-
-#include "base/stl_util.h"
-#include "base/strings/utf_string_conversions.h"
-#include "mojo/public/cpp/base/string16_mojom_traits.h"
-#include "mojo/public/cpp/bindings/binding_set.h"
-#include "services/ws/public/mojom/ime/ime.mojom.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace ws {
-
-namespace {
-
-class IMEStructTraitsTest : public testing::Test {
- public:
-  IMEStructTraitsTest() {}
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(IMEStructTraitsTest);
-};
-
-}  // namespace
-
-TEST_F(IMEStructTraitsTest, CandidateWindowProperties) {
-  ui::CandidateWindow::CandidateWindowProperty input;
-  input.page_size = 7;
-  input.cursor_position = 3;
-  input.is_cursor_visible = true;
-  input.is_vertical = false;
-  input.show_window_at_composition = true;
-  input.auxiliary_text = "abcdefghij";
-  input.is_auxiliary_text_visible = false;
-
-  ui::CandidateWindow::CandidateWindowProperty output;
-  EXPECT_TRUE(mojom::CandidateWindowProperties::Deserialize(
-      mojom::CandidateWindowProperties::Serialize(&input), &output));
-
-  EXPECT_EQ(input.page_size, output.page_size);
-  EXPECT_EQ(input.cursor_position, output.cursor_position);
-  EXPECT_EQ(input.is_cursor_visible, output.is_cursor_visible);
-  EXPECT_EQ(input.is_vertical, output.is_vertical);
-  EXPECT_EQ(input.show_window_at_composition,
-            output.show_window_at_composition);
-  EXPECT_EQ(input.auxiliary_text, output.auxiliary_text);
-  EXPECT_EQ(input.is_auxiliary_text_visible, output.is_auxiliary_text_visible);
-
-  // Reverse boolean fields and check we still serialize/deserialize correctly.
-  input.is_cursor_visible = !input.is_cursor_visible;
-  input.is_vertical = !input.is_vertical;
-  input.show_window_at_composition = !input.show_window_at_composition;
-  input.is_auxiliary_text_visible = !input.is_auxiliary_text_visible;
-  EXPECT_TRUE(mojom::CandidateWindowProperties::Deserialize(
-      mojom::CandidateWindowProperties::Serialize(&input), &output));
-
-  EXPECT_EQ(input.is_cursor_visible, output.is_cursor_visible);
-  EXPECT_EQ(input.is_vertical, output.is_vertical);
-  EXPECT_EQ(input.show_window_at_composition,
-            output.show_window_at_composition);
-  EXPECT_EQ(input.is_auxiliary_text_visible, output.is_auxiliary_text_visible);
-}
-
-TEST_F(IMEStructTraitsTest, CandidateWindowEntry) {
-  ui::CandidateWindow::Entry input;
-  input.value = base::UTF8ToUTF16("entry_value");
-  input.label = base::UTF8ToUTF16("entry_label");
-  input.annotation = base::UTF8ToUTF16("entry_annotation");
-  input.description_title = base::UTF8ToUTF16("entry_description_title");
-  input.description_body = base::UTF8ToUTF16("entry_description_body");
-
-  ui::CandidateWindow::Entry output;
-  EXPECT_TRUE(mojom::CandidateWindowEntry::Deserialize(
-      mojom::CandidateWindowEntry::Serialize(&input), &output));
-
-  EXPECT_EQ(input.value, output.value);
-  EXPECT_EQ(input.label, output.label);
-  EXPECT_EQ(input.annotation, output.annotation);
-  EXPECT_EQ(input.description_title, output.description_title);
-  EXPECT_EQ(input.description_body, output.description_body);
-}
-
-}  // namespace ws
diff --git a/services/ws/public/mojom/ime/typemaps.gni b/services/ws/public/mojom/ime/typemaps.gni
deleted file mode 100644
index 9785b15..0000000
--- a/services/ws/public/mojom/ime/typemaps.gni
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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.
-
-typemaps = [ "//services/ws/public/mojom/ime/ime.typemap" ]
diff --git a/services/ws/public/mojom/remoting_event_injector.mojom b/services/ws/public/mojom/remoting_event_injector.mojom
deleted file mode 100644
index 7a276c1..0000000
--- a/services/ws/public/mojom/remoting_event_injector.mojom
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2018 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.
-
-module ws.mojom;
-
-import "ui/gfx/geometry/mojo/geometry.mojom";
-
-enum InjectedMouseButtonType {
-  kLeft,
-  kMiddle,
-  kRight,
-};
-
-// An interface offered by the window service which allows clients to inject
-// events for remoting. This interfaces mirrors that of
-// ui/events/SystemEventInjector.
-interface RemotingEventInjector {
-  MoveCursorToLocationInPixels(gfx.mojom.PointF location);
-
-  // If |down| is true, injects a mouse press, otherwise a mouse release.
-  InjectMousePressOrRelease(InjectedMouseButtonType button, bool down);
-
-  InjectMouseWheelInPixels(int32 delta_x, int32 delta_y);
-
-  // |native_key_code| corresponds to the native key-code from a dom-code. See
-  // DomCodeToNativeKeycode().
-  InjectKeyEvent(int32 native_key_code, bool down, bool suppress_auto_repeat);
-};
diff --git a/services/ws/public/mojom/screen_provider_observer.mojom b/services/ws/public/mojom/screen_provider_observer.mojom
deleted file mode 100644
index 45304dd..0000000
--- a/services/ws/public/mojom/screen_provider_observer.mojom
+++ /dev/null
@@ -1,22 +0,0 @@
-// 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.
-
-module ws.mojom;
-
-import "services/ws/public/mojom/window_tree_constants.mojom";
-
-interface ScreenProviderObserver {
-  // Sent when the observer is added as well as any time the set of displays
-  // changes in any way. |displays| contains all known displays. If the system
-  // that WS is running on has an integrated display, for example a laptop
-  // internal display, then |internal_display_id| will be the corresponding
-  // display id. If there is no internal display then |internal_display_id| will
-  // be kInvalidDisplayID. |display_id_for_new_windows| is the display on which
-  // to place new top-level windows, usually the display on which a window was
-  // last activated.
-  OnDisplaysChanged(array<WsDisplay> displays,
-                    int64 primary_display_id,
-                    int64 internal_display_id,
-                    int64 display_id_for_new_windows);
-};
diff --git a/services/ws/public/mojom/user_activity_monitor.mojom b/services/ws/public/mojom/user_activity_monitor.mojom
deleted file mode 100644
index f0cf7448..0000000
--- a/services/ws/public/mojom/user_activity_monitor.mojom
+++ /dev/null
@@ -1,31 +0,0 @@
-// 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.
-
-module ws.mojom;
-
-interface UserActivityObserver {
-  OnUserActivity();
-};
-
-interface UserIdleObserver {
-  enum IdleState {
-    ACTIVE,
-    IDLE,
-  };
-  OnUserIdleStateChanged(IdleState new_state);
-};
-
-interface UserActivityMonitor {
-  // Notifies the observer of user activity at most once every
-  // |delay_between_notify_secs| seconds.
-  AddUserActivityObserver(uint32 delay_between_notify_secs,
-                          UserActivityObserver observer);
-
-  // Notifies the observer when user is idle for more than
-  // |idle_time_in_minutes| minutes. When the observer is first added, if the
-  // user has already been idle for |idle_time_in_minutes|, then
-  // OnUserIdleStateChanged(IDLE) is called on the observer, otherwise
-  // OnUserIdleStateChanged(ACTIVE) is called.
-  AddUserIdleObserver(uint32 idle_time_in_minutes, UserIdleObserver observer);
-};
diff --git a/services/ws/public/mojom/window_server_test.mojom b/services/ws/public/mojom/window_server_test.mojom
deleted file mode 100644
index 261aa94..0000000
--- a/services/ws/public/mojom/window_server_test.mojom
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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.
-
-module ws.mojom;
-
-import "ui/events/mojo/event.mojom";
-
-interface WindowServerTest {
-  EnsureClientHasDrawnWindow(string client_name) => (bool success);
-};
diff --git a/services/ws/public/mojom/window_tree.mojom b/services/ws/public/mojom/window_tree.mojom
deleted file mode 100644
index aca3358..0000000
--- a/services/ws/public/mojom/window_tree.mojom
+++ /dev/null
@@ -1,709 +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.
-
-module ws.mojom;
-
-import "mojo/public/mojom/base/unguessable_token.mojom";
-import "services/viz/public/interfaces/compositing/compositor_frame_sink.mojom";
-import "services/viz/public/interfaces/compositing/frame_sink_id.mojom";
-import "services/viz/public/interfaces/compositing/local_surface_id_allocation.mojom";
-import "services/viz/public/interfaces/compositing/surface_info.mojom";
-import "services/ws/public/mojom/window_manager.mojom";
-import "services/ws/public/mojom/screen_provider_observer.mojom";
-import "services/ws/public/mojom/window_tree_constants.mojom";
-import "ui/base/ime/mojo/ime.mojom";
-import "ui/base/mojo/cursor.mojom";
-import "ui/base/mojo/ui_base_types.mojom";
-import "ui/events/mojo/event.mojom";
-import "ui/events/mojo/event_constants.mojom";
-import "ui/gfx/geometry/mojo/geometry.mojom";
-import "ui/gfx/image/mojo/image.mojom";
-import "ui/gfx/mojo/transform.mojom";
-import "ui/platform_window/mojo/text_input_state.mojom";
-
-// Windows are identified by a uint64. The upper 32 bits are the id assigned to
-// the client by the Window Service, and the lower 32 an id assigned by the
-// client. Windows created by the client supply a client id of 0, which the
-// Window Service maps appropriately. For clients that see Windows created by
-// another client, the upper 32 bits are set to identify the other client.
-//
-// The root window is identified with a connection id of 0, and value of 1.
-//
-// Most functions to the WindowTree take a change_id parameter. When
-// WindowTree completes processing of a function WindowTree calls
-// WindowTreeClient::OnChangeCompleted() with the change_id supplied by the
-// client and the result of the function. This allows the client to track
-// whether the call succeeded or not. Calls are done via the client interface
-// rather than a callback to ensure ordering. The server does not interpret the
-// change id in anyway, it is up to the client to assign a value and use it.
-// Generally the change id is an ever increasing integer.
-//
-// Event processing happens in the following order:
-// . The event is sent to the accelerator registered for the PRE_TARGET. If
-//   the client consumes the event, matching event observers are notified and
-//   processing stops. If the client does not consume the event processing
-//   continues.
-// . Target window (lookup of the target window depends upon the event type) and
-//   matching event observers are notified at the same time. The target is only
-//   notified once, even if it has a matching event observer registered. If the
-//   target consumes the event, processing stops.
-// . Accelerator registered for POST_TARGET. No response is expected from the
-//   client for the POST_TARGET and processing of the next continues
-//   immediately.
-interface WindowTree {
-  // Creates a new window with the specified id. It is up to the client to
-  // ensure the id is unique to the connection (the id need not be globally
-  // unique). Additionally the connection id (embedded in |window_id|) must
-  // match that of the connection.
-  // Errors:
-  //   ERROR_CODE_VALUE_IN_USE: a window already exists with the specified id.
-  //   ERROR_CODE_ILLEGAL_ARGUMENT: The connection part of |window_id| does not
-  //     match the connection id of the client.
-  NewWindow(uint32 change_id,
-            uint64 window_id,
-            map<string, array<uint8>>? properties);
-
-  // Requests the WindowManager to create a new top level window. On success
-  // OnTopLevelCreated() is called with the WindowData for the new window. On
-  // failure OnChangeCompleted() is called.
-  NewTopLevelWindow(uint32 change_id,
-                    uint64 window_id,
-                    map<string, array<uint8>> properties);
-
-  // Deletes a window. This does not recurse. No hierarchy change notifications
-  // are sent as a result of this. Only the connection that created the window
-  // can delete it. DeleteWindow() may also be used to remove a window as an
-  // embed root from the client. When DeleteWindow() is used to remove an embed
-  // root, the client no longer has access to the embed root. The embedder of
-  // the root is notified of the change via OnEmbeddedAppDisconnected().
-  DeleteWindow(uint32 change_id, uint64 window_id);
-
-  // Requests input event capture for the given |window_id|. Capture is only
-  // allowed if the window is processing an event. When a window gains capture,
-  // current input events are canceled. The given window will receive all
-  // subsequent input until an alternate window is set via SetCapture, or
-  // ReleaseCapture is called for |window_id|. OnCaptureChanged() is called to
-  // notify of capture changing (as long as the client did not initiate the
-  // change).
-  SetCapture(uint32 change_id, uint64 window_id);
-
-  // Releases input event capture for the given |window_id|. This does nothing
-  // if |window_id| does not currently have capture.
-  ReleaseCapture(uint32 change_id, uint64 window_id);
-
-  // Start observing global events matching the supplied |types|, even if they
-  // are not targeted at the requesting client. Events that would normally be
-  // sent to the requesting client (ie. the event target is this window tree)
-  // are sent to OnWindowInputEvent() with |matches_event_observer| set to true.
-  //
-  // Clients should limit the requested types and the duration of observation,
-  // as there is a system-wide perf/battery penalty, especially for mouse moves.
-  //
-  // See class description for details on event delivery.
-  ObserveEventTypes(array<ui.mojom.EventType> types);
-
-  // Sets the specified bounds of the specified window. The window will paint
-  // the frame in the provided |local_frame_id|, if any.
-  // |local_surface_id_allocation| need only be supplied for roots.
-  // For top-levels, clients may supply a null LocalSurfaceIdAllocation, before
-  // OnTopLevelCreated() is called (clients receive the initial
-  // LocalSurfaceIdAllocation in OnTopLevelCreated()). While clients may supply
-  // a LocalSurfaceIdAllocation for top-levels, they are only allowed to
-  // change the child-sequence number portion of the id. Supplying a different
-  // embed token results in failure, and changes to the parent sequence number
-  // are ignored.
-  // |bounds| are in DIPs.
-  SetWindowBounds(
-      uint32 change_id,
-      uint64 window_id,
-      gfx.mojom.Rect bounds,
-      viz.mojom.LocalSurfaceIdAllocation? local_surface_id_allocation);
-
-  // Updates the LocalSurfaceIdAllocation for a window from the child. Does
-  // nothing if |window_id| does not identify a top-level. See comment in
-  // SetWindowBounds() for allowable values of |local_surface_id_allocation|.
-  UpdateLocalSurfaceIdFromChild(
-      uint64 window_id,
-      viz.mojom.LocalSurfaceIdAllocation local_surface_id_allocation);
-
-  // Asks the server to generate a new LocalSurfaceId for a window. The server
-  // responds with the new LocalSurfaceId by way of OnWindowBoundsChanged().
-  // This is only useful for top-levels.
-  AllocateLocalSurfaceId(uint64 window_id);
-
-  SetWindowTransform(uint32 change_id,
-                     uint64 window_id,
-                     gfx.mojom.Transform transform);
-
-  // Sets the client area of the specified window. The client area is specified
-  // by way of insets. Everything outside of the insets, and not in
-  // |additional_client_areas| is considered non-client area.
-  // TODO(sky): convert additional_client_areas to a path.
-  SetClientArea(uint64 window_id,
-                gfx.mojom.Insets insets,
-                array<gfx.mojom.Rect>? additional_client_areas);
-
-  // Insets the hit test of a window by the specified values. The insets must be
-  // positive (or zero). |mouse| applies to events originating from the mouse,
-  // and |touch| from a non-mouse pointer device (such as tap).
-  SetHitTestInsets(uint64 window_id,
-                   gfx.mojom.Insets mouse,
-                   gfx.mojom.Insets touch);
-
-  // Specifies the shape of the window. The region outside of the shape becomes
-  // transparent and should be considered to be outside of the widget, so
-  // underlying window will be targeted. Each element of |shape| is relative to
-  // the window's coordinate. Empty means to reset the settings, so the normal
-  // rectangular region will be used.
-  SetShape(uint64 window_id, array<gfx.mojom.Rect> shape);
-
-  // Called by clients that want to accept drag and drops. Windows default to
-  // this being disabled; a window must actively opt-in to receiving OnDrag*()
-  // calls.
-  SetCanAcceptDrops(uint64 window_id, bool accepts_drops);
-
-  // Sets the visibility of the specified window to |visible|. Connections are
-  // allowed to change the visibility of any window they have created, as well
-  // as any of their roots.
-  SetWindowVisibility(uint32 change_id, uint64 window_id, bool visible);
-
-  // Sets an individual named property. Setting an individual property to null
-  // deletes the property.
-  SetWindowProperty(uint32 change_id,
-                    uint64 window_id,
-                    string name,
-                    array<uint8>? value);
-
-  // Sets the opacity of the specified window to |opacity|.
-  SetWindowOpacity(uint32 change_id, uint64 window_id, float opacity);
-
-  // Sets the transparent status of the specified window to |transparent|.
-  SetWindowTransparent(uint32 change_id, uint64 window_id, bool transparent);
-
-  // Attaches a CompositorFrameSink to a particular window.
-  AttachCompositorFrameSink(
-      uint64 window_id,
-      viz.mojom.CompositorFrameSink& compositor_frame_sink,
-      viz.mojom.CompositorFrameSinkClient client);
-
-  // Reparents a window.
-  // This fails for any of the following reasons:
-  // . |parent| or |child| does not identify a valid window.
-  // . |child| is an ancestor of |parent|.
-  // . |child| is already a child of |parent|.
-  //
-  // This may result in a connection getting OnWindowDeleted(). See
-  // RemoveWindowFromParent for details.
-  AddWindow(uint32 change_id, uint64 parent, uint64 child);
-
-  // Removes a window from its current parent. This fails if the window is not
-  // valid or the window already has no parent.
-  //
-  // Removing a window from a parent may result in OnWindowDeleted() being sent
-  // to other connections. For example, connection A has windows 1 and 2, with 2
-  // a child of 1. Connection B has a root 1. If 2 is removed from 1 then B gets
-  // OnWindowDeleted(). This is done as window 2 is effectively no longer
-  // visible to connection B.
-  RemoveWindowFromParent(uint32 change_id, uint64 window_id);
-
-  // Ties the lifetime of |transient_window_id| to the lifetime of |window_id|.
-  // This also places |transient_window_id| on top of |window_id|.
-  // This fails for any of the following reasons:
-  // . |window_id| or |transient_window_id| does not identify a valid window.
-  // . |transient_window_id| is an ancestor of |window_id|.
-  // . |transient_window_id| is modal to system.
-  AddTransientWindow(uint32 change_id,
-                     uint64 window_id,
-                     uint64 transient_window_id);
-
-  // Decouples the lifetime of |transient_window_id| from its transient parent.
-  // This does not change transient window's position in the window hierarchy.
-  RemoveTransientWindowFromParent(uint32 change_id, uint64 transient_window_id);
-
-  // Changes modality type of |window_id|. This releases capture if necessary.
-  // This fails for any of the following reasons:
-  // . |window_id| does not identify a valid window.
-  // . Client does not have a valid user id (i.e., it is an embedded app).
-  SetModalType(uint32 change_id, uint64 window_id, ui.mojom.ModalType type);
-
-  // Reorders a window in its parent, relative to |relative_window_id| according
-  // to |direction|. Only the connection that created the window's parent can
-  // reorder its children.
-  ReorderWindow(uint32 change_id,
-                uint64 window_id,
-                uint64 relative_window_id,
-                OrderDirection direction);
-
-  // Returns the windows comprising the tree starting at |window_id|.
-  // |window_id| is the first result in the return value, unless |window_id| is
-  // invalid, in which case an empty vector is returned. The windows are visited
-  // using a depth first search (pre-order).
-  GetWindowTree(uint64 window_id) => (array<WindowData> windows);
-
-  // A connection may grant access to another connection by way of Embed().
-  // Embed() results in the supplied WindowTreeClient being configured with a
-  // root window of |window_id|. The supplied WindowTreeClient may create child
-  // windows and do other various tree operations (including Embed()), but does
-  // not see nor have access to any of the windows above the embed point.
-  //
-  // The caller must have created |window_id|. If not the request fails and the
-  // response is false.
-  //
-  // The embedder can dictate the behaviour of the embedded client by setting
-  // the appropriate embed flags (e.g. kEmbedFlagEmbedderInterceptsEvents).
-  //
-  // When a connection embeds a WindowTreeClient the originating connection no
-  // longer has privileges to access or see any of the children of the window.
-  // If the window had existing children the children are removed. The
-  // WindowManager gets to see the whole tree.
-  //
-  // A window may only have one embedding in it at a time. Subsequent calls to
-  // Embed() for the same window result in the currently embedded
-  // WindowTreeClient being removed. The embedded app is told this by way of
-  // OnUnembed(), which is followed by OnWindowDeleted() (as the connection no
-  // longer has access to the window).
-  //
-  // The embedder can detect when the embedded app disconnects by way of
-  // OnEmbeddedAppDisconnected().
-  //
-  // The callback returns whether the embedding was successful.
-  Embed(uint64 window_id, WindowTreeClient client, uint32 embed_flags)
-      => (bool success);
-
-  // Schedules a future call to Embed() using the returned token. This is used
-  // when two clients need to work together to complete an embedding without
-  // passing the WindowTreeClient between the two. This ensures a client isn't
-  // able to spoof another client (say by directly passing events to the
-  // client).
-  //
-  // For example, client A embeds client B in a window. Client A wants client B
-  // to embed a WindowTreeClient in a window created by client B. This can be
-  // accomplished by client A calling ScheduleEmbed() and then passing the
-  // token returned from ScheduleEmbed() to client B (using a separate pipe) so
-  // that client B may call EmbedUsingToken().
-  ScheduleEmbed(WindowTreeClient client)
-      => (mojo_base.mojom.UnguessableToken token);
-
-  // Creates an UnguessableToken for use in a future call, by another client, to
-  // EmbedUsingToken().
-  //
-  // The following example shows how to use this api. Client A wants client B
-  // to embed it in a window created by client B.
-  // 1. Client A calls ScheduleEmbedForExistingClient() to get a token.
-  // 2. Client A passes the token to client B. This communication is done using
-  //    an additional channel, outside of WindowTree/WindowTreeClient.
-  // 3. Client B calls EmbedUsingToken().
-  // 4. Client A receives OnEmbedFromToken() with the token from step 1.
-  //
-  // |window_id| is the id used for the window once EmbedUsingToken() is called.
-  // More specifically, when OnEmbedFromToken() is called |window_id| is the id
-  // of the window identified in the WindowData.
-  ScheduleEmbedForExistingClient(uint32 window_id) => (
-      mojo_base.mojom.UnguessableToken token);
-
-  // Pair with ScheduleEmbed() or ScheduleEmbedForExistingClient() to complete
-  // an embedding, see them for details.
-  EmbedUsingToken(uint64 window_id,
-                  mojo_base.mojom.UnguessableToken token,
-                  uint32 embed_flags)
-      => (bool success);
-
-  // Attaches/unattaches a FrameSinkId to this window. A window can only have
-  // a single frame-sink-id attached to it.
-  AttachFrameSinkId(uint64 window_id,
-                    viz.mojom.FrameSinkId frame_sink_id);
-  UnattachFrameSinkId(uint64 window_id);
-
-  // Sets focus to the specified window, use 0 to clear focus. For a window to
-  // get focus the following has to happen: the window is drawn, the window has
-  // been marked as focusable (see SetCanFocus()) and the window is in a
-  // container the WindowManager has identified as allowing activation
-  // (see WindowManagerClient::AddActivationParent()).
-  SetFocus(uint32 change_id, uint64 window_id);
-
-  // Marks the specified window as being able to receive focus.
-  SetCanFocus(uint64 window_id, bool can_focus);
-
-  // Sets the cursor when the pointer is inside |window_id|.
-  SetCursor(uint32 change_id, uint64 window_id, ui.mojom.Cursor cursor);
-
-  // Set text input state for the given window.
-  SetWindowTextInputState(uint64 window_id, ui.mojom.TextInputState state);
-
-  // Set the input method editor UI (software keyboard, etc) visibility.
-  // If state is non-null, the specified window's text input state is updated.
-  // Otherwise the existing state is used.
-  SetImeVisibility(uint64 window_id,
-                   bool visible,
-                   ui.mojom.TextInputState? state);
-
-  // Sets the EventTargetingPolicy. See EventTargetingPolicy for details.
-  SetEventTargetingPolicy(uint64 window_id, EventTargetingPolicy policy);
-
-  // See documentation for WindowTreeClient::OnWindowInputEvent().
-  OnWindowInputEventAck(uint32 event_id, EventResult result);
-
-  // If the current focus is (or is a child of) |window_id|, requests that the
-  // window manager change the focus to the next activatable window.
-  DeactivateWindow(uint64 window_id);
-
-  // Stacks the window |above_id| above |below_id|. These two windows must
-  // share the same parent. This function is intended for use with top-levels
-  // only. For non-top-levels, use ReorderWindow().
-  // TODO(sky): unify this and ReorderWindow(). https://crbug.com/850133.
-  StackAbove(uint32 change_id, uint64 above_id, uint64 below_id);
-
-  // Stacks the window above all sibling windows.
-  StackAtTop(uint32 change_id, uint64 window_id);
-
-  // Requests a window manager specific interface. |name| is the name of the
-  // interface. This function is typed to WindowManager, but that's purely
-  // by necessity. This function is used to request *any* interface known to
-  // the environment hosting the window service. If |name| is not the name of
-  // an interface known to the environment hosting the window service,
-  // |window_manager| is closed.
-  BindWindowManagerInterface(string name,
-                             associated WindowManager& window_manager);
-
-  // Returns a shared memory segment that contains two 16-bit ints packed into a
-  // single Atomic32, which represent the current location of the mouse cursor
-  // where the location is (x << 16) | y.
-  GetCursorLocationMemory() => (handle<shared_buffer> cursor_buffer);
-
-  // Tells the window manager to start moving or resizing the window.
-  // OnChangeCompleted is called on whether the move was canceled. Because
-  // there's a delay between when a client sends this message and when the
-  // window manager starts acting on it, pass the cursor location at the start
-  // of the move. |hit_test| specifies the type of the session; kCaption for
-  // moving.
-  PerformWindowMove(uint32 change_id, uint64 window_id, MoveLoopSource source,
-                    gfx.mojom.Point cursor, ui.mojom.HitTest hit_test);
-
-  // Tells the window manager to cancel any in progress window move started with
-  // StartWindowMove() and to revert the window bounds to how they were.
-  CancelWindowMove(uint64 window_id);
-
-  // Called by the client to start a drag operation. |source_window_id| is the
-  // source window, |screen_location| is what the source thinks their location
-  // of the pointer which started the drag is, |drag_data| is the entire set of
-  // mime to raw data mapping. |drag_image| and |drag_image_offset| describe
-  // an image to hold behind the cursor which represents the data on the
-  // clipboard. We send this during the start of the drag because most views
-  // clients will try to read all this data on first entry.
-  PerformDragDrop(uint32 change_id,
-                  uint64 source_window_id,
-                  gfx.mojom.Point screen_location,
-                  map<string, array<uint8>> drag_data,
-                  gfx.mojom.ImageSkia? drag_image,
-                  gfx.mojom.Vector2d drag_image_offset,
-                  uint32 drag_operation,
-                  ui.mojom.PointerKind source);
-
-  // Called by the client to cancel any in progress drag drop operation. This
-  // will result in a change completed for the underlying change.
-  CancelDragDrop(uint64 window_id);
-
-  // Called by the client to start a session of observing the topmost window
-  // under the cursor or touch point. Once called, OnTopmostWindowChanged() is
-  // called on the client whenever the topmost window changes. |source|
-  // specifies what type of located events should be observed (mouse or touch),
-  // and |window_id| specifies the initial target of the located event.
-  ObserveTopmostWindow(MoveLoopSource source, uint64 window_id);
-
-  // Called by the client to request stopping the ongoing session of observing
-  // the topmost window under the cursor.
-  StopObservingTopmostWindow();
-
-  // Sets the resize shadow for |hit_test| to the specified window. It hides
-  // the shadow when kNowhere is set.
-  SetWindowResizeShadow(uint64 window_id, ui.mojom.HitTest hit_test);
-
-  // Called by the client to cancel active touch events. not_cancelled_window_id
-  // is a window ID, and that window is excluded from cancelling. When
-  // not_cancelled_window_id is invalid, active touch events should be cancelled
-  // on all windows.
-  CancelActiveTouchesExcept(uint64 not_cancelled_window_id);
-
-  // Called by the client to cancel active touches on |window_id|.
-  CancelActiveTouches(uint64 window_id);
-
-  // Called by the client to transfer the gesture stream from the window of
-  // |current_id| to the window of |new_id|. If |should_cancel| is set, then
-  // cancel events are also dispatched to |current_id|. Both |current_id| and
-  // |new_id| need to be valid window ID created by the client. This operation
-  // is not allowed for embedded clients.
-  TransferGestureEventsTo(uint64 current_id, uint64 new_id, bool should_cancel);
-
-  // Called by the client to start occlusion tracking for a window.
-  TrackOcclusionState(uint64 window_id);
-
-  // Called by the client to pause occlusion states computation when there are
-  // massive window changes (such as a hierarchy change, or multiple window
-  // visibility change) to avoid unnecessary occlusion state updates. Server
-  // will re-compute the occlusion state after a balancing
-  // UnpauseWindowOcclusionTracking call.
-  PauseWindowOcclusionTracking();
-
-  // Called by the client the resume occlusion states computation. When
-  // all outstanding pause requests are cleared, server will re-compute
-  // occlusion states for the tracked windows and send back updates.
-  UnpauseWindowOcclusionTracking();
-
-  // Called by the client every time the focus changes, to build the connection
-  // between the client and the IME. And Window Service makes sure that only
-  // focused client can have the connection.
-  ConnectToImeEngine(ime.mojom.ImeEngine& engine_request,
-                     ime.mojom.ImeEngineClient client);
-};
-
-// Changes to windows are not sent to the connection that originated the
-// change. For example, if connection 1 changes the bounds of a window by
-// calling SetWindowBounds(), connection 1 does not receive
-// OnWindowBoundsChanged().
-interface WindowTreeClient {
-  // Sent when clients establishes a connection to the WindowService.
-  // |client_id| gives the unique id for the client. This value is generally
-  // only useful for debugging.
-  OnClientId(uint32 client_id);
-
-  // Invoked when the client application has been embedded at |root|.
-  // See Embed() on WindowTree for more details. |tree| will be a handle back to
-  // the window manager service, unless the connection is to the root connection
-  // in which case it will be null. |parent_drawn| is true if roots parent is
-  // drawn, see OnParentDrawnStateChanged() for details. |display_id| identifies
-  // the display this root window is on. If the embedded window has a size,
-  // |local_surface_id| identifies the ID to use to submit CompositorFrames.
-  OnEmbed(WindowData root,
-          WindowTree? tree,
-          int64 display_id,
-          uint64 focused_window,
-          bool parent_drawn,
-          viz.mojom.LocalSurfaceIdAllocation? local_surface_id_allocation);
-
-  // See description in ScheduleEmbedForExistingClient() for details on this.
-  // Supplied arguments match that of OnEmbed().
-  OnEmbedFromToken(
-      mojo_base.mojom.UnguessableToken token,
-      WindowData root,
-      int64 display_id,
-      viz.mojom.LocalSurfaceIdAllocation? local_surface_id_allocation);
-
-  // Invoked when the application embedded at |window| is disconnected. In other
-  // words the embedded app closes the connection to the server. This is called
-  // on the connection that created |window| as well as any ancestors that have
-  // the embed root policy.
-  OnEmbeddedAppDisconnected(uint64 window);
-
-  // Sent when another connection is embedded in the Window this connection was
-  // previously embedded in. See Embed() for more information.
-  OnUnembed(uint64 window);
-
-  // Sent when capture changes. This is not sent if the client initiated the
-  // change.
-  OnCaptureChanged(uint64 new_capture, uint64 old_capture);
-
-  // This is called on the client that initiated a call to Embed(), and informs
-  // the owner (embedder) of the new FrameSinkId of the window (embedding
-  // results in changing the FrameSinkId).
-  OnFrameSinkIdAllocated(uint64 window, viz.mojom.FrameSinkId frame_sink_id);
-
-  // Called in response to NewTopLevelWindow() successfully completing.
-  // |parent_drawn| is true if the parent of the window is drawn, see
-  // OnDrawnStateChanged() for details. |display_id| identifies the display this
-  // window is on.
-  OnTopLevelCreated(
-      uint32 change_id,
-      WindowData data,
-      int64 display_id,
-      bool parent_drawn,
-      viz.mojom.LocalSurfaceIdAllocation local_surface_id_allocation);
-
-  // Invoked when a window's bounds have changed. |state| is supplied for roots,
-  // and SHOW_STATE_DEFAULT for non-roots. It allows the client to
-  // simultaneously update both bounds and show state, e.g. after a maximize
-  // operation. |local_surface_id_allocation| is only supplied for roots.
-  OnWindowBoundsChanged(
-      uint64 window,
-      gfx.mojom.Rect new_bounds,
-      ui.mojom.WindowShowState state,
-      viz.mojom.LocalSurfaceIdAllocation? local_surface_id_allocation);
-
-  OnWindowTransformChanged(uint64 window,
-                           gfx.mojom.Transform new_transform);
-
-  OnTransientWindowAdded(uint64 window_id,
-                         uint64 transient_window_id);
-
-  OnTransientWindowRemoved(uint64 window_id,
-                           uint64 transient_window_id);
-
-  // Invoked when a change is done to the hierarchy. A value of 0 is used to
-  // identify a null window. For example, if the old_parent is NULL, 0 is
-  // supplied.
-  // If |window| was not visible to this client, but is visible now because
-  // |new_parent| is visible to this client, then |windows| contains details
-  // about |window|, and all its descendants. |windows| includes any windows
-  // the client may already know about, but did not know the parent because
-  // the parent was previously not visible to this client.
-  // This is not sent for hierarchy changes of windows not known to this client
-  // or not attached to the tree.
-  OnWindowHierarchyChanged(uint64 window,
-                           uint64 old_parent,
-                           uint64 new_parent,
-                           array<WindowData> windows);
-
-  // Invoked when the order of windows within a parent changes.
-  OnWindowReordered(uint64 window_id,
-                    uint64 relative_window_id,
-                    OrderDirection direction);
-
-  // Invoked when a window is deleted.
-  OnWindowDeleted(uint64 window);
-
-  // Invoked when the visibility of the specified window changes.
-  OnWindowVisibilityChanged(uint64 window, bool visible);
-
-  // Invoked when the window moves to a new display. This is only called on
-  // a top-level window or an embedded root.
-  OnWindowDisplayChanged(uint64 window, int64 display_id);
-
-  // Invoked when the drawn state of |window|'s parent changes. The drawn state
-  // is determined by the visibility of a Window and the Windows ancestors. A
-  // Window is drawn if all ancestors are visible, not drawn if any ancestor is
-  // hidden.
-  //
-  // The initial drawn state is communicated by way of OnTopLevelCreated() or
-  // OnEmbed().
-  //
-  // This function is only called for root Windows as the drawn state of all
-  // other windows can be determined from their parent.
-  OnWindowParentDrawnStateChanged(uint64 window, bool drawn);
-
-  // Invoked when a window property is changed. If this change is a removal,
-  // |new_data| is null.
-  OnWindowSharedPropertyChanged(uint64 window,
-                                string name,
-                                array<uint8>? new_data);
-
-  // Invoked when an event is targeted at the specified window. The client must
-  // call WindowTree::OnWindowInputEventAck() with the same |event_id| to ack
-  // that the event has been processed, and with an EventResult value to notify
-  // if the event was consumed. |matches_event_observer| is true if the event
-  // also matches the requested types passed via ObserveEventTypes(). The client
-  // must respond to ack these events, regardless of |matches_event_observer|.
-  OnWindowInputEvent(uint32 event_id,
-                     uint64 window,
-                     int64 display_id,
-                     ui.mojom.Event event,
-                     bool matches_event_observer);
-
-  // Called when an event not targeted at this client is observed, matching the
-  // event types passed to ObserveEventTypes(); see that function for details.
-  // Located events are always passed with the locations in screen coordinates.
-  // The client should not respond to ack these events.
-  OnObservedInputEvent(ui.mojom.Event event);
-
-  // Called in two distinct cases: when a window known to the connection gains
-  // focus, or when focus moves from a window known to the connection to a
-  // window not known to the connection. In the later case |focused_window_id|
-  // is 0. As with other functions this is only called if the client did not
-  // initiate the change.
-  OnWindowFocused(uint64 focused_window_id);
-
-  OnWindowCursorChanged(uint64 window_id, ui.mojom.Cursor cursor);
-
-  // Called when the mouse cursor enters a window on this connection for the
-  // first time, providing a list of available mime types. We want to send this
-  // set of data only one time, so this isn't part of OnDragEnter(), which
-  // occurs every time the mouse enters a window.
-  OnDragDropStart(map<string, array<uint8>> drag_data);
-
-  // Called when the mouse cursor enters a window that has opted into accepting
-  // drags through SetAcceptsDrags(), providing a list of available mime types.
-  // |location_in_root| is the location relative to the embed root of |window|.
-  // |location| is the location relative to |window|.
-  // If |window| is a top-level or embed root, then |location_in_root| is the
-  // same as |location|. Callback is supplied the supported operations.
-  OnDragEnter(uint64 window,
-              uint32 key_state,
-              gfx.mojom.PointF location_in_root,
-              gfx.mojom.PointF location,
-              uint32 effect_bitmask) => (uint32 supported_op_bitmask);
-
-  // Called when the pointer moves over the window after the initial DragEnter.
-  // Returns a bitmask of the supported operations at this location. See
-  // OnDragEnter() for details on coordinates.
-  OnDragOver(uint64 window,
-             uint32 key_state,
-             gfx.mojom.PointF location_in_root,
-             gfx.mojom.PointF location,
-             uint32 effect_bitmask) => (uint32 supported_op_bitmask);
-
-  // Called when the pointer leaves a window or if the drop is canceled.
-  OnDragLeave(uint64 window);
-
-  // Called when the drop occurs on a window. Returns the action taken. See
-  // OnDragEnter() for details on coordinates.
-  OnCompleteDrop(uint64 window,
-                 uint32 key_state,
-                 gfx.mojom.PointF location_in_root,
-                 gfx.mojom.PointF location,
-                 uint32 effect_bitmask) => (uint32 action_taken);
-
-  // Called on the client that requested PerformDragDrop() to return which drag
-  // action was completed. This is called instead of OnChangeCompleted().
-  OnPerformDragDropCompleted(uint32 change_id,
-                             bool success,
-                             uint32 action_taken);
-
-  // Called after OnCompleteDrop completes for every connection which received
-  // an OnDragDropStart() message. This signals that a client can forget the
-  // |drag_data| passed in via the first message.
-  OnDragDropDone();
-
-  // Called when the topmost window under the cursor/touch changes. The client
-  // receives at most two IDs for the topmost windows. The first one is for the
-  // topmost window. The second one is optionally for the second topmost window
-  // if the first one happens to be the current event target. The second one
-  // will be used by the client when they want to ignore the event target.
-  // Each ID can be 0 when the window is not hosted by the client.
-  OnTopmostWindowChanged(array<uint64> topmost_ids);
-
-  // A change initiated from the client has completed. See description of
-  // change ids for details.
-  OnChangeCompleted(uint32 change_id, bool success);
-
-  // The WindowManager is requesting the specified window to close. If the
-  // client allows the change it should delete the window.
-  RequestClose(uint64 window_id);
-
-  // Requests the ScreenProviderObserver from the client. See
-  // ScreenProviderObserver for details.
-  GetScreenProviderObserver(associated ScreenProviderObserver& observer);
-
-  // Called to send occlusion changes to client. |occlusion_changes| contains
-  // the changed info, with window id as its key and new occlusion state as its
-  // data. See also TrackOcclusionState on WindowTree.
-  OnOcclusionStatesChanged(map<uint64, OcclusionState> occlusion_changes);
-
-  // Cancels the ongoing touch gesture recognitions and clears related gesture
-  // recognition state of the window of |window_id| in the client.
-  CleanupGestureState(uint64 window_id);
-
-  // Called when the window manager may start resizing a window by a user
-  // gesture. For example, if the user clicks on a window-resize handle this may
-  // be called. This is followed by OnWindowResizeLoopEnded() when the loop is
-  // done. This function is only called for top-levels.
-  // OnWindowResizeLoopEnded() may not be called if the window is destroyed
-  // during the loop.
-  OnWindowResizeLoopStarted(uint64 window_id);
-  OnWindowResizeLoopEnded(uint64 window_id);
-};
-
-// Mus provides this interface as a way for clients to connect and obtain a
-// WindowTree handle with a supplied WindowTreeClient handle. The
-// WindowTreeClient has no roots, use NewTopLevelWindow() to create one.
-interface WindowTreeFactory {
-  CreateWindowTree(WindowTree& tree_request, WindowTreeClient client);
-};
diff --git a/ui/aura/env.cc b/ui/aura/env.cc
index b090310d..d7b077d 100644
--- a/ui/aura/env.cc
+++ b/ui/aura/env.cc
@@ -9,7 +9,6 @@
 #include "base/memory/ptr_util.h"
 #include "base/observer_list_types.h"
 #include "components/viz/common/features.h"
-#include "services/ws/public/mojom/window_tree.mojom.h"
 #include "ui/aura/client/aura_constants.h"
 #include "ui/aura/env_input_state_controller.h"
 #include "ui/aura/env_observer.h"
diff --git a/ui/ozone/platform/drm/host/host_cursor_proxy.cc b/ui/ozone/platform/drm/host/host_cursor_proxy.cc
index 766980d..d2950b9 100644
--- a/ui/ozone/platform/drm/host/host_cursor_proxy.cc
+++ b/ui/ozone/platform/drm/host/host_cursor_proxy.cc
@@ -7,7 +7,6 @@
 #include <utility>
 
 #include "services/service_manager/public/cpp/connector.h"
-#include "services/ws/public/mojom/constants.mojom.h"
 #include "ui/ozone/public/gpu_platform_support_host.h"
 
 namespace ui {
diff --git a/ui/ozone/platform/drm/host/host_drm_device.cc b/ui/ozone/platform/drm/host/host_drm_device.cc
index 4ff514f..e4bcc07 100644
--- a/ui/ozone/platform/drm/host/host_drm_device.cc
+++ b/ui/ozone/platform/drm/host/host_drm_device.cc
@@ -13,7 +13,6 @@
 #include "base/task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "services/service_manager/public/cpp/connector.h"
-#include "services/ws/public/mojom/constants.mojom.h"
 #include "ui/display/types/display_snapshot.h"
 #include "ui/ozone/platform/drm/common/drm_util.h"
 #include "ui/ozone/platform/drm/host/drm_device_connector.h"