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

Unified Diff: ui/gfx/screen_display_observer_delegate.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: plug to RWHVMac Created 6 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/gfx/screen_display_observer_delegate.h
diff --git a/ui/gfx/screen_display_observer_delegate.h b/ui/gfx/screen_display_observer_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..0fb912bcfcf9aac2ca6c250a195883bd1cce3612
--- /dev/null
+++ b/ui/gfx/screen_display_observer_delegate.h
@@ -0,0 +1,33 @@
+// 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_SCREEN_DISPLAY_OBSERVER_DELEGATE_H_
+#define UI_GFX_SCREEN_DISPLAY_OBSERVER_DELEGATE_H_
+
+#include <vector>
+
+#include "base/observer_list.h"
+#include "ui/gfx/display_observer.h"
+
+// ScreenDisplayObserverDelegate is a delegate for gfx::Screen. It helps
+// handling DisplayObserver's notification.
+class ScreenDisplayObserverDelegate {
oshima 2014/07/09 17:12:51 DisplayChangeNotifier would be better name. The na
mlamouri (slow - plz ping) 2014/07/10 12:54:34 Done.
+ public:
+ ScreenDisplayObserverDelegate();
+ ~ScreenDisplayObserverDelegate();
+
+ 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_;
+};
oshima 2014/07/09 17:12:51 DISALLOW_COPY_AND_ASSIGN
mlamouri (slow - plz ping) 2014/07/10 12:54:34 Done.
+
+#endif // UI_GFX_SCREEN_DISPLAY_OBSERVER_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698