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

Side by Side Diff: ui/events/event.h

Issue 334753003: Reland: Fix slop region boundary handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reupload missing file. Created 6 years, 6 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/events/BUILD.gn ('k') | ui/events/events.gyp » ('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 #ifndef UI_EVENTS_EVENT_H_ 5 #ifndef UI_EVENTS_EVENT_H_
6 #define UI_EVENTS_EVENT_H_ 6 #define UI_EVENTS_EVENT_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/event_types.h" 10 #include "base/event_types.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 class EVENTS_EXPORT LocatedEvent : public Event { 241 class EVENTS_EXPORT LocatedEvent : public Event {
242 public: 242 public:
243 virtual ~LocatedEvent(); 243 virtual ~LocatedEvent();
244 244
245 float x() const { return location_.x(); } 245 float x() const { return location_.x(); }
246 float y() const { return location_.y(); } 246 float y() const { return location_.y(); }
247 void set_location(const gfx::PointF& location) { location_ = location; } 247 void set_location(const gfx::PointF& location) { location_ = location; }
248 // TODO(tdresser): Always return floating point location. See 248 // TODO(tdresser): Always return floating point location. See
249 // crbug.com/337824. 249 // crbug.com/337824.
250 gfx::Point location() const { return gfx::ToFlooredPoint(location_); } 250 gfx::Point location() const { return gfx::ToFlooredPoint(location_); }
251 gfx::PointF location_f() const { return location_; } 251 const gfx::PointF& location_f() const { return location_; }
252 void set_root_location(const gfx::PointF& root_location) { 252 void set_root_location(const gfx::PointF& root_location) {
253 root_location_ = root_location; 253 root_location_ = root_location;
254 } 254 }
255 gfx::Point root_location() const { 255 gfx::Point root_location() const {
256 return gfx::ToFlooredPoint(root_location_); 256 return gfx::ToFlooredPoint(root_location_);
257 } 257 }
258 const gfx::PointF& root_location_f() const {
259 return root_location_;
260 }
258 261
259 // Transform the locations using |inverted_root_transform|. 262 // Transform the locations using |inverted_root_transform|.
260 // This is applied to both |location_| and |root_location_|. 263 // This is applied to both |location_| and |root_location_|.
261 virtual void UpdateForRootTransform( 264 virtual void UpdateForRootTransform(
262 const gfx::Transform& inverted_root_transform); 265 const gfx::Transform& inverted_root_transform);
263 266
264 template <class T> void ConvertLocationToTarget(T* source, T* target) { 267 template <class T> void ConvertLocationToTarget(T* source, T* target) {
265 if (!target || target == source) 268 if (!target || target == source)
266 return; 269 return;
267 // TODO(tdresser): Rewrite ConvertPointToTarget to use PointF. See 270 // TODO(tdresser): Rewrite ConvertPointToTarget to use PointF. See
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 // The set of indices of ones in the binary representation of 673 // The set of indices of ones in the binary representation of
671 // touch_ids_bitfield_ is the set of touch_ids associate with this gesture. 674 // touch_ids_bitfield_ is the set of touch_ids associate with this gesture.
672 // This value is stored as a bitfield because the number of touch ids varies, 675 // This value is stored as a bitfield because the number of touch ids varies,
673 // but we currently don't need more than 32 touches at a time. 676 // but we currently don't need more than 32 touches at a time.
674 const unsigned int touch_ids_bitfield_; 677 const unsigned int touch_ids_bitfield_;
675 }; 678 };
676 679
677 } // namespace ui 680 } // namespace ui
678 681
679 #endif // UI_EVENTS_EVENT_H_ 682 #endif // UI_EVENTS_EVENT_H_
OLDNEW
« no previous file with comments | « ui/events/BUILD.gn ('k') | ui/events/events.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698