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/gfx/screen_win.h

Issue 1092183005: Fix Up SingletonHwnd Observer Lifetime Issues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed WndProc null guard Created 5 years, 8 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_win.h
diff --git a/ui/gfx/screen_win.h b/ui/gfx/screen_win.h
index 60dd39dbdfb98b972581de934e147090113fa2ff..c2bd3c0c3499e335d45707e9be4216678ac2caf8 100644
--- a/ui/gfx/screen_win.h
+++ b/ui/gfx/screen_win.h
@@ -6,15 +6,15 @@
#define UI_GFX_SCREEN_WIN_H_
#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.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"
+#include "ui/gfx/win/singleton_hwnd_observer.h"
namespace gfx {
-class GFX_EXPORT ScreenWin : public Screen,
- public SingletonHwnd::Observer {
+class GFX_EXPORT ScreenWin : public Screen {
public:
ScreenWin();
~ScreenWin() override;
@@ -33,12 +33,6 @@ class GFX_EXPORT ScreenWin : public Screen,
void AddObserver(DisplayObserver* observer) override;
void RemoveObserver(DisplayObserver* observer) override;
- // Overriden from gfx::SingletonHwnd::Observer.
- void OnWndProc(HWND hwnd,
- UINT message,
- WPARAM wparam,
- LPARAM lparam) override;
-
// Returns the HWND associated with the NativeView.
virtual HWND GetHWNDFromNativeView(NativeView window) const;
@@ -46,9 +40,13 @@ class GFX_EXPORT ScreenWin : public Screen,
virtual NativeWindow GetNativeWindowFromHWND(HWND hwnd) const;
private:
+ void OnDisplayChange(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
+
// Helper implementing the DisplayObserver handling.
gfx::DisplayChangeNotifier change_notifier_;
+ scoped_ptr<SingletonHwndObserver> singleton_hwnd_observer_;
+
// Current list of displays.
std::vector<gfx::Display> displays_;

Powered by Google App Engine
This is Rietveld 408576698