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

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

Issue 296403011: Support double-tap to click in touch accessibility controller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 | « no previous file | ui/aura/test/event_generator.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 (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_AURA_TEST_EVENT_GENERATOR_H_ 5 #ifndef UI_AURA_TEST_EVENT_GENERATOR_H_
6 #define UI_AURA_TEST_EVENT_GENERATOR_H_ 6 #define UI_AURA_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 "ui/events/event_constants.h" 15 #include "ui/events/event_constants.h"
15 #include "ui/events/keycodes/keyboard_codes.h" 16 #include "ui/events/keycodes/keyboard_codes.h"
16 #include "ui/gfx/point.h" 17 #include "ui/gfx/point.h"
17 18
18 namespace base {
19 class TimeDelta;
20 }
21
22 namespace ui { 19 namespace ui {
23 class Event; 20 class Event;
24 class EventProcessor; 21 class EventProcessor;
25 class KeyEvent; 22 class KeyEvent;
26 class MouseEvent; 23 class MouseEvent;
27 class ScrollEvent; 24 class ScrollEvent;
28 class TouchEvent; 25 class TouchEvent;
29 } 26 }
30 27
31 namespace aura { 28 namespace aura {
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 // TODO(yusukes): Support native_event() on all platforms. 307 // TODO(yusukes): Support native_event() on all platforms.
311 void ReleaseKey(ui::KeyboardCode key_code, int flags); 308 void ReleaseKey(ui::KeyboardCode key_code, int flags);
312 309
313 // Dispatch the event to the WindowEventDispatcher. 310 // Dispatch the event to the WindowEventDispatcher.
314 void Dispatch(ui::Event* event); 311 void Dispatch(ui::Event* event);
315 312
316 void set_current_host(WindowTreeHost* host) { 313 void set_current_host(WindowTreeHost* host) {
317 current_host_ = host; 314 current_host_ = host;
318 } 315 }
319 316
317 // If this is called, simulated time will be used as the time for all
318 // events, rather than the current time.
319 void UseSimulatedTime();
sky 2014/06/06 16:35:25 Instead of UseSimulateTime/Advance... how about a
320
321 // If UseSimulatedTime has been called, advance the simulated time by
322 // the given delta.
323 void AdvanceSimulatedTimeBy(base::TimeDelta delta);
324
325 // Return the current time - if UseSimulatedTime was called, it will return
326 // the current simulated time, otherwise the real wall-clock time.
327 base::TimeDelta Now();
328
320 private: 329 private:
321 // Dispatch a key event to the WindowEventDispatcher. 330 // Dispatch a key event to the WindowEventDispatcher.
322 void DispatchKeyEvent(bool is_press, ui::KeyboardCode key_code, int flags); 331 void DispatchKeyEvent(bool is_press, ui::KeyboardCode key_code, int flags);
323 332
324 void UpdateCurrentDispatcher(const gfx::Point& point); 333 void UpdateCurrentDispatcher(const gfx::Point& point);
325 void PressButton(int flag); 334 void PressButton(int flag);
326 void ReleaseButton(int flag); 335 void ReleaseButton(int flag);
327 336
328 // Convert a point between API's coordinates and 337 // Convert a point between API's coordinates and
329 // |target|'s coordinates. 338 // |target|'s coordinates.
330 void ConvertPointFromTarget(const aura::Window* target, 339 void ConvertPointFromTarget(const aura::Window* target,
331 gfx::Point* point) const; 340 gfx::Point* point) const;
332 void ConvertPointToTarget(const aura::Window* target, 341 void ConvertPointToTarget(const aura::Window* target,
333 gfx::Point* point) const; 342 gfx::Point* point) const;
334 343
335 gfx::Point GetLocationInCurrentRoot() const; 344 gfx::Point GetLocationInCurrentRoot() const;
336 gfx::Point CenterOfWindow(const Window* window) const; 345 gfx::Point CenterOfWindow(const Window* window) const;
337 346
338 void DispatchNextPendingEvent(); 347 void DispatchNextPendingEvent();
339 void DoDispatchEvent(ui::Event* event, bool async); 348 void DoDispatchEvent(ui::Event* event, bool async);
340 349
341 scoped_ptr<EventGeneratorDelegate> delegate_; 350 scoped_ptr<EventGeneratorDelegate> delegate_;
342 gfx::Point current_location_; 351 gfx::Point current_location_;
343 WindowTreeHost* current_host_; 352 WindowTreeHost* current_host_;
344 int flags_; 353 int flags_;
345 bool grab_; 354 bool grab_;
346 std::list<ui::Event*> pending_events_; 355 std::list<ui::Event*> pending_events_;
347 // Set to true to cause events to be posted asynchronously. 356 // Set to true to cause events to be posted asynchronously.
348 bool async_; 357 bool async_;
358 bool use_simulated_time_;
359 base::TimeDelta simulated_time_;
349 360
350 DISALLOW_COPY_AND_ASSIGN(EventGenerator); 361 DISALLOW_COPY_AND_ASSIGN(EventGenerator);
351 }; 362 };
352 363
353 } // namespace test 364 } // namespace test
354 } // namespace aura 365 } // namespace aura
355 366
356 #endif // UI_AURA_TEST_EVENT_GENERATOR_H_ 367 #endif // UI_AURA_TEST_EVENT_GENERATOR_H_
OLDNEW
« no previous file with comments | « no previous file | ui/aura/test/event_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698