| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/host/ash_window_tree_host_platform.h" | 5 #include "ash/host/ash_window_tree_host_platform.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/host/root_window_transformer.h" | 9 #include "ash/host/root_window_transformer.h" |
| 10 #include "ash/host/transformer_helper.h" | 10 #include "ash/host/transformer_helper.h" |
| 11 #include "ash/ime/input_method_event_handler.h" | 11 #include "ash/ime/input_method_event_handler.h" |
| 12 #include "base/trace_event/trace_event.h" | 12 #include "base/trace_event/trace_event.h" |
| 13 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
| 14 #include "ui/aura/window_tree_host_platform.h" | 14 #include "ui/aura/window_tree_host_platform.h" |
| 15 #include "ui/events/event_processor.h" | 15 #include "ui/events/event_sink.h" |
| 16 #include "ui/events/null_event_targeter.h" | 16 #include "ui/events/null_event_targeter.h" |
| 17 #include "ui/gfx/geometry/insets.h" | 17 #include "ui/gfx/geometry/insets.h" |
| 18 #include "ui/gfx/transform.h" | 18 #include "ui/gfx/transform.h" |
| 19 #include "ui/platform_window/platform_window.h" | 19 #include "ui/platform_window/platform_window.h" |
| 20 | 20 |
| 21 #if defined(USE_OZONE) | 21 #if defined(USE_OZONE) |
| 22 #include "ui/ozone/public/input_controller.h" | 22 #include "ui/ozone/public/input_controller.h" |
| 23 #include "ui/ozone/public/ozone_platform.h" | 23 #include "ui/ozone/public/ozone_platform.h" |
| 24 #endif | 24 #endif |
| 25 | 25 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 void AshWindowTreeHostPlatform::SetBoundsInPixels(const gfx::Rect& bounds) { | 106 void AshWindowTreeHostPlatform::SetBoundsInPixels(const gfx::Rect& bounds) { |
| 107 WindowTreeHostPlatform::SetBoundsInPixels(bounds); | 107 WindowTreeHostPlatform::SetBoundsInPixels(bounds); |
| 108 ConfineCursorToRootWindow(); | 108 ConfineCursorToRootWindow(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void AshWindowTreeHostPlatform::DispatchEvent(ui::Event* event) { | 111 void AshWindowTreeHostPlatform::DispatchEvent(ui::Event* event) { |
| 112 TRACE_EVENT0("input", "AshWindowTreeHostPlatform::DispatchEvent"); | 112 TRACE_EVENT0("input", "AshWindowTreeHostPlatform::DispatchEvent"); |
| 113 if (event->IsLocatedEvent()) | 113 if (event->IsLocatedEvent()) |
| 114 TranslateLocatedEvent(static_cast<ui::LocatedEvent*>(event)); | 114 TranslateLocatedEvent(static_cast<ui::LocatedEvent*>(event)); |
| 115 SendEventToProcessor(event); | 115 SendEventToSink(event); |
| 116 } | 116 } |
| 117 | 117 |
| 118 ui::EventDispatchDetails AshWindowTreeHostPlatform::DispatchKeyEventPostIME( | 118 ui::EventDispatchDetails AshWindowTreeHostPlatform::DispatchKeyEventPostIME( |
| 119 ui::KeyEvent* event) { | 119 ui::KeyEvent* event) { |
| 120 input_method_handler()->SetPostIME(true); | 120 input_method_handler()->SetPostIME(true); |
| 121 ui::EventDispatchDetails details = | 121 ui::EventDispatchDetails details = event_sink()->OnEventFromSource(event); |
| 122 event_processor()->OnEventFromSource(event); | |
| 123 if (!details.dispatcher_destroyed) | 122 if (!details.dispatcher_destroyed) |
| 124 input_method_handler()->SetPostIME(false); | 123 input_method_handler()->SetPostIME(false); |
| 125 return details; | 124 return details; |
| 126 } | 125 } |
| 127 | 126 |
| 128 void AshWindowTreeHostPlatform::SetTapToClickPaused(bool state) { | 127 void AshWindowTreeHostPlatform::SetTapToClickPaused(bool state) { |
| 129 #if defined(USE_OZONE) | 128 #if defined(USE_OZONE) |
| 130 DCHECK(ui::OzonePlatform::GetInstance()->GetInputController()); | 129 DCHECK(ui::OzonePlatform::GetInstance()->GetInputController()); |
| 131 | 130 |
| 132 // Temporarily pause tap-to-click when the cursor is hidden. | 131 // Temporarily pause tap-to-click when the cursor is hidden. |
| 133 ui::OzonePlatform::GetInstance()->GetInputController()->SetTapToClickPaused( | 132 ui::OzonePlatform::GetInstance()->GetInputController()->SetTapToClickPaused( |
| 134 state); | 133 state); |
| 135 #endif | 134 #endif |
| 136 } | 135 } |
| 137 | 136 |
| 138 } // namespace ash | 137 } // namespace ash |
| OLD | NEW |