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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 bool RootWindow::CanDispatchToConsumer(ui::GestureConsumer* consumer) { | 631 bool RootWindow::CanDispatchToConsumer(ui::GestureConsumer* consumer) { |
632 Window* consumer_window = ConsumerToWindow(consumer);; | 632 Window* consumer_window = ConsumerToWindow(consumer);; |
633 return (consumer_window && consumer_window->GetRootWindow() == window()); | 633 return (consumer_window && consumer_window->GetRootWindow() == window()); |
634 } | 634 } |
635 | 635 |
636 void RootWindow::DispatchPostponedGestureEvent(ui::GestureEvent* event) { | 636 void RootWindow::DispatchPostponedGestureEvent(ui::GestureEvent* event) { |
637 DispatchGestureEvent(event); | 637 DispatchGestureEvent(event); |
638 } | 638 } |
639 | 639 |
640 void RootWindow::DispatchCancelTouchEvent(ui::TouchEvent* event) { | 640 void RootWindow::DispatchCancelTouchEvent(ui::TouchEvent* event) { |
641 OnHostTouchEvent(event); | 641 DispatchDetails details = OnEventFromSource(event); |
| 642 if (details.dispatcher_destroyed) |
| 643 return; |
642 } | 644 } |
643 | 645 |
644 //////////////////////////////////////////////////////////////////////////////// | 646 //////////////////////////////////////////////////////////////////////////////// |
645 // RootWindow, ui::LayerAnimationObserver implementation: | 647 // RootWindow, ui::LayerAnimationObserver implementation: |
646 | 648 |
647 void RootWindow::OnLayerAnimationEnded( | 649 void RootWindow::OnLayerAnimationEnded( |
648 ui::LayerAnimationSequence* animation) { | 650 ui::LayerAnimationSequence* animation) { |
649 host()->UpdateRootWindowSize(host_->GetBounds().size()); | 651 host()->UpdateRootWindowSize(host_->GetBounds().size()); |
650 } | 652 } |
651 | 653 |
652 void RootWindow::OnLayerAnimationScheduled( | 654 void RootWindow::OnLayerAnimationScheduled( |
653 ui::LayerAnimationSequence* animation) { | 655 ui::LayerAnimationSequence* animation) { |
654 } | 656 } |
655 | 657 |
656 void RootWindow::OnLayerAnimationAborted( | 658 void RootWindow::OnLayerAnimationAborted( |
657 ui::LayerAnimationSequence* animation) { | 659 ui::LayerAnimationSequence* animation) { |
658 } | 660 } |
659 | 661 |
660 //////////////////////////////////////////////////////////////////////////////// | 662 //////////////////////////////////////////////////////////////////////////////// |
661 // RootWindow, WindowTreeHostDelegate implementation: | 663 // RootWindow, WindowTreeHostDelegate implementation: |
662 | 664 |
663 bool RootWindow::OnHostKeyEvent(ui::KeyEvent* event) { | |
664 DispatchDetails details = OnEventFromSource(event); | |
665 if (details.dispatcher_destroyed) | |
666 event->SetHandled(); | |
667 return event->handled(); | |
668 } | |
669 | |
670 bool RootWindow::OnHostMouseEvent(ui::MouseEvent* event) { | |
671 DispatchDetails details = OnEventFromSource(event); | |
672 if (details.dispatcher_destroyed) | |
673 event->SetHandled(); | |
674 return event->handled(); | |
675 } | |
676 | |
677 bool RootWindow::OnHostScrollEvent(ui::ScrollEvent* event) { | |
678 DispatchDetails details = OnEventFromSource(event); | |
679 if (details.dispatcher_destroyed) | |
680 event->SetHandled(); | |
681 return event->handled(); | |
682 } | |
683 | |
684 bool RootWindow::OnHostTouchEvent(ui::TouchEvent* event) { | |
685 DispatchDetails details = OnEventFromSource(event); | |
686 if (details.dispatcher_destroyed) | |
687 event->SetHandled(); | |
688 return event->handled(); | |
689 } | |
690 | |
691 void RootWindow::OnHostCancelMode() { | 665 void RootWindow::OnHostCancelMode() { |
692 ui::CancelModeEvent event; | 666 ui::CancelModeEvent event; |
693 Window* focused_window = client::GetFocusClient(window())->GetFocusedWindow(); | 667 Window* focused_window = client::GetFocusClient(window())->GetFocusedWindow(); |
694 DispatchDetails details = | 668 DispatchDetails details = |
695 DispatchEvent(focused_window ? focused_window : window(), &event); | 669 DispatchEvent(focused_window ? focused_window : window(), &event); |
696 if (details.dispatcher_destroyed) | 670 if (details.dispatcher_destroyed) |
697 return; | 671 return; |
698 } | 672 } |
699 | 673 |
700 void RootWindow::OnHostActivated() { | 674 void RootWindow::OnHostActivated() { |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 break; | 933 break; |
960 | 934 |
961 default: | 935 default: |
962 NOTREACHED(); | 936 NOTREACHED(); |
963 break; | 937 break; |
964 } | 938 } |
965 PreDispatchLocatedEvent(target, event); | 939 PreDispatchLocatedEvent(target, event); |
966 } | 940 } |
967 | 941 |
968 } // namespace aura | 942 } // namespace aura |
OLD | NEW |