summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-23 00:00:22 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-23 00:00:22 +0000
commit4a7e43e76fb9ff1ae2c78ed62ee802e5c855aa56 (patch)
tree1b77d018b8faba9287f830c8230ae37ba9c7d062 /ui
parent407a34a0044b8ae31051e2276ffec438d6712ace (diff)
downloadchromium_src-4a7e43e76fb9ff1ae2c78ed62ee802e5c855aa56.zip
chromium_src-4a7e43e76fb9ff1ae2c78ed62ee802e5c855aa56.tar.gz
chromium_src-4a7e43e76fb9ff1ae2c78ed62ee802e5c855aa56.tar.bz2
Revert r128330 "* MonitorChangeObserverX11 that listen to Xrandr events and update monitor configurations."
TBR=ben@chromium.org BUG=115510 TEST=none Review URL: https://chromiumcodereview.appspot.com/9839032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128346 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/aura/aura.gyp9
-rw-r--r--ui/aura/dispatcher_linux.cc7
-rw-r--r--ui/aura/env.cc10
-rw-r--r--ui/aura/env.h11
-rw-r--r--ui/aura/monitor_change_observer_x11.cc117
-rw-r--r--ui/aura/monitor_change_observer_x11.h44
-rw-r--r--ui/aura/monitor_manager.cc10
-rw-r--r--ui/aura/monitor_manager.h15
-rw-r--r--ui/aura/root_window.cc4
-rw-r--r--ui/aura/root_window.h3
-rw-r--r--ui/aura/root_window_host.h3
-rw-r--r--ui/aura/root_window_host_linux.cc38
-rw-r--r--ui/aura/root_window_host_linux.h4
-rw-r--r--ui/aura/root_window_host_win.cc8
-rw-r--r--ui/aura/root_window_host_win.h1
-rw-r--r--ui/aura/single_monitor_manager.cc9
-rw-r--r--ui/aura/single_monitor_manager.h3
17 files changed, 26 insertions, 270 deletions
diff --git a/ui/aura/aura.gyp b/ui/aura/aura.gyp
index 89aea94..e46a883 100644
--- a/ui/aura/aura.gyp
+++ b/ui/aura/aura.gyp
@@ -75,8 +75,6 @@
'layout_manager.h',
'monitor.cc',
'monitor.h',
- 'monitor_change_observer_x11.cc',
- 'monitor_change_observer_x11.h',
'monitor_manager.cc',
'monitor_manager.h',
'single_monitor_manager.h',
@@ -108,13 +106,6 @@
['exclude', 'client/dispatcher_client.h'],
],
}],
- ['OS=="linux"', {
- 'link_settings': {
- 'libraries': [
- '-lXrandr',
- ],
- },
- }],
],
},
{
diff --git a/ui/aura/dispatcher_linux.cc b/ui/aura/dispatcher_linux.cc
index 8fbf7f4..9603d11 100644
--- a/ui/aura/dispatcher_linux.cc
+++ b/ui/aura/dispatcher_linux.cc
@@ -23,15 +23,12 @@ void DispatcherLinux::RootWindowHostCreated(::Window window,
::Window root,
RootWindowHostLinux* host) {
hosts_.insert(std::make_pair(window, host));
- // Only the 1st root window listens to the root window.
- if (hosts_.find(root) == hosts_.end())
- hosts_.insert(std::make_pair(root, host));
+ hosts_.insert(std::make_pair(root, host));
}
void DispatcherLinux::RootWindowHostDestroying(::Window window, ::Window root) {
- if (hosts_[window] == hosts_[root])
- hosts_.erase(root);
hosts_.erase(window);
+ hosts_.erase(root);
}
base::MessagePumpDispatcher::DispatchStatus DispatcherLinux::Dispatch(
diff --git a/ui/aura/env.cc b/ui/aura/env.cc
index 32ead2b..0e9222c 100644
--- a/ui/aura/env.cc
+++ b/ui/aura/env.cc
@@ -9,10 +9,6 @@
#include "ui/aura/window.h"
#include "ui/gfx/compositor/compositor.h"
-#if defined(USE_X11)
-#include "ui/aura/monitor_change_observer_x11.h"
-#endif
-
namespace aura {
// static
@@ -24,11 +20,9 @@ Env* Env::instance_ = NULL;
Env::Env()
: mouse_button_flags_(0),
stacking_client_(NULL),
- monitor_manager_(new internal::SingleMonitorManager)
-#if defined(USE_X11)
- , monitor_change_observer_(new MonitorChangeObserverX11())
-#endif
+ monitor_manager_(NULL)
{
+ SetMonitorManager(new internal::SingleMonitorManager());
#if !defined(OS_MACOSX)
dispatcher_.reset(CreateDispatcher());
#endif
diff --git a/ui/aura/env.h b/ui/aura/env.h
index 4089bff..5f6ff6a 100644
--- a/ui/aura/env.h
+++ b/ui/aura/env.h
@@ -15,7 +15,6 @@
namespace aura {
class EnvObserver;
-class MonitorChangeObserverX11;
class MonitorManager;
class Window;
@@ -52,12 +51,6 @@ class AURA_EXPORT Env {
stacking_client_ = stacking_client;
}
-#if defined(USE_X11)
- MonitorChangeObserverX11* monitor_change_observer() {
- return monitor_change_observer_.get();
- }
-#endif
-
// Gets/sets MonitorManager. The MonitorManager's ownership is
// transfered.
MonitorManager* monitor_manager() { return monitor_manager_.get(); }
@@ -87,10 +80,6 @@ class AURA_EXPORT Env {
client::StackingClient* stacking_client_;
scoped_ptr<MonitorManager> monitor_manager_;
-#if defined(USE_X11)
- scoped_ptr<MonitorChangeObserverX11> monitor_change_observer_;
-#endif
-
DISALLOW_COPY_AND_ASSIGN(Env);
};
diff --git a/ui/aura/monitor_change_observer_x11.cc b/ui/aura/monitor_change_observer_x11.cc
deleted file mode 100644
index 3dc0716..0000000
--- a/ui/aura/monitor_change_observer_x11.cc
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/aura/monitor_change_observer_x11.h"
-
-#include <algorithm>
-#include <map>
-#include <set>
-#include <vector>
-
-#include <X11/extensions/Xrandr.h>
-
-#include "base/message_pump_x.h"
-#include "base/stl_util.h"
-#include "ui/aura/env.h"
-#include "ui/aura/monitor.h"
-#include "ui/aura/monitor_manager.h"
-
-namespace aura {
-namespace {
-XRRModeInfo* FindMode(XRRScreenResources* screen_resources, XID current_mode) {
- for (int m = 0; m < screen_resources->nmode; m++) {
- XRRModeInfo *mode = &screen_resources->modes[m];
- if (mode->id == current_mode)
- return mode;
- }
- return NULL;
-}
-
-bool CompareMonitorY(const Monitor* lhs, const Monitor* rhs) {
- return lhs->bounds().y() < rhs->bounds().y();
-}
-
-} // namespace internal
-
-MonitorChangeObserverX11::MonitorChangeObserverX11()
- : xdisplay_(base::MessagePumpX::GetDefaultXDisplay()),
- x_root_window_(DefaultRootWindow(xdisplay_)),
- xrandr_event_base_(0) {
- XRRSelectInput(xdisplay_, x_root_window_, RRScreenChangeNotifyMask);
- int error_base_ignored;
- XRRQueryExtension(xdisplay_, &xrandr_event_base_, &error_base_ignored);
- NotifyMonitorChange();
-}
-
-MonitorChangeObserverX11::~MonitorChangeObserverX11() {
-}
-
-bool MonitorChangeObserverX11::Dispatch(const XEvent* event) {
- if (event->type - xrandr_event_base_ == RRScreenChangeNotify) {
- NotifyMonitorChange();
- return true;
- }
- return false;
-}
-
-void MonitorChangeObserverX11::NotifyMonitorChange() {
- if (!MonitorManager::use_fullscreen_host_window())
- return; // Use the default monitor that monitor manager determined.
-
- XRRScreenResources* screen_resources =
- XRRGetScreenResources(xdisplay_, x_root_window_);
- std::map<XID, XRRCrtcInfo*> crtc_info_map;
-
- for (int c = 0; c < screen_resources->ncrtc; c++) {
- XID crtc_id = screen_resources->crtcs[c];
- XRRCrtcInfo *crtc_info =
- XRRGetCrtcInfo(xdisplay_, screen_resources, crtc_id);
- crtc_info_map[crtc_id] = crtc_info;
- }
-
- std::vector<const Monitor*> monitors;
- std::set<int> y_coords;
- for (int o = 0; o < screen_resources->noutput; o++) {
- XRROutputInfo *output_info =
- XRRGetOutputInfo(xdisplay_,
- screen_resources,
- screen_resources->outputs[o]);
- if (output_info->connection != RR_Connected) {
- XRRFreeOutputInfo(output_info);
- continue;
- }
- XRRCrtcInfo* crtc_info = crtc_info_map[output_info->crtc];
- if (!crtc_info) {
- LOG(WARNING) << "Crtc not found for output";
- continue;
- }
- XRRModeInfo* mode = FindMode(screen_resources, crtc_info->mode);
- CHECK(mode);
- // Mirrored monitors have the same y coordinates.
- if (y_coords.find(crtc_info->y) != y_coords.end())
- continue;
- Monitor* monitor = new Monitor;
- monitor->set_bounds(gfx::Rect(crtc_info->x, crtc_info->y,
- mode->width, mode->height));
- monitors.push_back(monitor);
- y_coords.insert(crtc_info->y);
- XRRFreeOutputInfo(output_info);
- }
-
- // Free all allocated resources.
- for (std::map<XID, XRRCrtcInfo*>::const_iterator iter = crtc_info_map.begin();
- iter != crtc_info_map.end(); ++iter) {
- XRRFreeCrtcInfo(iter->second);
- }
- XRRFreeScreenResources(screen_resources);
-
- // PowerManager lays out the outputs vertically. Sort them by Y
- // coordinates.
- std::sort(monitors.begin(), monitors.end(), CompareMonitorY);
- aura::Env::GetInstance()->monitor_manager()
- ->OnNativeMonitorsChanged(monitors);
- STLDeleteContainerPointers(monitors.begin(), monitors.end());
-}
-
-} // namespace aura
diff --git a/ui/aura/monitor_change_observer_x11.h b/ui/aura/monitor_change_observer_x11.h
deleted file mode 100644
index 1c4a323..0000000
--- a/ui/aura/monitor_change_observer_x11.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef UI_AURA_MONITOR_CHANGE_OBSERVER_H
-#define UI_AURA_MONITOR_CHANGE_OBSERVER_H
-#pragma once
-
-#include <X11/Xlib.h>
-
-// Xlib.h defines RootWindow.
-#undef RootWindow
-
-#include "base/basictypes.h"
-#include "ui/aura/aura_export.h"
-
-namespace aura {
-
-// An object that observes changes in monitor configuration and
-// update MonitorManagers.
-class AURA_EXPORT MonitorChangeObserverX11 {
- public:
- MonitorChangeObserverX11();
- ~MonitorChangeObserverX11();
-
- bool Dispatch(const XEvent* event);
-
- // Reads monitor configurations from the system and notifies
- // |monitor_manager_| about the change.
- void NotifyMonitorChange();
-
- private:
- Display* xdisplay_;
-
- ::Window x_root_window_;
-
- int xrandr_event_base_;
-
- DISALLOW_COPY_AND_ASSIGN(MonitorChangeObserverX11);
-};
-
-} // namespace aura
-
-#endif // UI_AURA_MONITOR_CHANGE_OBSERVER_H
diff --git a/ui/aura/monitor_manager.cc b/ui/aura/monitor_manager.cc
index c5f8d6a..bde77bd 100644
--- a/ui/aura/monitor_manager.cc
+++ b/ui/aura/monitor_manager.cc
@@ -66,14 +66,4 @@ void MonitorManager::NotifyBoundsChanged(const Monitor* monitor) {
OnMonitorBoundsChanged(monitor));
}
-void MonitorManager::NotifyMonitorAdded(Monitor* monitor) {
- FOR_EACH_OBSERVER(MonitorObserver, observers_,
- OnMonitorAdded(monitor));
-}
-
-void MonitorManager::NotifyMonitorRemoved(const Monitor* monitor) {
- FOR_EACH_OBSERVER(MonitorObserver, observers_,
- OnMonitorRemoved(monitor));
-}
-
} // namespace aura
diff --git a/ui/aura/monitor_manager.h b/ui/aura/monitor_manager.h
index 9bbd028..77ad274 100644
--- a/ui/aura/monitor_manager.h
+++ b/ui/aura/monitor_manager.h
@@ -7,7 +7,6 @@
#pragma once
#include <string>
-#include <vector>
#include "base/basictypes.h"
#include "base/observer_list.h"
@@ -28,8 +27,6 @@ class Window;
class MonitorObserver {
public:
virtual void OnMonitorBoundsChanged(const Monitor* monitor) = 0;
- virtual void OnMonitorAdded(Monitor* new_monitor) = 0;
- virtual void OnMonitorRemoved(const Monitor* old_monitor) = 0;
};
// MonitorManager creates, deletes and updates Monitor objects when
@@ -62,11 +59,9 @@ class AURA_EXPORT MonitorManager {
void AddObserver(MonitorObserver* observer);
void RemoveObserver(MonitorObserver* observer);
- // Called when monitor configuration has changed. The new monitor
- // configurations is passed as a vector of Monitor object, which
- // contains each monitor's new infomration.
- virtual void OnNativeMonitorsChanged(
- const std::vector<const Monitor*>& monitors) = 0;
+ // Called when native window's monitor size has changed.
+ // TODO(oshima): multiple monitor support.
+ virtual void OnNativeMonitorResized(const gfx::Size& size) = 0;
// Create a root window for given |monitor|.
virtual RootWindow* CreateRootWindowForMonitor(Monitor* monitor) = 0;
@@ -80,7 +75,7 @@ class AURA_EXPORT MonitorManager {
virtual const Monitor* GetMonitorNearestPoint(
const gfx::Point& point) const = 0;
- // Returns the monitor at |index|. The monitor at 0 is considered
+ // Returns the monitor at |index|. The monitor at 0 is consiered
// "primary".
virtual Monitor* GetMonitorAt(size_t index) = 0;
@@ -89,8 +84,6 @@ class AURA_EXPORT MonitorManager {
protected:
// Calls observers' OnMonitorBoundsChanged methods.
void NotifyBoundsChanged(const Monitor* monitor);
- void NotifyMonitorAdded(Monitor* monitor);
- void NotifyMonitorRemoved(const Monitor* monitor);
private:
// If set before the RootWindow is created, the host window will cover the
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 12ee747..1e8a6b5 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -398,10 +398,6 @@ void RootWindow::ReleaseMouseMoves() {
}
}
-void RootWindow::SetFocusWhenShown(bool focused) {
- host_->SetFocusWhenShown(focused);
-}
-
////////////////////////////////////////////////////////////////////////////////
// RootWindow, Window overrides:
diff --git a/ui/aura/root_window.h b/ui/aura/root_window.h
index eed29f4..43d1fc8 100644
--- a/ui/aura/root_window.h
+++ b/ui/aura/root_window.h
@@ -189,9 +189,6 @@ class AURA_EXPORT RootWindow : public ui::CompositorDelegate,
void HoldMouseMoves();
void ReleaseMouseMoves();
- // Sets if the window should be focused when shown.
- void SetFocusWhenShown(bool focus_when_shown);
-
// Overridden from Window:
virtual RootWindow* GetRootWindow() OVERRIDE;
virtual const RootWindow* GetRootWindow() const OVERRIDE;
diff --git a/ui/aura/root_window_host.h b/ui/aura/root_window_host.h
index 4ab1830..2eb29b9 100644
--- a/ui/aura/root_window_host.h
+++ b/ui/aura/root_window_host.h
@@ -79,9 +79,6 @@ class RootWindowHost {
// Moves the cursor to the specified location relative to the root window.
virtual void MoveCursorTo(const gfx::Point& location) = 0;
- // Sets if the window should be focused when shown.
- virtual void SetFocusWhenShown(bool focus_when_shown) = 0;
-
// Posts |native_event| to the platform's event queue.
#if !defined(OS_MACOSX)
virtual void PostNativeEvent(const base::NativeEvent& native_event) = 0;
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc
index aa528b9..8fa1cec 100644
--- a/ui/aura/root_window_host_linux.cc
+++ b/ui/aura/root_window_host_linux.cc
@@ -6,17 +6,13 @@
#include <X11/cursorfont.h>
#include <X11/extensions/XInput2.h>
-#include <X11/extensions/Xrandr.h>
#include <algorithm>
#include "base/message_pump_x.h"
-#include "base/stl_util.h"
#include "ui/aura/cursor.h"
#include "ui/aura/dispatcher_linux.h"
#include "ui/aura/env.h"
#include "ui/aura/event.h"
-#include "ui/aura/monitor.h"
-#include "ui/aura/monitor_change_observer_x11.h"
#include "ui/aura/monitor_manager.h"
#include "ui/aura/root_window.h"
#include "ui/base/keycodes/keyboard_codes.h"
@@ -280,8 +276,7 @@ RootWindowHostLinux::RootWindowHostLinux(const gfx::Rect& bounds)
x_root_window_(DefaultRootWindow(xdisplay_)),
current_cursor_(aura::kCursorNull),
cursor_shown_(true),
- bounds_(bounds),
- focus_when_shown_(false) {
+ bounds_(bounds) {
XSetWindowAttributes swa;
memset(&swa, 0, sizeof(swa));
swa.background_pixmap = None;
@@ -304,6 +299,7 @@ RootWindowHostLinux::RootWindowHostLinux(const gfx::Rect& bounds)
StructureNotifyMask | PropertyChangeMask |
PointerMotionMask;
XSelectInput(xdisplay_, xwindow_, event_mask);
+ XSelectInput(xdisplay_, x_root_window_, StructureNotifyMask);
XFlush(xdisplay_);
if (base::MessagePumpForUI::HasXInput2())
@@ -365,6 +361,13 @@ base::MessagePumpDispatcher::DispatchStatus RootWindowHostLinux::Dispatch(
root_window_->SetCapture(NULL);
break;
case ConfigureNotify: {
+ if (xev->xconfigure.window == x_root_window_) {
+ Env::GetInstance()->monitor_manager()->OnNativeMonitorResized(
+ gfx::Size(xev->xconfigure.width, xev->xconfigure.height));
+ handled = true;
+ break;
+ }
+
DCHECK_EQ(xwindow_, xev->xconfigure.window);
DCHECK_EQ(xwindow_, xev->xconfigure.event);
@@ -438,7 +441,7 @@ base::MessagePumpDispatcher::DispatchStatus RootWindowHostLinux::Dispatch(
case MapNotify: {
// If there's no window manager running, we need to assign the X input
// focus to our host window.
- if (!IsWindowManagerPresent() && focus_when_shown_)
+ if (!IsWindowManagerPresent())
XSetInputFocus(xdisplay_, xwindow_, RevertToNone, CurrentTime);
handled = true;
break;
@@ -480,12 +483,6 @@ base::MessagePumpDispatcher::DispatchStatus RootWindowHostLinux::Dispatch(
handled = root_window_->DispatchMouseEvent(&mouseev);
break;
}
- default: {
- // TODO(oshima): We probably should change DispatcherLinux so
- // that it can directly dispatch the event to montor change
- // observer.
- Env::GetInstance()->monitor_change_observer()->Dispatch(xev);
- }
}
return handled ? base::MessagePumpDispatcher::EVENT_PROCESSED :
base::MessagePumpDispatcher::EVENT_IGNORED;
@@ -513,10 +510,8 @@ gfx::Rect RootWindowHostLinux::GetBounds() const {
void RootWindowHostLinux::SetBounds(const gfx::Rect& bounds) {
bool size_changed = bounds_.size() != bounds.size();
- if (bounds == bounds_) {
- root_window_->SchedulePaintInRect(root_window_->bounds());
+ if (bounds == bounds_)
return;
- }
if (bounds.size() != bounds_.size())
XResizeWindow(xdisplay_, xwindow_, bounds.width(), bounds.height());
if (bounds.origin() != bounds_.origin())
@@ -598,17 +593,6 @@ void RootWindowHostLinux::MoveCursorTo(const gfx::Point& location) {
location.y());
}
-void RootWindowHostLinux::SetFocusWhenShown(bool focus_when_shown) {
- static const char* k_NET_WM_USER_TIME = "_NET_WM_USER_TIME";
- focus_when_shown_ = focus_when_shown;
- if (IsWindowManagerPresent() && !focus_when_shown_) {
- ui::SetIntProperty(xwindow_,
- k_NET_WM_USER_TIME,
- k_NET_WM_USER_TIME,
- 0);
- }
-}
-
void RootWindowHostLinux::PostNativeEvent(
const base::NativeEvent& native_event) {
DCHECK(xwindow_);
diff --git a/ui/aura/root_window_host_linux.h b/ui/aura/root_window_host_linux.h
index 5b4c96a..a045a52 100644
--- a/ui/aura/root_window_host_linux.h
+++ b/ui/aura/root_window_host_linux.h
@@ -42,7 +42,6 @@ class RootWindowHostLinux : public RootWindowHost {
virtual bool ConfineCursorToRootWindow() OVERRIDE;
virtual void UnConfineCursor() OVERRIDE;
virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE;
- virtual void SetFocusWhenShown(bool focus_when_shown) OVERRIDE;
virtual void PostNativeEvent(const base::NativeEvent& event) OVERRIDE;
// Returns true if there's an X window manager present... in most cases. Some
@@ -75,9 +74,6 @@ class RootWindowHostLinux : public RootWindowHost {
// The bounds of |xwindow_|.
gfx::Rect bounds_;
- // True if the window should be focused when the window is shown.
- bool focus_when_shown_;
-
DISALLOW_COPY_AND_ASSIGN(RootWindowHostLinux);
};
diff --git a/ui/aura/root_window_host_win.cc b/ui/aura/root_window_host_win.cc
index 2e90ba4..868173c 100644
--- a/ui/aura/root_window_host_win.cc
+++ b/ui/aura/root_window_host_win.cc
@@ -186,8 +186,8 @@ void RootWindowHostWin::SetBounds(const gfx::Rect& bounds) {
RECT window_rect;
window_rect.left = bounds.x();
window_rect.top = bounds.y();
- window_rect.right = bounds.right() ;
- window_rect.bottom = bounds.bottom();
+ window_rect.right = bounds.width();
+ window_rect.bottom = bounds.height();
AdjustWindowRectEx(&window_rect,
GetWindowLong(hwnd(), GWL_STYLE),
FALSE,
@@ -262,10 +262,6 @@ void RootWindowHostWin::MoveCursorTo(const gfx::Point& location) {
SetCursorPos(pt.x, pt.y);
}
-void RootWindowHostWin::SetFocusWhenShown(bool focus_when_shown) {
- NOTIMPLEMENTED();
-}
-
void RootWindowHostWin::PostNativeEvent(const base::NativeEvent& native_event) {
::PostMessage(
hwnd(), native_event.message, native_event.wParam, native_event.lParam);
diff --git a/ui/aura/root_window_host_win.h b/ui/aura/root_window_host_win.h
index 56d1fd6..e64c40b 100644
--- a/ui/aura/root_window_host_win.h
+++ b/ui/aura/root_window_host_win.h
@@ -33,7 +33,6 @@ class RootWindowHostWin : public RootWindowHost, public ui::WindowImpl {
virtual bool ConfineCursorToRootWindow() OVERRIDE;
virtual void UnConfineCursor() OVERRIDE;
virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE;
- virtual void SetFocusWhenShown(bool focus_when_shown) OVERRIDE;
virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE;
private:
diff --git a/ui/aura/single_monitor_manager.cc b/ui/aura/single_monitor_manager.cc
index 1b4e151..2e1d86d 100644
--- a/ui/aura/single_monitor_manager.cc
+++ b/ui/aura/single_monitor_manager.cc
@@ -27,7 +27,8 @@ static const int kDefaultHostWindowHeight = 1024;
}
SingleMonitorManager::SingleMonitorManager()
- : root_window_(NULL) {
+ : root_window_(NULL),
+ monitor_(new Monitor()) {
Init();
}
@@ -36,11 +37,9 @@ SingleMonitorManager::~SingleMonitorManager() {
root_window_->RemoveObserver(this);
}
-void SingleMonitorManager::OnNativeMonitorsChanged(
- const std::vector<const Monitor*>& monitors) {
- DCHECK(monitors.size() > 0);
+void SingleMonitorManager::OnNativeMonitorResized(const gfx::Size& size) {
if (use_fullscreen_host_window()) {
- monitor_->set_size(monitors[0]->bounds().size());
+ monitor_->set_size(size);
NotifyBoundsChanged(monitor_.get());
}
}
diff --git a/ui/aura/single_monitor_manager.h b/ui/aura/single_monitor_manager.h
index 5afbcd2..c13bc18 100644
--- a/ui/aura/single_monitor_manager.h
+++ b/ui/aura/single_monitor_manager.h
@@ -26,8 +26,7 @@ class SingleMonitorManager : public MonitorManager,
virtual ~SingleMonitorManager();
// MonitorManager overrides:
- virtual void OnNativeMonitorsChanged(
- const std::vector<const Monitor*>& monitors) OVERRIDE;
+ virtual void OnNativeMonitorResized(const gfx::Size& size) OVERRIDE;
virtual RootWindow* CreateRootWindowForMonitor(
Monitor* monitor) OVERRIDE;
virtual const Monitor* GetMonitorNearestWindow(