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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/gfx/screen_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GFX_SCREEN_WIN_H_ 5 #ifndef UI_GFX_SCREEN_WIN_H_
6 #define UI_GFX_SCREEN_WIN_H_ 6 #define UI_GFX_SCREEN_WIN_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "ui/gfx/display_change_notifier.h"
9 #include "ui/gfx/gfx_export.h" 10 #include "ui/gfx/gfx_export.h"
10 #include "ui/gfx/screen.h" 11 #include "ui/gfx/screen.h"
12 #include "ui/gfx/win/singleton_hwnd.h"
11 13
12 namespace gfx { 14 namespace gfx {
13 15
14 class GFX_EXPORT ScreenWin : public gfx::Screen { 16 class GFX_EXPORT ScreenWin : public Screen,
17 public SingletonHwnd::Observer {
15 public: 18 public:
16 ScreenWin(); 19 ScreenWin();
17 virtual ~ScreenWin(); 20 virtual ~ScreenWin();
18 21
19 protected: 22 protected:
20 // Overridden from gfx::Screen: 23 // Overridden from gfx::Screen:
21 virtual bool IsDIPEnabled() OVERRIDE; 24 virtual bool IsDIPEnabled() OVERRIDE;
22 virtual gfx::Point GetCursorScreenPoint() OVERRIDE; 25 virtual gfx::Point GetCursorScreenPoint() OVERRIDE;
23 virtual gfx::NativeWindow GetWindowUnderCursor() OVERRIDE; 26 virtual gfx::NativeWindow GetWindowUnderCursor() OVERRIDE;
24 virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) 27 virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point)
25 OVERRIDE; 28 OVERRIDE;
26 virtual int GetNumDisplays() const OVERRIDE; 29 virtual int GetNumDisplays() const OVERRIDE;
27 virtual std::vector<gfx::Display> GetAllDisplays() const OVERRIDE; 30 virtual std::vector<gfx::Display> GetAllDisplays() const OVERRIDE;
28 virtual gfx::Display GetDisplayNearestWindow( 31 virtual gfx::Display GetDisplayNearestWindow(
29 gfx::NativeView window) const OVERRIDE; 32 gfx::NativeView window) const OVERRIDE;
30 virtual gfx::Display GetDisplayNearestPoint( 33 virtual gfx::Display GetDisplayNearestPoint(
31 const gfx::Point& point) const OVERRIDE; 34 const gfx::Point& point) const OVERRIDE;
32 virtual gfx::Display GetDisplayMatching( 35 virtual gfx::Display GetDisplayMatching(
33 const gfx::Rect& match_rect) const OVERRIDE; 36 const gfx::Rect& match_rect) const OVERRIDE;
34 virtual gfx::Display GetPrimaryDisplay() const OVERRIDE; 37 virtual gfx::Display GetPrimaryDisplay() const OVERRIDE;
35 virtual void AddObserver(DisplayObserver* observer) OVERRIDE; 38 virtual void AddObserver(DisplayObserver* observer) OVERRIDE;
36 virtual void RemoveObserver(DisplayObserver* observer) OVERRIDE; 39 virtual void RemoveObserver(DisplayObserver* observer) OVERRIDE;
37 40
41 // Overriden from gfx::SingletonHwnd::Observer.
42 virtual void OnWndProc(HWND hwnd,
43 UINT message,
44 WPARAM wparam,
45 LPARAM lparam) OVERRIDE;
46
38 // Returns the HWND associated with the NativeView. 47 // Returns the HWND associated with the NativeView.
39 virtual HWND GetHWNDFromNativeView(NativeView window) const; 48 virtual HWND GetHWNDFromNativeView(NativeView window) const;
40 49
41 // Returns the NativeView associated with the HWND. 50 // Returns the NativeView associated with the HWND.
42 virtual NativeWindow GetNativeWindowFromHWND(HWND hwnd) const; 51 virtual NativeWindow GetNativeWindowFromHWND(HWND hwnd) const;
43 52
44 private: 53 private:
54 // Helper implementing the DisplayObserver handling.
55 gfx::DisplayChangeNotifier change_notifier_;
56
57 // Current list of displays.
58 std::vector<gfx::Display> displays_;
59
45 DISALLOW_COPY_AND_ASSIGN(ScreenWin); 60 DISALLOW_COPY_AND_ASSIGN(ScreenWin);
46 }; 61 };
47 62
48 } // namespace gfx 63 } // namespace gfx
49 64
50 #endif // UI_GFX_SCREEN_WIN_H_ 65 #endif // UI_GFX_SCREEN_WIN_H_
OLDNEW
« 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