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

Side by Side Diff: ui/aura/monitor_change_observer_x11.cc

Issue 9958152: Consolidate win/x dispatchers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync, addressed comments Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/monitor_change_observer_x11.h ('k') | ui/aura/root_window_host_linux.h » ('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 #include "ui/aura/monitor_change_observer_x11.h" 5 #include "ui/aura/monitor_change_observer_x11.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 Env::GetInstance()->GetDispatcher())-> 48 Env::GetInstance()->GetDispatcher())->
49 WindowDispatcherCreated(x_root_window_, this); 49 WindowDispatcherCreated(x_root_window_, this);
50 } 50 }
51 51
52 MonitorChangeObserverX11::~MonitorChangeObserverX11() { 52 MonitorChangeObserverX11::~MonitorChangeObserverX11() {
53 static_cast<DispatcherLinux*>( 53 static_cast<DispatcherLinux*>(
54 Env::GetInstance()->GetDispatcher())-> 54 Env::GetInstance()->GetDispatcher())->
55 WindowDispatcherDestroying(x_root_window_); 55 WindowDispatcherDestroying(x_root_window_);
56 } 56 }
57 57
58 base::MessagePumpDispatcher::DispatchStatus 58 bool MonitorChangeObserverX11::Dispatch(const base::NativeEvent& event) {
59 MonitorChangeObserverX11::Dispatch(XEvent* event) {
60 if (event->type - xrandr_event_base_ == RRScreenChangeNotify) { 59 if (event->type - xrandr_event_base_ == RRScreenChangeNotify) {
61 NotifyMonitorChange(); 60 NotifyMonitorChange();
62 return base::MessagePumpDispatcher::EVENT_PROCESSED;
63 } 61 }
64 return base::MessagePumpDispatcher::EVENT_IGNORED; 62 return true;
65 } 63 }
66 64
67 void MonitorChangeObserverX11::NotifyMonitorChange() { 65 void MonitorChangeObserverX11::NotifyMonitorChange() {
68 if (!MonitorManager::use_fullscreen_host_window()) 66 if (!MonitorManager::use_fullscreen_host_window())
69 return; // Use the default monitor that monitor manager determined. 67 return; // Use the default monitor that monitor manager determined.
70 68
71 XRRScreenResources* screen_resources = 69 XRRScreenResources* screen_resources =
72 XRRGetScreenResources(xdisplay_, x_root_window_); 70 XRRGetScreenResources(xdisplay_, x_root_window_);
73 std::map<XID, XRRCrtcInfo*> crtc_info_map; 71 std::map<XID, XRRCrtcInfo*> crtc_info_map;
74 72
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // PowerManager lays out the outputs vertically. Sort them by Y 116 // PowerManager lays out the outputs vertically. Sort them by Y
119 // coordinates. 117 // coordinates.
120 std::sort(monitors.begin(), monitors.end(), CompareMonitorY); 118 std::sort(monitors.begin(), monitors.end(), CompareMonitorY);
121 Env::GetInstance()->monitor_manager() 119 Env::GetInstance()->monitor_manager()
122 ->OnNativeMonitorsChanged(monitors); 120 ->OnNativeMonitorsChanged(monitors);
123 STLDeleteContainerPointers(monitors.begin(), monitors.end()); 121 STLDeleteContainerPointers(monitors.begin(), monitors.end());
124 } 122 }
125 123
126 } // namespace internal 124 } // namespace internal
127 } // namespace aura 125 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/monitor_change_observer_x11.h ('k') | ui/aura/root_window_host_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698