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

Unified Diff: ui/gfx/screen_win.h

Issue 1639623003: ScreenWin Testability and Restructuring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to bdd95f1 Created 4 years, 11 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 b1488ae05bb850b9cfc4cfa762219b56d47ff5d0..db2de0098d94d95ae9a433a639e6fe1a0d1c6bc0 100644
--- a/ui/gfx/screen_win.h
+++ b/ui/gfx/screen_win.h
@@ -5,18 +5,30 @@
#ifndef UI_GFX_SCREEN_WIN_H_
#define UI_GFX_SCREEN_WIN_H_
-#include "base/compiler_specific.h"
-#include "base/gtest_prod_util.h"
+#include <vector>
+
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "ui/gfx/display_change_notifier.h"
#include "ui/gfx/gfx_export.h"
+#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/screen.h"
-#include "ui/gfx/win/singleton_hwnd_observer.h"
+#include "ui/gfx/win/display_manager_observer.h"
namespace gfx {
-class GFX_EXPORT ScreenWin : public Screen {
+class Display;
+class Point;
+class Rect;
+
+namespace win {
+
+class DisplayManager;
+class ScreenWinDisplay;
+
+} // namespace win
+
+class GFX_EXPORT ScreenWin : public Screen,
+ public gfx::win::DisplayManagerObserver {
public:
ScreenWin();
~ScreenWin() override;
@@ -28,7 +40,7 @@ class GFX_EXPORT ScreenWin : public Screen {
virtual NativeWindow GetNativeWindowFromHWND(HWND hwnd) const;
protected:
- // Overridden from gfx::Screen:
+ // gfx::Screen:
gfx::Point GetCursorScreenPoint() override;
gfx::NativeWindow GetWindowUnderCursor() override;
gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override;
@@ -41,22 +53,18 @@ class GFX_EXPORT ScreenWin : public Screen {
void AddObserver(DisplayObserver* observer) override;
void RemoveObserver(DisplayObserver* observer) override;
- private:
- FRIEND_TEST_ALL_PREFIXES(ScreenWinTest, SingleDisplay1x);
- FRIEND_TEST_ALL_PREFIXES(ScreenWinTest, SingleDisplay2x);
-
- void OnWndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
-
- static std::vector<gfx::Display> GetDisplaysForMonitorInfos(
- const std::vector<MONITORINFOEX>& monitor_infos);
+ // gfx::win::DisplayManagerObserver:
+ void OnDisplaysChanged(
+ const std::vector<gfx::win::ScreenWinDisplay> old_screen_win_displays,
+ const std::vector<gfx::win::ScreenWinDisplay> new_screen_win_displays)
+ override;
+ private:
// Helper implementing the DisplayObserver handling.
gfx::DisplayChangeNotifier change_notifier_;
- scoped_ptr<SingletonHwndObserver> singleton_hwnd_observer_;
-
- // Current list of displays.
- std::vector<gfx::Display> displays_;
+ // The DisplayManager itself manages lifetime and keeps itself alive.
+ gfx::win::DisplayManager* display_manager_;
oshima 2016/01/30 00:10:33 Please use GetInstance(), as it may refer to stale
robliao 2016/01/30 01:23:52 Done.
DISALLOW_COPY_AND_ASSIGN(ScreenWin);
};
« no previous file with comments | « ui/gfx/gfx.gyp ('k') | ui/gfx/screen_win.cc » ('j') | ui/gfx/test/display_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698