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

Unified Diff: ui/events/test/event_generator.h

Issue 2505943002: MacViews: Fix accelerator handling while Omnibox is in focus. (Closed)
Patch Set: Fix review issues. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/events/test/event_generator.cc » ('j') | ui/views/cocoa/bridged_content_view.mm » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/test/event_generator.h
diff --git a/ui/events/test/event_generator.h b/ui/events/test/event_generator.h
index f91143662e94f5e7867bc2a9c90438c4087e187c..ba2ec364187df7708de800cf6c0031fe74720dc4 100644
--- a/ui/events/test/event_generator.h
+++ b/ui/events/test/event_generator.h
@@ -134,12 +134,22 @@ class EventGenerator {
void set_async(bool async) { async_ = async; }
bool async() const { return async_; }
- // Dispatch events through the application instead of directly to the
- // target window. Currently only supported on Mac.
- void set_targeting_application(bool targeting_application) {
- targeting_application_ = targeting_application;
- }
- bool targeting_application() const { return targeting_application_; }
+ // Events could be dispatched using different methods. The choice is a
+ // tradeoff between test robustness and coverage of OS internals that affect
+ // event dispatch.
+ // Currently only supported on Mac.
+ enum class Target {
+ // Dispatch through the application. Least robust.
+ APPLICATION,
+ // Dispatch directly to target window.
+ WINDOW,
+ // Default. Emulates default Window dispatch. Most robust.
+ WIDGET,
+ };
+
+ // Selects dispatch method. Currently only supported on Mac.
+ void set_target(Target target) { target_ = target; }
+ Target target() const { return target_; }
// Resets the event flags bitmask.
void set_flags(int flags) { flags_ = flags; }
@@ -410,7 +420,7 @@ class EventGenerator {
std::list<std::unique_ptr<Event>> pending_events_;
// Set to true to cause events to be posted asynchronously.
bool async_;
- bool targeting_application_;
+ Target target_;
std::unique_ptr<base::TickClock> tick_clock_;
DISALLOW_COPY_AND_ASSIGN(EventGenerator);
« no previous file with comments | « no previous file | ui/events/test/event_generator.cc » ('j') | ui/views/cocoa/bridged_content_view.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698