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

Unified Diff: ui/gfx/screen_win.h

Issue 401313003: ScreenWin notifies DisplayObserver's when displays changed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | ui/gfx/screen_win.cc » ('j') | ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/screen_win.h
diff --git a/ui/gfx/screen_win.h b/ui/gfx/screen_win.h
index 7b1ea4c7bcc6021ae0f00e9a29b529cc4545ed03..951416b32bb803069a56a8c5b9efc51e13b01b98 100644
--- a/ui/gfx/screen_win.h
+++ b/ui/gfx/screen_win.h
@@ -6,6 +6,8 @@
#define UI_GFX_SCREEN_WIN_H_
#include "base/compiler_specific.h"
+#include "base/timer/timer.h"
+#include "ui/gfx/display_change_notifier.h"
#include "ui/gfx/gfx_export.h"
#include "ui/gfx/screen.h"
@@ -16,6 +18,8 @@ class GFX_EXPORT ScreenWin : public gfx::Screen {
ScreenWin();
virtual ~ScreenWin();
+ void OnDisplayChanged();
+
protected:
// Overridden from gfx::Screen:
virtual bool IsDIPEnabled() OVERRIDE;
@@ -42,6 +46,22 @@ class GFX_EXPORT ScreenWin : public gfx::Screen {
virtual NativeWindow GetNativeWindowFromHWND(HWND hwnd) const;
private:
+ // Return the list of active displays.
+ std::vector<gfx::Display> BuildDisplays() const;
+
+ // Called when |configure_timer_| fires.
+ void ConfigureTimerFired();
+
+ // The timer to delay notifying DisplayObserver's when OnDisplayChanged() is
+ // called. See comment in ::OnDisplayChanged().
+ scoped_ptr<base::OneShotTimer<ScreenWin> > configure_timer_;
+
+ // Helper implementing the DisplayObserver handling.
+ gfx::DisplayChangeNotifier change_notifier_;
+
+ // Current list of displays.
+ std::vector<gfx::Display> displays_;
+
DISALLOW_COPY_AND_ASSIGN(ScreenWin);
};
« no previous file with comments | « no previous file | ui/gfx/screen_win.cc » ('j') | ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698