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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 status = target->delegate()->OnGestureEvent(event); | 681 status = target->delegate()->OnGestureEvent(event); |
682 | 682 |
683 return status; | 683 return status; |
684 } | 684 } |
685 | 685 |
686 bool RootWindow::ProcessGestures(ui::GestureRecognizer::Gestures* gestures) { | 686 bool RootWindow::ProcessGestures(ui::GestureRecognizer::Gestures* gestures) { |
687 if (!gestures) | 687 if (!gestures) |
688 return false; | 688 return false; |
689 bool handled = false; | 689 bool handled = false; |
690 for (unsigned int i = 0; i < gestures->size(); i++) { | 690 for (unsigned int i = 0; i < gestures->size(); i++) { |
691 ui::GestureEvent* gesture = | 691 ui::GestureEvent* gesture = gestures->get().at(i); |
692 static_cast<ui::GestureEvent*>(gestures->get().at(i)); | |
693 if (DispatchGestureEvent(gesture) != ui::GESTURE_STATUS_UNKNOWN) | 692 if (DispatchGestureEvent(gesture) != ui::GESTURE_STATUS_UNKNOWN) |
694 handled = true; | 693 handled = true; |
695 } | 694 } |
696 return handled; | 695 return handled; |
697 } | 696 } |
698 | 697 |
699 void RootWindow::OnWindowRemovedFromRootWindow(Window* detached) { | 698 void RootWindow::OnWindowRemovedFromRootWindow(Window* detached) { |
700 DCHECK(aura::client::GetCaptureWindow(this) != this); | 699 DCHECK(aura::client::GetCaptureWindow(this) != this); |
701 | 700 |
702 OnWindowHidden(detached, false); | 701 OnWindowHidden(detached, false); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 gesture_recognizer_->FlushTouchQueue(invisible); | 747 gesture_recognizer_->FlushTouchQueue(invisible); |
749 } | 748 } |
750 | 749 |
751 void RootWindow::OnWindowAddedToRootWindow(Window* attached) { | 750 void RootWindow::OnWindowAddedToRootWindow(Window* attached) { |
752 if (attached->IsVisible() && | 751 if (attached->IsVisible() && |
753 attached->ContainsPointInRoot(GetLastMouseLocationInRoot())) | 752 attached->ContainsPointInRoot(GetLastMouseLocationInRoot())) |
754 PostMouseMoveEventAfterWindowChange(); | 753 PostMouseMoveEventAfterWindowChange(); |
755 } | 754 } |
756 | 755 |
757 bool RootWindow::DispatchLongPressGestureEvent(ui::GestureEvent* event) { | 756 bool RootWindow::DispatchLongPressGestureEvent(ui::GestureEvent* event) { |
758 return DispatchGestureEvent(static_cast<ui::GestureEvent*>(event)); | 757 return DispatchGestureEvent(event); |
759 } | 758 } |
760 | 759 |
761 bool RootWindow::DispatchCancelTouchEvent(ui::TouchEvent* event) { | 760 bool RootWindow::DispatchCancelTouchEvent(ui::TouchEvent* event) { |
762 return OnHostTouchEvent(event); | 761 return OnHostTouchEvent(event); |
763 } | 762 } |
764 | 763 |
765 ui::GestureEvent* RootWindow::CreateGestureEvent( | |
766 const ui::GestureEventDetails& details, | |
767 const gfx::Point& location, | |
768 int flags, | |
769 base::Time time, | |
770 unsigned int touch_id_bitfield) { | |
771 return new ui::GestureEvent(details.type(), location.x(), location.y(), | |
772 flags, time, details, touch_id_bitfield); | |
773 } | |
774 | |
775 ui::TouchEvent* RootWindow::CreateTouchEvent(ui::EventType type, | |
776 const gfx::Point& location, | |
777 int touch_id, | |
778 base::TimeDelta time_stamp) { | |
779 return new ui::TouchEvent(type, location, touch_id, time_stamp); | |
780 } | |
781 | |
782 void RootWindow::OnLayerAnimationEnded( | 764 void RootWindow::OnLayerAnimationEnded( |
783 ui::LayerAnimationSequence* animation) { | 765 ui::LayerAnimationSequence* animation) { |
784 OnHostResized(host_->GetBounds().size()); | 766 OnHostResized(host_->GetBounds().size()); |
785 } | 767 } |
786 | 768 |
787 void RootWindow::OnLayerAnimationScheduled( | 769 void RootWindow::OnLayerAnimationScheduled( |
788 ui::LayerAnimationSequence* animation) { | 770 ui::LayerAnimationSequence* animation) { |
789 } | 771 } |
790 | 772 |
791 void RootWindow::OnLayerAnimationAborted( | 773 void RootWindow::OnLayerAnimationAborted( |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 void RootWindow::UnlockCompositor() { | 1035 void RootWindow::UnlockCompositor() { |
1054 DCHECK(compositor_lock_); | 1036 DCHECK(compositor_lock_); |
1055 compositor_lock_ = NULL; | 1037 compositor_lock_ = NULL; |
1056 if (draw_on_compositor_unlock_) { | 1038 if (draw_on_compositor_unlock_) { |
1057 draw_on_compositor_unlock_ = false; | 1039 draw_on_compositor_unlock_ = false; |
1058 ScheduleDraw(); | 1040 ScheduleDraw(); |
1059 } | 1041 } |
1060 } | 1042 } |
1061 | 1043 |
1062 } // namespace aura | 1044 } // namespace aura |
OLD | NEW |