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

Unified Diff: ui/ozone/platform/dri/chromeos/native_display_delegate_dri.cc

Issue 250793005: Refactor Udev device support in Ozone and add a DRM hotplug monitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 8 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/ozone/platform/dri/chromeos/native_display_delegate_dri.cc
diff --git a/ui/ozone/platform/dri/chromeos/native_display_delegate_dri.cc b/ui/ozone/platform/dri/chromeos/native_display_delegate_dri.cc
index cb73a964446b288fefd75df9b3dc054984856a58..ec9b76517cf8e6b56c8306b688a5a95b73703e94 100644
--- a/ui/ozone/platform/dri/chromeos/native_display_delegate_dri.cc
+++ b/ui/ozone/platform/dri/chromeos/native_display_delegate_dri.cc
@@ -4,6 +4,10 @@
#include "ui/ozone/platform/dri/chromeos/native_display_delegate_dri.h"
+#include "base/bind.h"
+#include "ui/display/types/chromeos/native_display_observer.h"
+#include "ui/events/ozone/device/device_event.h"
+#include "ui/events/ozone/device/device_manager.h"
#include "ui/ozone/platform/dri/chromeos/display_mode_dri.h"
#include "ui/ozone/platform/dri/chromeos/display_snapshot_dri.h"
#include "ui/ozone/platform/dri/dri_surface_factory.h"
@@ -17,10 +21,13 @@ const size_t kMaxDisplayCount = 2;
} // namespace
NativeDisplayDelegateDri::NativeDisplayDelegateDri(
- DriSurfaceFactory* surface_factory)
- : surface_factory_(surface_factory) {}
+ DriSurfaceFactory* surface_factory, DeviceManager* device_manager)
+ : surface_factory_(surface_factory),
+ device_manager_(device_manager) {}
-NativeDisplayDelegateDri::~NativeDisplayDelegateDri() {}
+NativeDisplayDelegateDri::~NativeDisplayDelegateDri() {
+ device_manager_->RemoveObserver(this);
+}
void NativeDisplayDelegateDri::Initialize() {
gfx::SurfaceFactoryOzone::HardwareState state =
@@ -28,6 +35,8 @@ void NativeDisplayDelegateDri::Initialize() {
CHECK_EQ(gfx::SurfaceFactoryOzone::INITIALIZED, state)
<< "Failed to initialize hardware";
+
+ device_manager_->AddObserver(this);
}
void NativeDisplayDelegateDri::GrabServer() {}
@@ -154,4 +163,12 @@ void NativeDisplayDelegateDri::RemoveObserver(NativeDisplayObserver* observer) {
observers_.RemoveObserver(observer);
}
+void NativeDisplayDelegateDri::OnDeviceEvent(const DeviceEvent& event) {
+ if (event.device_type() != DeviceEvent::DISPLAY)
+ return;
+
+ if (event.action_type() == DeviceEvent::CHANGE)
+ NOTIMPLEMENTED();
+}
+
} // namespace ui
« no previous file with comments | « ui/ozone/platform/dri/chromeos/native_display_delegate_dri.h ('k') | ui/ozone/platform/dri/ozone_platform_dri.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698