OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_unified.h" | 5 #include "ash/host/ash_window_tree_host_unified.h" |
6 #include "ash/host/root_window_transformer.h" | 6 #include "ash/host/root_window_transformer.h" |
7 #include "ash/ime/input_method_event_handler.h" | 7 #include "ash/ime/input_method_event_handler.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 #include "ui/aura/window_event_dispatcher.h" | 10 #include "ui/aura/window_event_dispatcher.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 auto iter = | 175 auto iter = |
176 std::find_if(mirroring_hosts_.begin(), mirroring_hosts_.end(), | 176 std::find_if(mirroring_hosts_.begin(), mirroring_hosts_.end(), |
177 [window](AshWindowTreeHost* ash_host) { | 177 [window](AshWindowTreeHost* ash_host) { |
178 return ash_host->AsWindowTreeHost()->window() == window; | 178 return ash_host->AsWindowTreeHost()->window() == window; |
179 }); | 179 }); |
180 DCHECK(iter != mirroring_hosts_.end()); | 180 DCHECK(iter != mirroring_hosts_.end()); |
181 window->RemoveObserver(this); | 181 window->RemoveObserver(this); |
182 mirroring_hosts_.erase(iter); | 182 mirroring_hosts_.erase(iter); |
183 } | 183 } |
184 | 184 |
185 bool AshWindowTreeHostUnified::DispatchKeyEventPostIME( | 185 ui::EventDispatchDetails AshWindowTreeHostUnified::DispatchKeyEventPostIME( |
186 const ui::KeyEvent& event) { | 186 ui::KeyEvent* event) { |
187 ui::KeyEvent event_copy(event); | |
188 input_method_handler()->SetPostIME(true); | 187 input_method_handler()->SetPostIME(true); |
189 ui::EventDispatchDetails details = | 188 ui::EventDispatchDetails details = |
190 event_processor()->OnEventFromSource(&event_copy); | 189 event_processor()->OnEventFromSource(event); |
191 if (details.dispatcher_destroyed) | 190 if (!details.dispatcher_destroyed) |
192 return true; | 191 input_method_handler()->SetPostIME(false); |
193 input_method_handler()->SetPostIME(false); | 192 return details; |
194 return event_copy.stopped_propagation(); | |
195 } | 193 } |
196 | 194 |
197 } // namespace ash | 195 } // namespace ash |
OLD | NEW |