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

Unified Diff: ui/ozone/platform/dri/screen_manager.h

Issue 844343002: [Ozone-DRI] Add display observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update GYP Created 5 years, 11 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/screen_manager.h
diff --git a/ui/ozone/platform/dri/screen_manager.h b/ui/ozone/platform/dri/screen_manager.h
index 6b955165713e44f61702c3b1b648b08ca0bddefd..5eaae1aafa6a535e89c5980c7a478060e93aa535 100644
--- a/ui/ozone/platform/dri/screen_manager.h
+++ b/ui/ozone/platform/dri/screen_manager.h
@@ -7,7 +7,8 @@
#include "base/macros.h"
#include "base/memory/scoped_vector.h"
-#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
+#include "ui/ozone/platform/dri/display_change_observer.h"
#include "ui/ozone/platform/dri/hardware_display_controller.h"
typedef struct _drmModeModeInfo drmModeModeInfo;
@@ -49,13 +50,12 @@ class ScreenManager {
bool DisableDisplayController(uint32_t crtc);
// Returns a reference to the display controller configured to display within
- // |bounds|.
- // This returns a weak reference since the display controller may be destroyed
- // at any point in time, but the changes are propagated to the compositor much
- // later (Compositor owns SurfaceOzone*, which is responsible for updating the
- // display surface).
- base::WeakPtr<HardwareDisplayController> GetDisplayController(
- const gfx::Rect& bounds);
+ // |bounds|. If the caller caches the controller it must also register as an
+ // observer to be notified when the controller goes out of scope.
+ HardwareDisplayController* GetDisplayController(const gfx::Rect& bounds);
+
+ void AddObserver(DisplayChangeObserver* observer);
+ void RemoveObserver(DisplayChangeObserver* observer);
// On non CrOS builds there is no display configurator to look-up available
// displays and initialize the HDCs. In such cases this is called internally
@@ -92,6 +92,8 @@ class ScreenManager {
// List of display controllers (active and disabled).
HardwareDisplayControllers controllers_;
+ ObserverList<DisplayChangeObserver> observers_;
+
DISALLOW_COPY_AND_ASSIGN(ScreenManager);
};

Powered by Google App Engine
This is Rietveld 408576698