| Index: ui/aura/root_window.cc
|
| diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
|
| index 1ea9751935b1d7c38ece0f37f3ce202a785ae1f0..8050f5c2e543f57fb025f107db94769234c0ba95 100644
|
| --- a/ui/aura/root_window.cc
|
| +++ b/ui/aura/root_window.cc
|
| @@ -67,16 +67,14 @@ Window* GestureEventHandlerForConsumedGesture(const GestureEvent& event,
|
|
|
| } // namespace
|
|
|
| -RootWindow* RootWindow::instance_ = NULL;
|
| -bool RootWindow::use_fullscreen_host_window_ = false;
|
| bool RootWindow::hide_host_cursor_ = false;
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // RootWindow, public:
|
|
|
| -RootWindow::RootWindow()
|
| +RootWindow::RootWindow(const gfx::Rect& initial_bounds)
|
| : Window(NULL),
|
| - host_(aura::RootWindowHost::Create(GetInitialHostWindowBounds())),
|
| + host_(aura::RootWindowHost::Create(initial_bounds)),
|
| ALLOW_THIS_IN_INITIALIZER_LIST(schedule_paint_factory_(this)),
|
| ALLOW_THIS_IN_INITIALIZER_LIST(event_factory_(this)),
|
| mouse_button_flags_(0),
|
| @@ -103,7 +101,6 @@ RootWindow::RootWindow()
|
| should_hold_mouse_moves_ = !CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kAuraDisableHoldMouseMoves);
|
|
|
| - ui::Compositor::Initialize(false);
|
| compositor_.reset(new ui::Compositor(this, host_->GetAcceleratedWidget(),
|
| host_->GetBounds().size()));
|
| DCHECK(compositor_.get());
|
| @@ -122,9 +119,6 @@ RootWindow::~RootWindow() {
|
|
|
| // An observer may have been added by an animation on the RootWindow.
|
| layer()->GetAnimator()->RemoveObserver(this);
|
| - ui::Compositor::Terminate();
|
| - if (instance_ == this)
|
| - instance_ = NULL;
|
| }
|
|
|
| void RootWindow::ShowRootWindow() {
|
| @@ -147,6 +141,14 @@ gfx::Size RootWindow::GetHostSize() const {
|
| return rect.size();
|
| }
|
|
|
| +void RootWindow::SetHostBounds(const gfx::Rect& bounds) {
|
| + DispatchHeldMouseMove();
|
| + host_->SetBounds(bounds);
|
| + // Requery the location to constrain it within the new root window size.
|
| + last_mouse_location_ = host_->QueryMouseLocation();
|
| + synthesize_mouse_move_ = false;
|
| +}
|
| +
|
| void RootWindow::SetCursor(gfx::NativeCursor cursor) {
|
| last_cursor_ = cursor;
|
| // A lot of code seems to depend on NULL cursors actually showing an arrow,
|
| @@ -437,6 +439,10 @@ RootWindow* RootWindow::GetRootWindow() {
|
| return this;
|
| }
|
|
|
| +const RootWindow* RootWindow::GetRootWindow() const {
|
| + return this;
|
| +}
|
| +
|
| void RootWindow::SetTransform(const ui::Transform& transform) {
|
| Window::SetTransform(transform);
|
|
|
| @@ -834,11 +840,6 @@ void RootWindow::DispatchHeldMouseMove() {
|
| }
|
| }
|
|
|
| -gfx::Rect RootWindow::GetInitialHostWindowBounds() const {
|
| - return Env::GetInstance()->monitor_manager()->
|
| - GetMonitorNearestWindow(this)->bounds();
|
| -}
|
| -
|
| void RootWindow::PostMouseMoveEventAfterWindowChange() {
|
| if (synthesize_mouse_move_)
|
| return;
|
|
|