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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_screen_x11.h

Issue 341983008: Listen to Display reconfiguration and notify DisplayObservers on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mac_display
Patch Set: 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 | « ui/gfx/screen_mac.mm ('k') | ui/views/widget/desktop_aura/desktop_screen_x11.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_SCREEN_X11_H_ 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_SCREEN_X11_H_
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_SCREEN_X11_H_ 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_SCREEN_X11_H_
7 7
8 #include "base/observer_list.h"
9 #include "base/timer/timer.h" 8 #include "base/timer/timer.h"
10 #include "ui/events/platform/platform_event_dispatcher.h" 9 #include "ui/events/platform/platform_event_dispatcher.h"
10 #include "ui/gfx/display_change_notifier.h"
11 #include "ui/gfx/screen.h" 11 #include "ui/gfx/screen.h"
12 #include "ui/views/views_export.h" 12 #include "ui/views/views_export.h"
13 13
14 namespace gfx { 14 namespace gfx {
15 class Display; 15 class Display;
16 } 16 }
17 17
18 typedef unsigned long XID; 18 typedef unsigned long XID;
19 typedef XID Window; 19 typedef XID Window;
20 typedef struct _XDisplay Display; 20 typedef struct _XDisplay Display;
21 21
22 namespace views { 22 namespace views {
23 class DesktopScreenX11Test; 23 class DesktopScreenX11Test;
24 24
25 // Our singleton screen implementation that talks to xrandr. 25 // Our singleton screen implementation that talks to xrandr.
26 class VIEWS_EXPORT DesktopScreenX11 : public gfx::Screen, 26 class VIEWS_EXPORT DesktopScreenX11 : public gfx::Screen,
27 public ui::PlatformEventDispatcher { 27 public ui::PlatformEventDispatcher {
28 public: 28 public:
29 DesktopScreenX11(); 29 DesktopScreenX11();
30 30
31 virtual ~DesktopScreenX11(); 31 virtual ~DesktopScreenX11();
32 32
33 // Takes a set of displays and dispatches the screen change events to
34 // listeners. Exposed for testing.
35 void ProcessDisplayChange(const std::vector<gfx::Display>& displays);
36
37 // Overridden from gfx::Screen: 33 // Overridden from gfx::Screen:
38 virtual bool IsDIPEnabled() OVERRIDE; 34 virtual bool IsDIPEnabled() OVERRIDE;
39 virtual gfx::Point GetCursorScreenPoint() OVERRIDE; 35 virtual gfx::Point GetCursorScreenPoint() OVERRIDE;
40 virtual gfx::NativeWindow GetWindowUnderCursor() OVERRIDE; 36 virtual gfx::NativeWindow GetWindowUnderCursor() OVERRIDE;
41 virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) 37 virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point)
42 OVERRIDE; 38 OVERRIDE;
43 virtual int GetNumDisplays() const OVERRIDE; 39 virtual int GetNumDisplays() const OVERRIDE;
44 virtual std::vector<gfx::Display> GetAllDisplays() const OVERRIDE; 40 virtual std::vector<gfx::Display> GetAllDisplays() const OVERRIDE;
45 virtual gfx::Display GetDisplayNearestWindow( 41 virtual gfx::Display GetDisplayNearestWindow(
46 gfx::NativeView window) const OVERRIDE; 42 gfx::NativeView window) const OVERRIDE;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // decoding events regarding output add/remove. 75 // decoding events regarding output add/remove.
80 int xrandr_event_base_; 76 int xrandr_event_base_;
81 77
82 // The display objects we present to chrome. 78 // The display objects we present to chrome.
83 std::vector<gfx::Display> displays_; 79 std::vector<gfx::Display> displays_;
84 80
85 // The timer to delay configuring outputs. See also the comments in 81 // The timer to delay configuring outputs. See also the comments in
86 // Dispatch(). 82 // Dispatch().
87 scoped_ptr<base::OneShotTimer<DesktopScreenX11> > configure_timer_; 83 scoped_ptr<base::OneShotTimer<DesktopScreenX11> > configure_timer_;
88 84
89 ObserverList<gfx::DisplayObserver> observer_list_; 85 gfx::DisplayChangeNotifier change_notifier_;
90 86
91 DISALLOW_COPY_AND_ASSIGN(DesktopScreenX11); 87 DISALLOW_COPY_AND_ASSIGN(DesktopScreenX11);
92 }; 88 };
93 89
94 } // namespace views 90 } // namespace views
95 91
96 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_SCREEN_X11_H_ 92 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_SCREEN_X11_H_
OLDNEW
« no previous file with comments | « ui/gfx/screen_mac.mm ('k') | ui/views/widget/desktop_aura/desktop_screen_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698