Commit dbc446be authored by Katie D's avatar Katie D Committed by Commit Bot

Select-to-Speak's event handler should only be called when STS is enabled.

Changes a "if" to a "DCHECK".

Change-Id: I17cbe0efee059bbc76ca85cacd395f57b1ac41a2
Reviewed-on: https://chromium-review.googlesource.com/1178224Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Commit-Queue: Katie Dektar <katie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583812}
parent f9eefb85
......@@ -92,9 +92,7 @@ bool SelectToSpeakEventHandler::IsSelectToSpeakEnabled() {
}
void SelectToSpeakEventHandler::OnKeyEvent(ui::KeyEvent* event) {
if (!IsSelectToSpeakEnabled())
return;
DCHECK(IsSelectToSpeakEnabled());
DCHECK(event);
// We can only call TtsController on the UI thread, make sure we
......@@ -163,9 +161,7 @@ void SelectToSpeakEventHandler::OnKeyEvent(ui::KeyEvent* event) {
}
void SelectToSpeakEventHandler::OnMouseEvent(ui::MouseEvent* event) {
if (!IsSelectToSpeakEnabled())
return;
DCHECK(IsSelectToSpeakEnabled());
DCHECK(event);
if (state_ == INACTIVE) {
if (event->type() == ui::ET_MOUSE_PRESSED) {
......@@ -209,9 +205,7 @@ void SelectToSpeakEventHandler::OnMouseEvent(ui::MouseEvent* event) {
}
void SelectToSpeakEventHandler::OnTouchEvent(ui::TouchEvent* event) {
if (!IsSelectToSpeakEnabled())
return;
DCHECK(IsSelectToSpeakEnabled());
DCHECK(event);
if (state_ == INACTIVE && event->type() == ui::ET_TOUCH_PRESSED) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment