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 3 // found in the LICENSE file. 4 5 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" 6 7 #include "ash/shell.h" 8 #include "base/logging.h" 9 #include "ui/events/event.h" 10 11 namespace chromeos { 12 13 InputEventsBlocker::InputEventsBlocker() { 14 #if !defined(USE_ATHENA) 15 // TODO(dpolukhin): crbug.com/411884 16 ash::Shell::GetInstance()->PrependPreTargetHandler(this); 17 #endif 18 VLOG(1) << "InputEventsBlocker " << this << " created."; 19 } 20 21 InputEventsBlocker::~InputEventsBlocker() { 22 #if !defined(USE_ATHENA) 23 // TODO(dpolukhin): crbug.com/411884 24 ash::Shell::GetInstance()->RemovePreTargetHandler(this); 25 #endif 26 VLOG(1) << "InputEventsBlocker " << this << " destroyed."; 27 } 28 29 void InputEventsBlocker::OnKeyEvent(ui::KeyEvent* event) { 30 event->StopPropagation(); 31 } 32 33 void InputEventsBlocker::OnMouseEvent(ui::MouseEvent* event) { 34 event->StopPropagation(); 35 } 36 37 void InputEventsBlocker::OnTouchEvent(ui::TouchEvent* event) { 38 event->StopPropagation(); 39 } 40 41 void InputEventsBlocker::OnGestureEvent(ui::GestureEvent* event) { 42 event->StopPropagation(); 43 } 44 45 } // namespace chromeos 46