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

Unified Diff: ui/gfx/display_change_notifier.h

Issue 341983008: Listen to Display reconfiguration and notify DisplayObservers on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mac_display
Patch Set: review comments Created 6 years, 5 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/gfx/display_change_notifier.h
diff --git a/ui/gfx/display_change_notifier.h b/ui/gfx/display_change_notifier.h
new file mode 100644
index 0000000000000000000000000000000000000000..bb775a113046fed49f6985e29eb14195397c1f88
--- /dev/null
+++ b/ui/gfx/display_change_notifier.h
@@ -0,0 +1,36 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_GFX_DISPLAY_CHANGE_NOTIFIER_H_
+#define UI_GFX_DISPLAY_CHANGE_NOTIFIER_H_
+
+#include <vector>
+
+#include "base/observer_list.h"
+#include "ui/gfx/display_observer.h"
+
+// DisplayChangeNotifier is a class implementing the handling of DisplayObserver
+// notification for gfx::Screen.
+class DisplayChangeNotifier {
+ public:
+ DisplayChangeNotifier();
+ ~DisplayChangeNotifier();
+
+ void AddObserver(gfx::DisplayObserver* observer);
+
+ void RemoveObserver(gfx::DisplayObserver* observer);
+
+ void NotifyDisplaysChanged(const std::vector<gfx::Display>& old_displays,
+ const std::vector<gfx::Display>& new_displays);
+
+ private:
+ // The observers that need to be notified when a display is modified, added
+ // or removed.
+ ObserverList<gfx::DisplayObserver> observer_list_;
+
+ DISALLOW_COPY_AND_ASSIGN(DisplayChangeNotifier);
+};
+
+#endif // UI_GFX_DISPLAY_CHANGE_NOTIFIER_H_
+

Powered by Google App Engine
This is Rietveld 408576698