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

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

Issue 132123004: Target touches to the correct display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/aura/test/aura_test_helper.cc ('k') | ui/events/event.h » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/window_targeter.h" 5 #include "ui/aura/window_targeter.h"
6 6
7 #include "ui/aura/client/capture_client.h" 7 #include "ui/aura/client/capture_client.h"
8 #include "ui/aura/client/event_client.h" 8 #include "ui/aura/client/event_client.h"
9 #include "ui/aura/client/focus_client.h" 9 #include "ui/aura/client/focus_client.h"
10 #include "ui/aura/root_window.h" 10 #include "ui/aura/root_window.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 return capture_window; 103 return capture_window;
104 104
105 if (event.IsTouchEvent()) { 105 if (event.IsTouchEvent()) {
106 // Query the gesture-recognizer to find targets for touch events. 106 // Query the gesture-recognizer to find targets for touch events.
107 const ui::TouchEvent& touch = static_cast<const ui::TouchEvent&>(event); 107 const ui::TouchEvent& touch = static_cast<const ui::TouchEvent&>(event);
108 ui::GestureConsumer* consumer = 108 ui::GestureConsumer* consumer =
109 ui::GestureRecognizer::Get()->GetTouchLockedTarget(touch); 109 ui::GestureRecognizer::Get()->GetTouchLockedTarget(touch);
110 if (consumer) 110 if (consumer)
111 return static_cast<Window*>(consumer); 111 return static_cast<Window*>(consumer);
112 consumer = 112 consumer =
113 ui::GestureRecognizer::Get()->GetTargetForLocation(event.location()); 113 ui::GestureRecognizer::Get()->GetTargetForLocation(
114 event.location(), touch.source_device_id());
114 if (consumer) 115 if (consumer)
115 return static_cast<Window*>(consumer); 116 return static_cast<Window*>(consumer);
116 117
117 // If the initial touch is outside the root window, target the root. 118 // If the initial touch is outside the root window, target the root.
118 if (!root_window->bounds().Contains(event.location())) 119 if (!root_window->bounds().Contains(event.location()))
119 return root_window; 120 return root_window;
120 } 121 }
121 122
122 return NULL; 123 return NULL;
123 } 124 }
124 125
125 } // namespace aura 126 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/aura_test_helper.cc ('k') | ui/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698