| 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 "ash/host/ash_window_tree_host.h" | 5 #include "ash/host/ash_window_tree_host.h" |
| 6 | 6 |
| 7 #include "ash/host/ash_window_tree_host_init_params.h" | 7 #include "ash/host/ash_window_tree_host_init_params.h" |
| 8 #include "ash/host/ash_window_tree_host_unified.h" | 8 #include "ash/host/ash_window_tree_host_unified.h" |
| 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" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 TranslateLocatedEvent(static_cast<ui::LocatedEvent*>(event)); | 140 TranslateLocatedEvent(static_cast<ui::LocatedEvent*>(event)); |
| 141 SendEventToProcessor(event); | 141 SendEventToProcessor(event); |
| 142 } | 142 } |
| 143 | 143 |
| 144 bool AshWindowTreeHostOzone::DispatchKeyEventPostIME( | 144 bool AshWindowTreeHostOzone::DispatchKeyEventPostIME( |
| 145 const ui::KeyEvent& event) { | 145 const ui::KeyEvent& event) { |
| 146 ui::KeyEvent event_copy(event); | 146 ui::KeyEvent event_copy(event); |
| 147 input_method_handler()->SetPostIME(true); | 147 input_method_handler()->SetPostIME(true); |
| 148 ui::EventSource::DeliverEventToProcessor(&event_copy); | 148 ui::EventSource::DeliverEventToProcessor(&event_copy); |
| 149 input_method_handler()->SetPostIME(false); | 149 input_method_handler()->SetPostIME(false); |
| 150 return event_copy.handled(); | 150 return event_copy.stopped_propagation(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void AshWindowTreeHostOzone::SetTapToClickPaused(bool state) { | 153 void AshWindowTreeHostOzone::SetTapToClickPaused(bool state) { |
| 154 #if defined(OS_CHROMEOS) | 154 #if defined(OS_CHROMEOS) |
| 155 DCHECK(ui::OzonePlatform::GetInstance()->GetInputController()); | 155 DCHECK(ui::OzonePlatform::GetInstance()->GetInputController()); |
| 156 | 156 |
| 157 // Temporarily pause tap-to-click when the cursor is hidden. | 157 // Temporarily pause tap-to-click when the cursor is hidden. |
| 158 ui::OzonePlatform::GetInstance()->GetInputController()->SetTapToClickPaused( | 158 ui::OzonePlatform::GetInstance()->GetInputController()->SetTapToClickPaused( |
| 159 state); | 159 state); |
| 160 #endif | 160 #endif |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace | 163 } // namespace |
| 164 | 164 |
| 165 AshWindowTreeHost* AshWindowTreeHost::Create( | 165 AshWindowTreeHost* AshWindowTreeHost::Create( |
| 166 const AshWindowTreeHostInitParams& init_params) { | 166 const AshWindowTreeHostInitParams& init_params) { |
| 167 if (init_params.offscreen) | 167 if (init_params.offscreen) |
| 168 return new AshWindowTreeHostUnified(init_params.initial_bounds); | 168 return new AshWindowTreeHostUnified(init_params.initial_bounds); |
| 169 return new AshWindowTreeHostOzone(init_params.initial_bounds); | 169 return new AshWindowTreeHostOzone(init_params.initial_bounds); |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace ash | 172 } // namespace ash |
| OLD | NEW |