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

Unified Diff: ui/views/mus/window_manager_connection.cc

Issue 1992443002: Add Mojo IPC based input-device service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup_ddm
Patch Set: Fixes for comments. 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
Index: ui/views/mus/window_manager_connection.cc
diff --git a/ui/views/mus/window_manager_connection.cc b/ui/views/mus/window_manager_connection.cc
index f17c0aa96379af0e4f4211482041711d4505c760..a01f373cc9f40db51ba4a1d16b8fa5be244ec961 100644
--- a/ui/views/mus/window_manager_connection.cc
+++ b/ui/views/mus/window_manager_connection.cc
@@ -13,6 +13,7 @@
#include "components/mus/public/cpp/window_property.h"
#include "components/mus/public/cpp/window_tree_client.h"
#include "components/mus/public/interfaces/event_matcher.mojom.h"
+#include "components/mus/public/interfaces/input_devices/input_devices.mojom.h"
#include "components/mus/public/interfaces/window_tree.mojom.h"
#include "services/shell/public/cpp/connection.h"
#include "services/shell/public/cpp/connector.h"
@@ -114,13 +115,10 @@ WindowManagerConnection::WindowManagerConnection(
screen_.reset(new ScreenMus(this));
screen_->Init(connector);
- if (!ui::DeviceDataManager::HasInstance()) {
- // TODO(sad): We should have a DeviceDataManager implementation that talks
- // to a mojo service to learn about the input-devices on the system.
- // http://crbug.com/601981
- ui::DeviceDataManager::CreateInstance();
- created_device_data_manager_ = true;
- }
+ // Receives updates about input-devices from other another process.
+ input_device::mojom::InputDeviceServerPtr service;
+ connector->ConnectToInterface("mojo:mus", &service);
+ input_device_client_.Connect(std::move(service));
ViewsDelegate::GetInstance()->set_native_widget_factory(base::Bind(
&WindowManagerConnection::CreateNativeWidgetMus,
@@ -132,8 +130,6 @@ WindowManagerConnection::~WindowManagerConnection() {
// ~WindowTreeClient calls back to us (we're its delegate), destroy it while
// we are still valid.
client_.reset();
- if (created_device_data_manager_)
- ui::DeviceDataManager::DeleteInstance();
if (ViewsDelegate::GetInstance()) {
ViewsDelegate::GetInstance()->set_native_widget_factory(

Powered by Google App Engine
This is Rietveld 408576698