OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/root_window.h" | 5 #include "ui/aura/root_window.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 host_->GetSize()); | 427 host_->GetSize()); |
428 } | 428 } |
429 DCHECK(compositor_.get()); | 429 DCHECK(compositor_.get()); |
430 } | 430 } |
431 | 431 |
432 RootWindow::~RootWindow() { | 432 RootWindow::~RootWindow() { |
433 in_destructor_ = true; | 433 in_destructor_ = true; |
434 // Make sure to destroy the compositor before terminating so that state is | 434 // Make sure to destroy the compositor before terminating so that state is |
435 // cleared and we don't hit asserts. | 435 // cleared and we don't hit asserts. |
436 compositor_ = NULL; | 436 compositor_ = NULL; |
| 437 // An observer may have been added by an animation on the RootWindow. |
| 438 layer()->GetAnimator()->RemoveObserver(this); |
437 #ifdef USE_WEBKIT_COMPOSITOR | 439 #ifdef USE_WEBKIT_COMPOSITOR |
438 if (!ui::Compositor::compositor_factory()) | 440 if (!ui::Compositor::compositor_factory()) |
439 ui::CompositorCC::Terminate(); | 441 ui::CompositorCC::Terminate(); |
440 #endif | 442 #endif |
441 if (instance_ == this) | 443 if (instance_ == this) |
442 instance_ = NULL; | 444 instance_ = NULL; |
443 } | 445 } |
444 | 446 |
445 void RootWindow::HandleMouseMoved(const MouseEvent& event, Window* target) { | 447 void RootWindow::HandleMouseMoved(const MouseEvent& event, Window* target) { |
446 if (target == mouse_moved_handler_) | 448 if (target == mouse_moved_handler_) |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { | 607 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { |
606 bounds.set_size(gfx::Size(parsed_width, parsed_height)); | 608 bounds.set_size(gfx::Size(parsed_width, parsed_height)); |
607 } else if (use_fullscreen_host_window_) { | 609 } else if (use_fullscreen_host_window_) { |
608 bounds = gfx::Rect(RootWindowHost::GetNativeScreenSize()); | 610 bounds = gfx::Rect(RootWindowHost::GetNativeScreenSize()); |
609 } | 611 } |
610 | 612 |
611 return bounds; | 613 return bounds; |
612 } | 614 } |
613 | 615 |
614 } // namespace aura | 616 } // namespace aura |
OLD | NEW |