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_change_observer.h" | 10 #include "ui/aura/client/activation_change_observer.h" |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 | 868 |
869 // Convert unprocessed scroll events into wheel events. | 869 // Convert unprocessed scroll events into wheel events. |
870 ui::MouseWheelEvent mwe(*static_cast<ui::ScrollEvent*>(event)); | 870 ui::MouseWheelEvent mwe(*static_cast<ui::ScrollEvent*>(event)); |
871 return delegate_->OnMouseEvent(mwe) ? ui::ER_HANDLED : ui::ER_UNHANDLED; | 871 return delegate_->OnMouseEvent(mwe) ? ui::ER_HANDLED : ui::ER_UNHANDLED; |
872 } | 872 } |
873 if (tooltip_manager_.get()) | 873 if (tooltip_manager_.get()) |
874 tooltip_manager_->UpdateTooltip(); | 874 tooltip_manager_->UpdateTooltip(); |
875 return delegate_->OnMouseEvent(*event) ? ui::ER_HANDLED : ui::ER_UNHANDLED; | 875 return delegate_->OnMouseEvent(*event) ? ui::ER_HANDLED : ui::ER_UNHANDLED; |
876 } | 876 } |
877 | 877 |
878 ui::TouchStatus NativeWidgetAura::OnTouchEvent(ui::TouchEvent* event) { | 878 ui::EventResult NativeWidgetAura::OnTouchEvent(ui::TouchEvent* event) { |
879 DCHECK(window_->IsVisible()); | 879 DCHECK(window_->IsVisible()); |
880 return delegate_->OnTouchEvent(*event); | 880 ui::TouchStatus status = delegate_->OnTouchEvent(*event); |
| 881 switch (status) { |
| 882 case ui::TOUCH_STATUS_UNKNOWN: |
| 883 return ui::ER_UNHANDLED; |
| 884 |
| 885 case ui::TOUCH_STATUS_START: |
| 886 case ui::TOUCH_STATUS_CONTINUE: |
| 887 case ui::TOUCH_STATUS_END: |
| 888 return ui::ER_CONSUMED; |
| 889 |
| 890 case ui::TOUCH_STATUS_QUEUED: |
| 891 case ui::TOUCH_STATUS_QUEUED_END: |
| 892 return ui::ER_ASYNC; |
| 893 } |
| 894 |
| 895 NOTREACHED(); |
| 896 return ui::ER_UNHANDLED; |
881 } | 897 } |
882 | 898 |
883 ui::EventResult NativeWidgetAura::OnGestureEvent(ui::GestureEvent* event) { | 899 ui::EventResult NativeWidgetAura::OnGestureEvent(ui::GestureEvent* event) { |
884 DCHECK(window_->IsVisible()); | 900 DCHECK(window_->IsVisible()); |
885 return delegate_->OnGestureEvent(*event); | 901 return delegate_->OnGestureEvent(*event); |
886 } | 902 } |
887 | 903 |
888 //////////////////////////////////////////////////////////////////////////////// | 904 //////////////////////////////////////////////////////////////////////////////// |
889 // NativeWidgetAura, aura::ActivationDelegate implementation: | 905 // NativeWidgetAura, aura::ActivationDelegate implementation: |
890 | 906 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 return aura::Env::GetInstance()->is_mouse_button_down(); | 1081 return aura::Env::GetInstance()->is_mouse_button_down(); |
1066 } | 1082 } |
1067 | 1083 |
1068 // static | 1084 // static |
1069 bool NativeWidgetPrivate::IsTouchDown() { | 1085 bool NativeWidgetPrivate::IsTouchDown() { |
1070 return aura::Env::GetInstance()->is_touch_down(); | 1086 return aura::Env::GetInstance()->is_touch_down(); |
1071 } | 1087 } |
1072 | 1088 |
1073 } // namespace internal | 1089 } // namespace internal |
1074 } // namespace views | 1090 } // namespace views |
OLD | NEW |