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

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: 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..91ccf9de53011fea600edb0782abc1d38a0792ed 100644
--- a/ui/gfx/screen_win.h
+++ b/ui/gfx/screen_win.h
@@ -13,8 +13,7 @@
namespace gfx {
-class GFX_EXPORT ScreenWin : public Screen,
- public SingletonHwnd::Observer {
+class GFX_EXPORT ScreenWin : public Screen {
public:
ScreenWin();
~ScreenWin() override;
@@ -33,12 +32,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 +39,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_;
+ SingletonHwnd::Observer singletonHwndObserver_;
+
// Current list of displays.
std::vector<gfx::Display> displays_;

Powered by Google App Engine
This is Rietveld 408576698