OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 // If the layer is not animating, then we need to update the host size | 478 // If the layer is not animating, then we need to update the host size |
479 // immediately. | 479 // immediately. |
480 if (!layer()->GetAnimator()->is_animating()) | 480 if (!layer()->GetAnimator()->is_animating()) |
481 OnHostResized(host_->GetBounds().size()); | 481 OnHostResized(host_->GetBounds().size()); |
482 } | 482 } |
483 | 483 |
484 //////////////////////////////////////////////////////////////////////////////// | 484 //////////////////////////////////////////////////////////////////////////////// |
485 // RootWindow, ui::EventTarget implementation: | 485 // RootWindow, ui::EventTarget implementation: |
486 | 486 |
487 ui::EventTarget* RootWindow::GetParentTarget() { | 487 ui::EventTarget* RootWindow::GetParentTarget() { |
488 return Env::GetInstance(); | 488 return client::GetEventClient(this) ? |
| 489 client::GetEventClient(this)->GetToplevelEventTarget() : |
| 490 Env::GetInstance(); |
489 } | 491 } |
490 | 492 |
491 //////////////////////////////////////////////////////////////////////////////// | 493 //////////////////////////////////////////////////////////////////////////////// |
492 // RootWindow, ui::CompositorDelegate implementation: | 494 // RootWindow, ui::CompositorDelegate implementation: |
493 | 495 |
494 void RootWindow::ScheduleDraw() { | 496 void RootWindow::ScheduleDraw() { |
495 if (compositor_lock_) { | 497 if (compositor_lock_) { |
496 draw_on_compositor_unlock_ = true; | 498 draw_on_compositor_unlock_ = true; |
497 } else if (!defer_draw_scheduling_) { | 499 } else if (!defer_draw_scheduling_) { |
498 defer_draw_scheduling_ = true; | 500 defer_draw_scheduling_ = true; |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 void RootWindow::UnlockCompositor() { | 1073 void RootWindow::UnlockCompositor() { |
1072 DCHECK(compositor_lock_); | 1074 DCHECK(compositor_lock_); |
1073 compositor_lock_ = NULL; | 1075 compositor_lock_ = NULL; |
1074 if (draw_on_compositor_unlock_) { | 1076 if (draw_on_compositor_unlock_) { |
1075 draw_on_compositor_unlock_ = false; | 1077 draw_on_compositor_unlock_ = false; |
1076 ScheduleDraw(); | 1078 ScheduleDraw(); |
1077 } | 1079 } |
1078 } | 1080 } |
1079 | 1081 |
1080 } // namespace aura | 1082 } // namespace aura |
OLD | NEW |