Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(661)

Side by Side Diff: ui/views/widget/native_widget_aura.cc

Issue 11761005: views: Target the synthetic wheel events to the view under the mouse cursor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: aura-test Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/menu/menu_host_root_view.cc ('k') | ui/views/widget/root_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 if (event->handled()) 792 if (event->handled())
793 return; 793 return;
794 } 794 }
795 795
796 if (tooltip_manager_.get()) 796 if (tooltip_manager_.get())
797 tooltip_manager_->UpdateTooltip(); 797 tooltip_manager_->UpdateTooltip();
798 delegate_->OnMouseEvent(event); 798 delegate_->OnMouseEvent(event);
799 } 799 }
800 800
801 void NativeWidgetAura::OnScrollEvent(ui::ScrollEvent* event) { 801 void NativeWidgetAura::OnScrollEvent(ui::ScrollEvent* event) {
802 if (event->type() == ui::ET_SCROLL) {
803 delegate_->OnScrollEvent(event);
804 if (event->handled())
805 return;
806
807 // Convert unprocessed scroll events into wheel events.
808 ui::MouseWheelEvent mwe(*static_cast<ui::ScrollEvent*>(event));
809 delegate_->OnMouseEvent(&mwe);
810 if (mwe.handled())
811 event->SetHandled();
812 return;
813 }
814 delegate_->OnScrollEvent(event); 802 delegate_->OnScrollEvent(event);
815 } 803 }
816 804
817 void NativeWidgetAura::OnTouchEvent(ui::TouchEvent* event) { 805 void NativeWidgetAura::OnTouchEvent(ui::TouchEvent* event) {
818 DCHECK(window_->IsVisible()); 806 DCHECK(window_->IsVisible());
819 delegate_->OnTouchEvent(event); 807 delegate_->OnTouchEvent(event);
820 } 808 }
821 809
822 void NativeWidgetAura::OnGestureEvent(ui::GestureEvent* event) { 810 void NativeWidgetAura::OnGestureEvent(ui::GestureEvent* event) {
823 DCHECK(window_->IsVisible()); 811 DCHECK(window_->IsVisible());
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 return aura::Env::GetInstance()->is_mouse_button_down(); 1057 return aura::Env::GetInstance()->is_mouse_button_down();
1070 } 1058 }
1071 1059
1072 // static 1060 // static
1073 bool NativeWidgetPrivate::IsTouchDown() { 1061 bool NativeWidgetPrivate::IsTouchDown() {
1074 return aura::Env::GetInstance()->is_touch_down(); 1062 return aura::Env::GetInstance()->is_touch_down();
1075 } 1063 }
1076 1064
1077 } // namespace internal 1065 } // namespace internal
1078 } // namespace views 1066 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_host_root_view.cc ('k') | ui/views/widget/root_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698