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

Side by Side Diff: ui/events/test/event_generator.h

Issue 1975533002: Change ui::Event::time_stamp from TimeDelta to TimeTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
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 #ifndef UI_EVENTS_TEST_EVENT_GENERATOR_H_ 5 #ifndef UI_EVENTS_TEST_EVENT_GENERATOR_H_
6 #define UI_EVENTS_TEST_EVENT_GENERATOR_H_ 6 #define UI_EVENTS_TEST_EVENT_GENERATOR_H_
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 void Dispatch(Event* event); 365 void Dispatch(Event* event);
366 366
367 void set_current_target(EventTarget* target) { 367 void set_current_target(EventTarget* target) {
368 current_target_ = target; 368 current_target_ = target;
369 } 369 }
370 370
371 // Specify an alternative tick clock to be used for simulating time in tests. 371 // Specify an alternative tick clock to be used for simulating time in tests.
372 void SetTickClock(std::unique_ptr<base::TickClock> tick_clock); 372 void SetTickClock(std::unique_ptr<base::TickClock> tick_clock);
373 373
374 // Get the current time from the tick clock. 374 // Get the current time from the tick clock.
375 base::TimeDelta Now(); 375 base::TimeTicks Now();
376 376
377 // Default delegate set by a platform-specific GeneratorDelegate singleton. 377 // Default delegate set by a platform-specific GeneratorDelegate singleton.
378 static EventGeneratorDelegate* default_delegate; 378 static EventGeneratorDelegate* default_delegate;
379 379
380 private: 380 private:
381 // Set up the test context using the delegate. 381 // Set up the test context using the delegate.
382 void Init(gfx::NativeWindow root_window, gfx::NativeWindow window_context); 382 void Init(gfx::NativeWindow root_window, gfx::NativeWindow window_context);
383 383
384 // Dispatch a key event to the WindowEventDispatcher. 384 // Dispatch a key event to the WindowEventDispatcher.
385 void DispatchKeyEvent(bool is_press, KeyboardCode key_code, int flags); 385 void DispatchKeyEvent(bool is_press, KeyboardCode key_code, int flags);
(...skipping 22 matching lines...) Expand all
408 bool targeting_application_; 408 bool targeting_application_;
409 std::unique_ptr<base::TickClock> tick_clock_; 409 std::unique_ptr<base::TickClock> tick_clock_;
410 410
411 DISALLOW_COPY_AND_ASSIGN(EventGenerator); 411 DISALLOW_COPY_AND_ASSIGN(EventGenerator);
412 }; 412 };
413 413
414 } // namespace test 414 } // namespace test
415 } // namespace ui 415 } // namespace ui
416 416
417 #endif // UI_EVENTS_TEST_EVENT_GENERATOR_H_ 417 #endif // UI_EVENTS_TEST_EVENT_GENERATOR_H_
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/touch_noise/touch_noise_finder_unittest.cc ('k') | ui/events/test/event_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698