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

Side by Side Diff: ui/base/event.cc

Issue 10828133: Desktop Aura: Allow tab drags out of window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase to tot Created 8 years, 4 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/base/event.h" 5 #include "ui/base/event.h"
6 6
7 #if defined(USE_X11) 7 #if defined(USE_X11)
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 #endif 9 #endif
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // LocatedEvent 93 // LocatedEvent
94 94
95 LocatedEvent::~LocatedEvent() { 95 LocatedEvent::~LocatedEvent() {
96 } 96 }
97 97
98 LocatedEvent::LocatedEvent(const base::NativeEvent& native_event) 98 LocatedEvent::LocatedEvent(const base::NativeEvent& native_event)
99 : Event(native_event, 99 : Event(native_event,
100 EventTypeFromNative(native_event), 100 EventTypeFromNative(native_event),
101 EventFlagsFromNative(native_event)), 101 EventFlagsFromNative(native_event)),
102 location_(EventLocationFromNative(native_event)), 102 location_(EventLocationFromNative(native_event)),
103 root_location_(location_) { 103 root_location_(location_),
104 system_location_(ui::EventSystemLocationFromNative(native_event)) {
104 } 105 }
105 106
106 LocatedEvent::LocatedEvent(EventType type, 107 LocatedEvent::LocatedEvent(EventType type,
107 const gfx::Point& location, 108 const gfx::Point& location,
108 const gfx::Point& root_location, 109 const gfx::Point& root_location,
109 int flags) 110 int flags)
110 : Event(type, flags), 111 : Event(type, flags),
111 location_(location), 112 location_(location),
112 root_location_(root_location) { 113 root_location_(root_location),
114 system_location_(-1, -1) {
113 } 115 }
114 116
115 LocatedEvent::LocatedEvent(const LocatedEvent& model) 117 LocatedEvent::LocatedEvent(const LocatedEvent& model)
116 : Event(model), 118 : Event(model),
117 location_(model.location_), 119 location_(model.location_),
118 root_location_(model.root_location_) { 120 root_location_(model.root_location_),
121 system_location_(model.system_location_) {
119 } 122 }
120 123
121 void LocatedEvent::UpdateForRootTransform(const Transform& root_transform) { 124 void LocatedEvent::UpdateForRootTransform(const Transform& root_transform) {
122 // Transform has to be done at root level. 125 // Transform has to be done at root level.
123 DCHECK_EQ(root_location_.x(), location_.x()); 126 DCHECK_EQ(root_location_.x(), location_.x());
124 DCHECK_EQ(root_location_.y(), location_.y()); 127 DCHECK_EQ(root_location_.y(), location_.y());
125 gfx::Point3f p(location_); 128 gfx::Point3f p(location_);
126 root_transform.TransformPointReverse(p); 129 root_transform.TransformPointReverse(p);
127 root_location_ = location_ = p.AsPoint(); 130 root_location_ = location_ = p.AsPoint();
128 } 131 }
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 int GestureEvent::GetLowestTouchId() const { 469 int GestureEvent::GetLowestTouchId() const {
467 if (touch_ids_bitfield_ == 0) 470 if (touch_ids_bitfield_ == 0)
468 return -1; 471 return -1;
469 int i = -1; 472 int i = -1;
470 // Find the index of the least significant 1 bit 473 // Find the index of the least significant 1 bit
471 while (!(1 << ++i & touch_ids_bitfield_)); 474 while (!(1 << ++i & touch_ids_bitfield_));
472 return i; 475 return i;
473 } 476 }
474 477
475 } // namespace ui 478 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698