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

Unified Diff: chrome/browser/chromeos/accessibility/select_to_speak_event_handler.h

Issue 2883283003: Revert of Refactor Select-to-speak so that mouse events are forwarded to the extension. (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/accessibility/select_to_speak_event_handler.h
diff --git a/chrome/browser/chromeos/accessibility/select_to_speak_event_handler.h b/chrome/browser/chromeos/accessibility/select_to_speak_event_handler.h
index 21dbef0f1632e42fe62fc8cbe0a911520c9e8530..048e2cf83d5055ca4fa458efd3a069db383b8438 100644
--- a/chrome/browser/chromeos/accessibility/select_to_speak_event_handler.h
+++ b/chrome/browser/chromeos/accessibility/select_to_speak_event_handler.h
@@ -13,12 +13,6 @@
namespace chromeos {
-class SelectToSpeakForwardedEventDelegateForTesting {
- public:
- virtual void OnForwardEventToSelectToSpeakExtension(
- const ui::MouseEvent& event) = 0;
-};
-
// Intercepts mouse events while the Search key is held down, and sends
// accessibility events to the Select-to-speak extension instead.
class SelectToSpeakEventHandler : public ui::EventHandler {
@@ -26,17 +20,13 @@
SelectToSpeakEventHandler();
~SelectToSpeakEventHandler() override;
- // For testing, call the provided callback with any events that would have
- // been forwarded to the Select-to-speak extension instead.
- void CaptureForwardedEventsForTesting(
- SelectToSpeakForwardedEventDelegateForTesting* delegate);
-
private:
// EventHandler:
void OnKeyEvent(ui::KeyEvent* event) override;
void OnMouseEvent(ui::MouseEvent* event) override;
void CancelEvent(ui::Event* event);
+ void SendCancelAXEvent();
enum State {
// Neither the Search key nor the mouse button are down.
@@ -65,7 +55,12 @@
State state_ = INACTIVE;
- SelectToSpeakForwardedEventDelegateForTesting* event_delegate_for_testing_;
+ // The set of keys that are currently down. Updated whenever a key is
+ // pressed or released.
+ std::set<ui::KeyboardCode> keys_currently_down_;
+ // The set of keys that have been pressed together. Updated whenever a key
+ // is pressed, and only cleared when all keys are released.
+ std::set<ui::KeyboardCode> keys_pressed_together_;
DISALLOW_COPY_AND_ASSIGN(SelectToSpeakEventHandler);
};
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/accessibility/select_to_speak_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698