Commit 7750b1da authored by Mike Wasserman's avatar Mike Wasserman Committed by Commit Bot

ws: Enable the Window Service clipboard backend for mojo apps

Have ws2::WindowService own a ClipboardImpl, like ws::Service.
Enables copy/paste within the ksv app, but not to/from ash/chrome.
(run ksv app via --keyboard-shortcut-viewer-app, press Ctrl+Alt+/).

TODO: Support copy-paste between mojo apps and Chrome/Ash.

Bug: 839591
Change-Id: I02b05cb9f830b0053dc0f1ad9e8e702505ad10a4
Reviewed-on: https://chromium-review.googlesource.com/1073572
Commit-Queue: Michael Wasserman <msw@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561923}
parent cd0313cc
......@@ -54,6 +54,7 @@ component("lib") {
"//components/discardable_memory/public/interfaces",
"//components/viz/host",
"//services/service_manager/public/cpp",
"//services/ui/clipboard:lib",
"//services/ui/common:mus_common",
"//services/ui/ime:lib",
"//services/ui/input_devices",
......
......@@ -101,8 +101,9 @@ void WindowService::OnBindInterface(
}
void WindowService::BindClipboardRequest(mojom::ClipboardRequest request) {
// TODO: https://crbug.com/839591.
NOTIMPLEMENTED();
if (!clipboard_)
clipboard_ = std::make_unique<clipboard::ClipboardImpl>();
clipboard_->AddBinding(std::move(request));
}
void WindowService::BindScreenProviderRequest(
......
......@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "services/service_manager/public/cpp/binder_registry.h"
#include "services/service_manager/public/cpp/service.h"
#include "services/ui/clipboard/clipboard_impl.h"
#include "services/ui/ime/ime_driver_bridge.h"
#include "services/ui/ime/ime_registrar_impl.h"
#include "services/ui/input_devices/input_device_server.h"
......@@ -28,6 +29,10 @@ class FocusClient;
}
}
namespace clipboard {
class ClipboardImpl;
}
namespace gfx {
class Insets;
}
......@@ -112,6 +117,8 @@ class COMPONENT_EXPORT(WINDOW_SERVICE) WindowService
// Provides info to InputDeviceClient users, via InputDeviceManager.
ui::InputDeviceServer input_device_server_;
std::unique_ptr<clipboard::ClipboardImpl> clipboard_;
// Id for the next WindowServiceClient.
ClientSpecificId next_client_id_ = kWindowServerClientId + 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment