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" | |
12 #include "base/trace_event/trace_event.h" | 11 #include "base/trace_event/trace_event.h" |
13 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
14 #include "ui/aura/window_tree_host_platform.h" | 13 #include "ui/aura/window_tree_host_platform.h" |
15 #include "ui/events/event_sink.h" | 14 #include "ui/events/event_sink.h" |
16 #include "ui/events/null_event_targeter.h" | 15 #include "ui/events/null_event_targeter.h" |
17 #include "ui/gfx/geometry/insets.h" | 16 #include "ui/gfx/geometry/insets.h" |
18 #include "ui/gfx/transform.h" | 17 #include "ui/gfx/transform.h" |
19 #include "ui/platform_window/platform_window.h" | 18 #include "ui/platform_window/platform_window.h" |
20 | 19 |
21 #if defined(USE_OZONE) | 20 #if defined(USE_OZONE) |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 ConfineCursorToRootWindow(); | 107 ConfineCursorToRootWindow(); |
109 } | 108 } |
110 | 109 |
111 void AshWindowTreeHostPlatform::DispatchEvent(ui::Event* event) { | 110 void AshWindowTreeHostPlatform::DispatchEvent(ui::Event* event) { |
112 TRACE_EVENT0("input", "AshWindowTreeHostPlatform::DispatchEvent"); | 111 TRACE_EVENT0("input", "AshWindowTreeHostPlatform::DispatchEvent"); |
113 if (event->IsLocatedEvent()) | 112 if (event->IsLocatedEvent()) |
114 TranslateLocatedEvent(static_cast<ui::LocatedEvent*>(event)); | 113 TranslateLocatedEvent(static_cast<ui::LocatedEvent*>(event)); |
115 SendEventToSink(event); | 114 SendEventToSink(event); |
116 } | 115 } |
117 | 116 |
118 ui::EventDispatchDetails AshWindowTreeHostPlatform::DispatchKeyEventPostIME( | |
119 ui::KeyEvent* event) { | |
120 input_method_handler()->SetPostIME(true); | |
121 ui::EventDispatchDetails details = event_sink()->OnEventFromSource(event); | |
122 if (!details.dispatcher_destroyed) | |
123 input_method_handler()->SetPostIME(false); | |
124 return details; | |
125 } | |
126 | |
127 void AshWindowTreeHostPlatform::SetTapToClickPaused(bool state) { | 117 void AshWindowTreeHostPlatform::SetTapToClickPaused(bool state) { |
128 #if defined(USE_OZONE) | 118 #if defined(USE_OZONE) |
129 DCHECK(ui::OzonePlatform::GetInstance()->GetInputController()); | 119 DCHECK(ui::OzonePlatform::GetInstance()->GetInputController()); |
130 | 120 |
131 // Temporarily pause tap-to-click when the cursor is hidden. | 121 // Temporarily pause tap-to-click when the cursor is hidden. |
132 ui::OzonePlatform::GetInstance()->GetInputController()->SetTapToClickPaused( | 122 ui::OzonePlatform::GetInstance()->GetInputController()->SetTapToClickPaused( |
133 state); | 123 state); |
134 #endif | 124 #endif |
135 } | 125 } |
136 | 126 |
137 } // namespace ash | 127 } // namespace ash |
OLD | NEW |