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

Side by Side Diff: ui/events/test/mock_motion_event.cc

Issue 659713003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify Created 6 years, 2 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
« no previous file with comments | « ui/events/ozone/evdev/event_factory_evdev.cc ('k') | ui/gfx/geometry/r_tree_base.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/test/mock_motion_event.h" 5 #include "ui/events/test/mock_motion_event.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 using base::TimeTicks; 9 using base::TimeTicks;
10 10
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 MockMotionEvent::~MockMotionEvent() {} 88 MockMotionEvent::~MockMotionEvent() {}
89 89
90 scoped_ptr<MotionEvent> MockMotionEvent::Clone() const { 90 scoped_ptr<MotionEvent> MockMotionEvent::Clone() const {
91 return scoped_ptr<MotionEvent>(new MockMotionEvent(*this)); 91 return scoped_ptr<MotionEvent>(new MockMotionEvent(*this));
92 } 92 }
93 93
94 scoped_ptr<MotionEvent> MockMotionEvent::Cancel() const { 94 scoped_ptr<MotionEvent> MockMotionEvent::Cancel() const {
95 scoped_ptr<MockMotionEvent> event(new MockMotionEvent(*this)); 95 scoped_ptr<MockMotionEvent> event(new MockMotionEvent(*this));
96 event->set_action(MotionEvent::ACTION_CANCEL); 96 event->set_action(MotionEvent::ACTION_CANCEL);
97 return event.PassAs<MotionEvent>(); 97 return event.Pass();
98 } 98 }
99 99
100 void MockMotionEvent::PressPoint(float x, float y) { 100 void MockMotionEvent::PressPoint(float x, float y) {
101 ResolvePointers(); 101 ResolvePointers();
102 PushPointer(x, y); 102 PushPointer(x, y);
103 if (GetPointerCount() > 1) { 103 if (GetPointerCount() > 1) {
104 set_action_index(static_cast<int>(GetPointerCount()) - 1); 104 set_action_index(static_cast<int>(GetPointerCount()) - 1);
105 set_action(ACTION_POINTER_DOWN); 105 set_action(ACTION_POINTER_DOWN);
106 } else { 106 } else {
107 set_action(ACTION_DOWN); 107 set_action(ACTION_DOWN);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 case ACTION_CANCEL: 168 case ACTION_CANCEL:
169 PopPointer(); 169 PopPointer();
170 return; 170 return;
171 default: 171 default:
172 break; 172 break;
173 } 173 }
174 } 174 }
175 175
176 } // namespace test 176 } // namespace test
177 } // namespace ui 177 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/event_factory_evdev.cc ('k') | ui/gfx/geometry/r_tree_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698