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

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

Issue 1185753008: Proposed alternative for supporting ChromeVox keyboard commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/time/time.h" 14 #include "base/time/time.h"
15 #include "ui/events/event_constants.h" 15 #include "ui/events/event_constants.h"
16 #include "ui/events/keycodes/keyboard_codes.h" 16 #include "ui/events/keycodes/keyboard_codes.h"
17 #include "ui/gfx/geometry/point.h" 17 #include "ui/gfx/geometry/point.h"
18 #include "ui/gfx/native_widget_types.h" 18 #include "ui/gfx/native_widget_types.h"
19 19
20 namespace base { 20 namespace base {
21 class TickClock; 21 class TickClock;
22 } 22 }
23 23
24 namespace ui { 24 namespace ui {
25 class Event; 25 class Event;
26 class EventProcessor; 26 class EventProcessor;
27 class EventRewriter;
27 class EventSource; 28 class EventSource;
28 class EventTarget; 29 class EventTarget;
29 class KeyEvent; 30 class KeyEvent;
30 class MouseEvent; 31 class MouseEvent;
31 class ScrollEvent; 32 class ScrollEvent;
32 class TouchEvent; 33 class TouchEvent;
33 34
34 namespace test { 35 namespace test {
35 36
36 typedef base::Callback<void(EventType, const gfx::Vector2dF&)> 37 typedef base::Callback<void(EventType, const gfx::Vector2dF&)>
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 343
343 // Generates a key release event. On platforms except Windows and X11, a key 344 // Generates a key release event. On platforms except Windows and X11, a key
344 // event without native_event() is generated. Note that ui::EF_ flags should 345 // event without native_event() is generated. Note that ui::EF_ flags should
345 // be passed as |flags|, not the native ones like 'ShiftMask' in <X11/X.h>. 346 // be passed as |flags|, not the native ones like 'ShiftMask' in <X11/X.h>.
346 // TODO(yusukes): Support native_event() on all platforms. 347 // TODO(yusukes): Support native_event() on all platforms.
347 void ReleaseKey(KeyboardCode key_code, int flags); 348 void ReleaseKey(KeyboardCode key_code, int flags);
348 349
349 // Dispatch the event to the WindowEventDispatcher. 350 // Dispatch the event to the WindowEventDispatcher.
350 void Dispatch(Event* event); 351 void Dispatch(Event* event);
351 352
353 // Add an EventRewriter to the currentEventSource.
sadrul 2015/06/24 18:31:02 What is currentEventSource?
David Tseng 2015/06/24 19:09:54 Obsolete.
354 void AddEventRewriter(ui::EventRewriter* event_rewriter);
355
356 // Remove an EventRewriter from the currentEventSource.
357 void RemoveEventRewriter(ui::EventRewriter* event_rewriter);
358
352 void set_current_target(EventTarget* target) { 359 void set_current_target(EventTarget* target) {
353 current_target_ = target; 360 current_target_ = target;
354 } 361 }
355 362
356 // Specify an alternative tick clock to be used for simulating time in tests. 363 // Specify an alternative tick clock to be used for simulating time in tests.
357 void SetTickClock(scoped_ptr<base::TickClock> tick_clock); 364 void SetTickClock(scoped_ptr<base::TickClock> tick_clock);
358 365
359 // Get the current time from the tick clock. 366 // Get the current time from the tick clock.
360 base::TimeDelta Now(); 367 base::TimeDelta Now();
361 368
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 bool targeting_application_; 400 bool targeting_application_;
394 scoped_ptr<base::TickClock> tick_clock_; 401 scoped_ptr<base::TickClock> tick_clock_;
395 402
396 DISALLOW_COPY_AND_ASSIGN(EventGenerator); 403 DISALLOW_COPY_AND_ASSIGN(EventGenerator);
397 }; 404 };
398 405
399 } // namespace test 406 } // namespace test
400 } // namespace ui 407 } // namespace ui
401 408
402 #endif // UI_EVENTS_TEST_EVENT_GENERATOR_H_ 409 #endif // UI_EVENTS_TEST_EVENT_GENERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698