Chromium Code Reviews| Index: ui/aura/root_window.cc |
| diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc |
| index 1ea9751935b1d7c38ece0f37f3ce202a785ae1f0..e64ccc3eced1b8c5712468e5e588d3e350197533 100644 |
| --- a/ui/aura/root_window.cc |
| +++ b/ui/aura/root_window.cc |
| @@ -68,15 +68,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 +102,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,7 +120,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) |
|
piman
2012/03/20 00:31:37
Should this go away now that we can have more than
oshima
2012/03/20 02:29:58
looks like this is obsolete code. deleted.
|
| instance_ = NULL; |
| } |
| @@ -147,6 +144,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 +442,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 +843,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; |