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

Side by Side Diff: ui/aura/root_window.cc

Issue 11881042: highlight intermediate tabs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make check for Gesture vs Scroll event for flings explicit 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
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/aura/root_window.h" 5 #include "ui/aura/root_window.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 773
774 bool RootWindow::OnHostScrollEvent(ui::ScrollEvent* event) { 774 bool RootWindow::OnHostScrollEvent(ui::ScrollEvent* event) {
775 DispatchHeldMouseMove(); 775 DispatchHeldMouseMove();
776 776
777 TransformEventForDeviceScaleFactor(event); 777 TransformEventForDeviceScaleFactor(event);
778 SetLastMouseLocation(this, event->location()); 778 SetLastMouseLocation(this, event->location());
779 synthesize_mouse_move_ = false; 779 synthesize_mouse_move_ = false;
780 780
781 Window* target = mouse_pressed_handler_ ? 781 Window* target = mouse_pressed_handler_ ?
782 mouse_pressed_handler_ : client::GetCaptureWindow(this); 782 mouse_pressed_handler_ : client::GetCaptureWindow(this);
783
783 if (!target) 784 if (!target)
784 target = GetEventHandlerForPoint(event->location()); 785 target = GetEventHandlerForPoint(event->location());
785 786
786 if (target && target->delegate()) { 787 if (!target)
787 int flags = event->flags(); 788 target = this;
788 gfx::Point location_in_window = event->location(); 789
789 Window::ConvertPointToTarget(this, target, &location_in_window); 790 int flags = event->flags();
790 if (IsNonClientLocation(target, location_in_window)) 791 gfx::Point location_in_window = event->location();
791 flags |= ui::EF_IS_NON_CLIENT; 792 Window::ConvertPointToTarget(this, target, &location_in_window);
792 event->set_flags(flags); 793 if (IsNonClientLocation(target, location_in_window))
793 event->ConvertLocationToTarget(static_cast<Window*>(this), target); 794 flags |= ui::EF_IS_NON_CLIENT;
794 ProcessEvent(target, event); 795 event->set_flags(flags);
795 return event->handled(); 796 event->ConvertLocationToTarget(static_cast<Window*>(this), target);
796 } 797 ProcessEvent(target, event);
797 return false; 798 return event->handled();
798 } 799 }
799 800
800 bool RootWindow::OnHostTouchEvent(ui::TouchEvent* event) { 801 bool RootWindow::OnHostTouchEvent(ui::TouchEvent* event) {
801 DispatchHeldMouseMove(); 802 DispatchHeldMouseMove();
802 switch (event->type()) { 803 switch (event->type()) {
803 case ui::ET_TOUCH_PRESSED: 804 case ui::ET_TOUCH_PRESSED:
804 touch_ids_down_ |= (1 << event->touch_id()); 805 touch_ids_down_ |= (1 << event->touch_id());
805 Env::GetInstance()->set_touch_down(touch_ids_down_ != 0); 806 Env::GetInstance()->set_touch_down(touch_ids_down_ != 0);
806 break; 807 break;
807 808
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 ui::MouseEvent event(ui::ET_MOUSE_MOVED, 1003 ui::MouseEvent event(ui::ET_MOUSE_MOVED,
1003 orig_mouse_location, 1004 orig_mouse_location,
1004 orig_mouse_location, 1005 orig_mouse_location,
1005 ui::EF_IS_SYNTHESIZED); 1006 ui::EF_IS_SYNTHESIZED);
1006 event.set_system_location(Env::GetInstance()->last_mouse_location()); 1007 event.set_system_location(Env::GetInstance()->last_mouse_location());
1007 OnHostMouseEvent(&event); 1008 OnHostMouseEvent(&event);
1008 #endif 1009 #endif
1009 } 1010 }
1010 1011
1011 } // namespace aura 1012 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698