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

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

Issue 103173004: Target touches to the correct display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 1030
1031 default: 1031 default:
1032 break; 1032 break;
1033 } 1033 }
1034 TransformEventForDeviceScaleFactor(event); 1034 TransformEventForDeviceScaleFactor(event);
1035 Window* target = client::GetCaptureWindow(window()); 1035 Window* target = client::GetCaptureWindow(window());
1036 if (!target) { 1036 if (!target) {
1037 target = ConsumerToWindow( 1037 target = ConsumerToWindow(
1038 ui::GestureRecognizer::Get()->GetTouchLockedTarget(*event)); 1038 ui::GestureRecognizer::Get()->GetTouchLockedTarget(*event));
1039 if (!target) { 1039 if (!target) {
1040 target = ConsumerToWindow(ui::GestureRecognizer::Get()-> 1040 target = ConsumerToWindow(
1041 GetTargetForLocation(event->location())); 1041 ui::GestureRecognizer::Get()->
1042 GetTargetForLocation(event->location(), event->source_device_id()));
1042 } 1043 }
1043 } 1044 }
1044 1045
1045 // The gesture recognizer processes touch events in the system coordinates. So 1046 // The gesture recognizer processes touch events in the system coordinates. So
1046 // keep a copy of the touch event here before possibly converting the event to 1047 // keep a copy of the touch event here before possibly converting the event to
1047 // a window's local coordinate system. 1048 // a window's local coordinate system.
1048 ui::TouchEvent event_for_gr(*event); 1049 ui::TouchEvent event_for_gr(*event);
1049 1050
1050 ui::EventResult result = ui::ER_UNHANDLED; 1051 ui::EventResult result = ui::ER_UNHANDLED;
1051 if (!target && !window()->bounds().Contains(event->location())) { 1052 if (!target && !window()->bounds().Contains(event->location())) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 } 1153 }
1153 1154
1154 gfx::Transform RootWindow::GetInverseRootTransform() const { 1155 gfx::Transform RootWindow::GetInverseRootTransform() const {
1155 float scale = ui::GetDeviceScaleFactor(window()->layer()); 1156 float scale = ui::GetDeviceScaleFactor(window()->layer());
1156 gfx::Transform transform; 1157 gfx::Transform transform;
1157 transform.Scale(1.0f / scale, 1.0f / scale); 1158 transform.Scale(1.0f / scale, 1.0f / scale);
1158 return transformer_->GetInverseTransform() * transform; 1159 return transformer_->GetInverseTransform() * transform;
1159 } 1160 }
1160 1161
1161 } // namespace aura 1162 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698