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

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

Issue 2454323002: MacViews: Reveal scrollbars when resting on the trackpad. (Closed)
Patch Set: rebase for r432358 Created 4 years, 1 month 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
« no previous file with comments | « ui/events/event.h ('k') | ui/events/test/event_generator.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) 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/events/event.h" 5 #include "ui/events/event.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 10
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after
1381 } 1381 }
1382 1382
1383 ScrollEvent::ScrollEvent(EventType type, 1383 ScrollEvent::ScrollEvent(EventType type,
1384 const gfx::Point& location, 1384 const gfx::Point& location,
1385 base::TimeTicks time_stamp, 1385 base::TimeTicks time_stamp,
1386 int flags, 1386 int flags,
1387 float x_offset, 1387 float x_offset,
1388 float y_offset, 1388 float y_offset,
1389 float x_offset_ordinal, 1389 float x_offset_ordinal,
1390 float y_offset_ordinal, 1390 float y_offset_ordinal,
1391 int finger_count) 1391 int finger_count,
1392 EventMomentumPhase momentum_phase)
1392 : MouseEvent(type, location, location, time_stamp, flags, 0), 1393 : MouseEvent(type, location, location, time_stamp, flags, 0),
1393 x_offset_(x_offset), 1394 x_offset_(x_offset),
1394 y_offset_(y_offset), 1395 y_offset_(y_offset),
1395 x_offset_ordinal_(x_offset_ordinal), 1396 x_offset_ordinal_(x_offset_ordinal),
1396 y_offset_ordinal_(y_offset_ordinal), 1397 y_offset_ordinal_(y_offset_ordinal),
1397 finger_count_(finger_count) { 1398 finger_count_(finger_count),
1399 momentum_phase_(momentum_phase) {
1398 CHECK(IsScrollEvent()); 1400 CHECK(IsScrollEvent());
1399 latency()->set_source_event_type(ui::SourceEventType::WHEEL); 1401 latency()->set_source_event_type(ui::SourceEventType::WHEEL);
1400 } 1402 }
1401 1403
1402 void ScrollEvent::Scale(const float factor) { 1404 void ScrollEvent::Scale(const float factor) {
1403 x_offset_ *= factor; 1405 x_offset_ *= factor;
1404 y_offset_ *= factor; 1406 y_offset_ *= factor;
1405 x_offset_ordinal_ *= factor; 1407 x_offset_ordinal_ *= factor;
1406 y_offset_ordinal_ *= factor; 1408 y_offset_ordinal_ *= factor;
1407 } 1409 }
(...skipping 14 matching lines...) Expand all
1422 flags | EF_FROM_TOUCH), 1424 flags | EF_FROM_TOUCH),
1423 details_(details), 1425 details_(details),
1424 unique_touch_event_id_(unique_touch_event_id) { 1426 unique_touch_event_id_(unique_touch_event_id) {
1425 latency()->set_source_event_type(ui::SourceEventType::TOUCH); 1427 latency()->set_source_event_type(ui::SourceEventType::TOUCH);
1426 } 1428 }
1427 1429
1428 GestureEvent::~GestureEvent() { 1430 GestureEvent::~GestureEvent() {
1429 } 1431 }
1430 1432
1431 } // namespace ui 1433 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/event.h ('k') | ui/events/test/event_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698