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

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

Issue 2505943002: MacViews: Fix accelerator handling while Omnibox is in focus. (Closed)
Patch Set: Remove performKeyEquivalent:, update keyDown:, add tests. 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.h » ('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 d889f69807ff4651f0ac8fd36fe626969c0cefa0..6a897581e1428582f2429c86fa99341f850e8545 100644
--- a/ui/events/test/event_generator.h
+++ b/ui/events/test/event_generator.h
@@ -138,12 +138,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;
+ // Events could be dispatched using different methods.
tapted 2016/11/18 07:28:04 I'd add a sentence like "The choice is a tradeoff
themblsha 2016/11/18 13:31:50 Done.
+ // Currently only supported on Mac.
+ enum class Target {
+ // Dispatch through the application.
tapted 2016/11/18 07:28:04 "Least robust."
themblsha 2016/11/18 13:31:50 Done.
+ APPLICATION,
+ // Dispatch directly to target window.
+ WINDOW,
+ // Default. Emulates default Window dispatch.
tapted 2016/11/18 07:28:04 "Most robust."
themblsha 2016/11/18 13:31:50 Done.
+ WIDGET,
+ };
+
+ // Selects dispatch method. Currently only supported on Mac.
+ void set_target(Target target) {
+ target_ = target;
}
- bool targeting_application() const { return targeting_application_; }
+ Target target() const { return target_; }
// Resets the event flags bitmask.
void set_flags(int flags) { flags_ = flags; }
@@ -405,7 +415,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.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698