| OLD | NEW |
| 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 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" | 5 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/ui/ash/ash_util.h" |
| 9 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| 10 | 11 |
| 11 namespace chromeos { | 12 namespace chromeos { |
| 12 | 13 |
| 13 InputEventsBlocker::InputEventsBlocker() { | 14 InputEventsBlocker::InputEventsBlocker() { |
| 14 ash::Shell::GetInstance()->PrependPreTargetHandler(this); | 15 // TODO(mash): Implement a mash version. This will probably need to talk to |
| 15 VLOG(1) << "InputEventsBlocker " << this << " created."; | 16 // the window server. |
| 17 if (!chrome::IsRunningInMash()) { |
| 18 ash::Shell::GetInstance()->PrependPreTargetHandler(this); |
| 19 VLOG(1) << "InputEventsBlocker " << this << " created."; |
| 20 } else { |
| 21 NOTIMPLEMENTED(); |
| 22 } |
| 16 } | 23 } |
| 17 | 24 |
| 18 InputEventsBlocker::~InputEventsBlocker() { | 25 InputEventsBlocker::~InputEventsBlocker() { |
| 19 ash::Shell::GetInstance()->RemovePreTargetHandler(this); | 26 if (!chrome::IsRunningInMash()) { |
| 20 VLOG(1) << "InputEventsBlocker " << this << " destroyed."; | 27 ash::Shell::GetInstance()->RemovePreTargetHandler(this); |
| 28 VLOG(1) << "InputEventsBlocker " << this << " destroyed."; |
| 29 } else { |
| 30 NOTIMPLEMENTED(); |
| 31 } |
| 21 } | 32 } |
| 22 | 33 |
| 23 void InputEventsBlocker::OnKeyEvent(ui::KeyEvent* event) { | 34 void InputEventsBlocker::OnKeyEvent(ui::KeyEvent* event) { |
| 24 event->StopPropagation(); | 35 event->StopPropagation(); |
| 25 } | 36 } |
| 26 | 37 |
| 27 void InputEventsBlocker::OnMouseEvent(ui::MouseEvent* event) { | 38 void InputEventsBlocker::OnMouseEvent(ui::MouseEvent* event) { |
| 28 event->StopPropagation(); | 39 event->StopPropagation(); |
| 29 } | 40 } |
| 30 | 41 |
| 31 void InputEventsBlocker::OnTouchEvent(ui::TouchEvent* event) { | 42 void InputEventsBlocker::OnTouchEvent(ui::TouchEvent* event) { |
| 32 event->StopPropagation(); | 43 event->StopPropagation(); |
| 33 } | 44 } |
| 34 | 45 |
| 35 void InputEventsBlocker::OnGestureEvent(ui::GestureEvent* event) { | 46 void InputEventsBlocker::OnGestureEvent(ui::GestureEvent* event) { |
| 36 event->StopPropagation(); | 47 event->StopPropagation(); |
| 37 } | 48 } |
| 38 | 49 |
| 39 } // namespace chromeos | 50 } // namespace chromeos |
| OLD | NEW |