Index: ash/wm/tablet_mode/tablet_mode_event_handler_aura.cc |
diff --git a/ash/wm/tablet_mode/tablet_mode_event_handler_aura.cc b/ash/wm/tablet_mode/tablet_mode_event_handler_aura.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e3263585fe0f918b45d1accbb4964be88d6cfdb8 |
--- /dev/null |
+++ b/ash/wm/tablet_mode/tablet_mode_event_handler_aura.cc |
@@ -0,0 +1,27 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "ash/wm/tablet_mode/tablet_mode_event_handler_aura.h" |
+ |
+#include "ash/shell.h" |
+#include "ui/events/event.h" |
+ |
+namespace ash { |
+namespace wm { |
+ |
+TabletModeEventHandlerAura::TabletModeEventHandlerAura() { |
+ Shell::Get()->AddPreTargetHandler(this); |
+} |
+ |
+TabletModeEventHandlerAura::~TabletModeEventHandlerAura() { |
+ Shell::Get()->RemovePreTargetHandler(this); |
+} |
+ |
+void TabletModeEventHandlerAura::OnTouchEvent(ui::TouchEvent* event) { |
+ if (ToggleFullscreen(*event)) |
+ event->StopPropagation(); |
+} |
+ |
+} // namespace wm |
+} // namespace ash |