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

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: 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
« no previous file with comments | « no previous file | ui/gfx/screen_win.cc » ('j') | no next file with comments »
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..6ca5601b4750fafb071d7de8c976d15d95f95fcf 100644
--- a/ui/gfx/screen_win.h
+++ b/ui/gfx/screen_win.h
@@ -6,12 +6,15 @@
#define UI_GFX_SCREEN_WIN_H_
#include "base/compiler_specific.h"
+#include "ui/gfx/display_change_notifier.h"
#include "ui/gfx/gfx_export.h"
#include "ui/gfx/screen.h"
+#include "ui/gfx/win/singleton_hwnd.h"
namespace gfx {
-class GFX_EXPORT ScreenWin : public gfx::Screen {
+class GFX_EXPORT ScreenWin : public Screen,
+ public SingletonHwnd::Observer {
public:
ScreenWin();
virtual ~ScreenWin();
@@ -35,6 +38,12 @@ class GFX_EXPORT ScreenWin : public gfx::Screen {
virtual void AddObserver(DisplayObserver* observer) OVERRIDE;
virtual void RemoveObserver(DisplayObserver* observer) OVERRIDE;
+ // Overriden from gfx::SingletonHwnd::Observer.
+ virtual void OnWndProc(HWND hwnd,
+ UINT message,
+ WPARAM wparam,
+ LPARAM lparam) OVERRIDE;
+
// Returns the HWND associated with the NativeView.
virtual HWND GetHWNDFromNativeView(NativeView window) const;
@@ -42,6 +51,12 @@ class GFX_EXPORT ScreenWin : public gfx::Screen {
virtual NativeWindow GetNativeWindowFromHWND(HWND hwnd) const;
private:
+ // 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698