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/views/widget/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
10 #include "ui/aura/client/activation_client.h" | 10 #include "ui/aura/client/activation_client.h" |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 ui::EventResult NativeWidgetAura::OnMouseEvent(ui::MouseEvent* event) { | 787 ui::EventResult NativeWidgetAura::OnMouseEvent(ui::MouseEvent* event) { |
788 DCHECK(window_->IsVisible()); | 788 DCHECK(window_->IsVisible()); |
789 if (event->type() == ui::ET_MOUSEWHEEL) | 789 if (event->type() == ui::ET_MOUSEWHEEL) |
790 return delegate_->OnMouseEvent(*event) ? ui::ER_HANDLED : ui::ER_UNHANDLED; | 790 return delegate_->OnMouseEvent(*event) ? ui::ER_HANDLED : ui::ER_UNHANDLED; |
791 | 791 |
792 if (tooltip_manager_.get()) | 792 if (tooltip_manager_.get()) |
793 tooltip_manager_->UpdateTooltip(); | 793 tooltip_manager_->UpdateTooltip(); |
794 return delegate_->OnMouseEvent(*event) ? ui::ER_HANDLED : ui::ER_UNHANDLED; | 794 return delegate_->OnMouseEvent(*event) ? ui::ER_HANDLED : ui::ER_UNHANDLED; |
795 } | 795 } |
796 | 796 |
797 ui::EventResult NativeWidgetAura::OnScrollEvent(ui::ScrollEvent* event) { | 797 void NativeWidgetAura::OnScrollEvent(ui::ScrollEvent* event) { |
798 if (event->type() == ui::ET_SCROLL) { | 798 if (event->type() == ui::ET_SCROLL) { |
799 ui::EventResult status = delegate_->OnScrollEvent(event); | 799 delegate_->OnScrollEvent(event); |
800 if (status != ui::ER_UNHANDLED) | 800 if (event->handled()) |
801 return status; | 801 return; |
802 | 802 |
803 // Convert unprocessed scroll events into wheel events. | 803 // Convert unprocessed scroll events into wheel events. |
804 ui::MouseWheelEvent mwe(*static_cast<ui::ScrollEvent*>(event)); | 804 ui::MouseWheelEvent mwe(*static_cast<ui::ScrollEvent*>(event)); |
805 return delegate_->OnMouseEvent(mwe) ? ui::ER_HANDLED : ui::ER_UNHANDLED; | 805 if (delegate_->OnMouseEvent(mwe)) |
| 806 event->SetHandled(); |
| 807 return; |
806 } | 808 } |
807 return delegate_->OnScrollEvent(event); | 809 delegate_->OnScrollEvent(event); |
808 } | 810 } |
809 | 811 |
810 ui::EventResult NativeWidgetAura::OnTouchEvent(ui::TouchEvent* event) { | 812 void NativeWidgetAura::OnTouchEvent(ui::TouchEvent* event) { |
811 DCHECK(window_->IsVisible()); | 813 DCHECK(window_->IsVisible()); |
812 return delegate_->OnTouchEvent(event); | 814 delegate_->OnTouchEvent(event); |
813 } | 815 } |
814 | 816 |
815 void NativeWidgetAura::OnGestureEvent(ui::GestureEvent* event) { | 817 void NativeWidgetAura::OnGestureEvent(ui::GestureEvent* event) { |
816 DCHECK(window_->IsVisible()); | 818 DCHECK(window_->IsVisible()); |
817 delegate_->OnGestureEvent(event); | 819 delegate_->OnGestureEvent(event); |
818 } | 820 } |
819 | 821 |
820 //////////////////////////////////////////////////////////////////////////////// | 822 //////////////////////////////////////////////////////////////////////////////// |
821 // NativeWidgetAura, aura::client::ActivationDelegate implementation: | 823 // NativeWidgetAura, aura::client::ActivationDelegate implementation: |
822 | 824 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 return aura::Env::GetInstance()->is_mouse_button_down(); | 1064 return aura::Env::GetInstance()->is_mouse_button_down(); |
1063 } | 1065 } |
1064 | 1066 |
1065 // static | 1067 // static |
1066 bool NativeWidgetPrivate::IsTouchDown() { | 1068 bool NativeWidgetPrivate::IsTouchDown() { |
1067 return aura::Env::GetInstance()->is_touch_down(); | 1069 return aura::Env::GetInstance()->is_touch_down(); |
1068 } | 1070 } |
1069 | 1071 |
1070 } // namespace internal | 1072 } // namespace internal |
1071 } // namespace views | 1073 } // namespace views |
OLD | NEW |