| Index: ui/aura/monitor_change_observer_x11.cc
|
| diff --git a/ui/aura/monitor_change_observer_x11.cc b/ui/aura/monitor_change_observer_x11.cc
|
| index 3187e0b4daa27d338e74b1ba908c308abd1412ec..b6e7303a23a538556b7611b5aa29e94edbaaf7bc 100644
|
| --- a/ui/aura/monitor_change_observer_x11.cc
|
| +++ b/ui/aura/monitor_change_observer_x11.cc
|
| @@ -12,11 +12,11 @@
|
| #include <X11/extensions/Xrandr.h>
|
|
|
| #include "base/message_pump_aurax11.h"
|
| -#include "ui/aura/env.h"
|
| #include "ui/aura/dispatcher_linux.h"
|
| +#include "ui/aura/env.h"
|
| #include "ui/aura/monitor_manager.h"
|
| #include "ui/compositor/dip_util.h"
|
| -#include "ui/gfx/monitor.h"
|
| +#include "ui/gfx/display.h"
|
|
|
| namespace aura {
|
| namespace internal {
|
| @@ -43,7 +43,7 @@ XRRModeInfo* FindMode(XRRScreenResources* screen_resources, XID current_mode) {
|
| return NULL;
|
| }
|
|
|
| -bool CompareMonitorY(const gfx::Monitor& lhs, const gfx::Monitor& rhs) {
|
| +bool CompareDisplayY(const gfx::Display& lhs, const gfx::Display& rhs) {
|
| return lhs.bounds_in_pixel().y() > rhs.bounds_in_pixel().y();
|
| }
|
|
|
| @@ -66,12 +66,12 @@ MonitorChangeObserverX11::~MonitorChangeObserverX11() {
|
|
|
| bool MonitorChangeObserverX11::Dispatch(const base::NativeEvent& event) {
|
| if (event->type - xrandr_event_base_ == RRScreenChangeNotify) {
|
| - NotifyMonitorChange();
|
| + NotifyDisplayChange();
|
| }
|
| return true;
|
| }
|
|
|
| -void MonitorChangeObserverX11::NotifyMonitorChange() {
|
| +void MonitorChangeObserverX11::NotifyDisplayChange() {
|
| if (!MonitorManager::use_fullscreen_host_window())
|
| return; // Use the default monitor that monitor manager determined.
|
|
|
| @@ -86,7 +86,7 @@ void MonitorChangeObserverX11::NotifyMonitorChange() {
|
| crtc_info_map[crtc_id] = crtc_info;
|
| }
|
|
|
| - std::vector<gfx::Monitor> monitors;
|
| + std::vector<gfx::Display> displays;
|
| std::set<int> y_coords;
|
| for (int o = 0; o < screen_resources->noutput; o++) {
|
| XRROutputInfo *output_info =
|
| @@ -108,7 +108,7 @@ void MonitorChangeObserverX11::NotifyMonitorChange() {
|
| if (y_coords.find(crtc_info->y) != y_coords.end())
|
| continue;
|
| // TODO(oshima): Create unique ID for the monitor.
|
| - monitors.push_back(gfx::Monitor(
|
| + displays.push_back(gfx::Display(
|
| 0,
|
| gfx::Rect(crtc_info->x, crtc_info->y, mode->width, mode->height)));
|
|
|
| @@ -118,7 +118,7 @@ void MonitorChangeObserverX11::NotifyMonitorChange() {
|
| kHighDensityDIPThreshold) {
|
| device_scale_factor = 2.0f;
|
| }
|
| - monitors.back().set_device_scale_factor(device_scale_factor);
|
| + displays.back().set_device_scale_factor(device_scale_factor);
|
| y_coords.insert(crtc_info->y);
|
| XRRFreeOutputInfo(output_info);
|
| }
|
| @@ -132,15 +132,14 @@ void MonitorChangeObserverX11::NotifyMonitorChange() {
|
|
|
| // PowerManager lays out the outputs vertically. Sort them by Y
|
| // coordinates.
|
| - std::sort(monitors.begin(), monitors.end(), CompareMonitorY);
|
| + std::sort(displays.begin(), displays.end(), CompareDisplayY);
|
| // TODO(oshima): Assisgn index as ID for now. Use unique ID.
|
| int id = 0;
|
| - for (std::vector<gfx::Monitor>::iterator iter = monitors.begin();
|
| - iter != monitors.end(); ++iter, ++id)
|
| + for (std::vector<gfx::Display>::iterator iter = displays.begin();
|
| + iter != displays.end(); ++iter, ++id)
|
| (*iter).set_id(id);
|
|
|
| - Env::GetInstance()->monitor_manager()
|
| - ->OnNativeMonitorsChanged(monitors);
|
| + Env::GetInstance()->monitor_manager()->OnNativeMonitorsChanged(displays);
|
| }
|
|
|
| } // namespace internal
|
|
|