Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Unified Diff: components/mus/input_devices/input_device_server.cc

Issue 2058853002: Enable InputDeviceServer/InputDeviceClient in mash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo_device
Patch Set: Check for DDM existence. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/input_devices/input_device_server.h ('k') | components/mus/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/input_devices/input_device_server.cc
diff --git a/components/mus/input_devices/input_device_server.cc b/components/mus/input_devices/input_device_server.cc
index df0fd6c123428df2dda0f3fca9170f34b25b056e..3514eb3566951bf5fad79cf94174182367528903 100644
--- a/components/mus/input_devices/input_device_server.cc
+++ b/components/mus/input_devices/input_device_server.cc
@@ -23,13 +23,17 @@ InputDeviceServer::~InputDeviceServer() {
}
void InputDeviceServer::RegisterAsObserver() {
- if (!manager_) {
+ if (!manager_ && ui::DeviceDataManager::HasInstance()) {
manager_ = ui::DeviceDataManager::GetInstance();
manager_->AddObserver(this);
}
}
-void InputDeviceServer::RegisterInterface(shell::Connection* connection) {
+bool InputDeviceServer::IsRegisteredAsObserver() const {
+ return manager_ != nullptr;
+}
+
+void InputDeviceServer::AddInterface(shell::Connection* connection) {
DCHECK(manager_);
connection->AddInterface<mojom::InputDeviceServer>(this);
}
« no previous file with comments | « components/mus/input_devices/input_device_server.h ('k') | components/mus/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698