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

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

Issue 793003004: MacViews: Implement event monitoring for a specific window (Reland) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Created 6 years 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
« no previous file with comments | « ui/aura/test/event_generator_delegate_aura.cc ('k') | ui/events/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 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
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // various methods that take a location but can be manipulated directly, 122 // various methods that take a location but can be manipulated directly,
123 // typically for touch. 123 // typically for touch.
124 void set_current_location(const gfx::Point& location) { 124 void set_current_location(const gfx::Point& location) {
125 current_location_ = location; 125 current_location_ = location;
126 } 126 }
127 const gfx::Point& current_location() const { return current_location_; } 127 const gfx::Point& current_location() const { return current_location_; }
128 128
129 void set_async(bool async) { async_ = async; } 129 void set_async(bool async) { async_ = async; }
130 bool async() const { return async_; } 130 bool async() const { return async_; }
131 131
132 // Dispatch events through the application instead of directly to the
133 // target window. Currently only supported on Mac.
134 void set_targeting_application(bool targeting_application) {
135 targeting_application_ = targeting_application;
136 }
137 bool targeting_application() const { return targeting_application_; }
138
132 // Resets the event flags bitmask. 139 // Resets the event flags bitmask.
133 void set_flags(int flags) { flags_ = flags; } 140 void set_flags(int flags) { flags_ = flags; }
134 int flags() const { return flags_; } 141 int flags() const { return flags_; }
135 142
136 // Generates a left button press event. 143 // Generates a left button press event.
137 void PressLeftButton(); 144 void PressLeftButton();
138 145
139 // Generates a left button release event. 146 // Generates a left button release event.
140 void ReleaseLeftButton(); 147 void ReleaseLeftButton();
141 148
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 EventGeneratorDelegate* delegate(); 383 EventGeneratorDelegate* delegate();
377 384
378 scoped_ptr<EventGeneratorDelegate> delegate_; 385 scoped_ptr<EventGeneratorDelegate> delegate_;
379 gfx::Point current_location_; 386 gfx::Point current_location_;
380 EventTarget* current_target_; 387 EventTarget* current_target_;
381 int flags_; 388 int flags_;
382 bool grab_; 389 bool grab_;
383 std::list<Event*> pending_events_; 390 std::list<Event*> pending_events_;
384 // Set to true to cause events to be posted asynchronously. 391 // Set to true to cause events to be posted asynchronously.
385 bool async_; 392 bool async_;
393 bool targeting_application_;
386 scoped_ptr<base::TickClock> tick_clock_; 394 scoped_ptr<base::TickClock> tick_clock_;
387 395
388 DISALLOW_COPY_AND_ASSIGN(EventGenerator); 396 DISALLOW_COPY_AND_ASSIGN(EventGenerator);
389 }; 397 };
390 398
391 } // namespace test 399 } // namespace test
392 } // namespace ui 400 } // namespace ui
393 401
394 #endif // UI_EVENTS_TEST_EVENT_GENERATOR_H_ 402 #endif // UI_EVENTS_TEST_EVENT_GENERATOR_H_
OLDNEW
« no previous file with comments | « ui/aura/test/event_generator_delegate_aura.cc ('k') | ui/events/test/event_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698