Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Side by Side Diff: ui/aura/window_tree_host.cc

Issue 2926473004: Don't rewrite events twice. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/aura/window_tree_host_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/aura/window_tree_host.h" 5 #include "ui/aura/window_tree_host.h"
6 6
7 #include "base/threading/thread_task_runner_handle.h" 7 #include "base/threading/thread_task_runner_handle.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "ui/aura/client/capture_client.h" 9 #include "ui/aura/client/capture_client.h"
10 #include "ui/aura/client/cursor_client.h" 10 #include "ui/aura/client/cursor_client.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 DCHECK(!input_method_); 190 DCHECK(!input_method_);
191 input_method_ = input_method; 191 input_method_ = input_method;
192 owned_input_method_ = false; 192 owned_input_method_ = false;
193 } 193 }
194 194
195 ui::EventDispatchDetails WindowTreeHost::DispatchKeyEventPostIME( 195 ui::EventDispatchDetails WindowTreeHost::DispatchKeyEventPostIME(
196 ui::KeyEvent* event) { 196 ui::KeyEvent* event) {
197 // If dispatch to IME is already disabled we shouldn't reach here. 197 // If dispatch to IME is already disabled we shouldn't reach here.
198 DCHECK(!dispatcher_->should_skip_ime()); 198 DCHECK(!dispatcher_->should_skip_ime());
199 dispatcher_->set_skip_ime(true); 199 dispatcher_->set_skip_ime(true);
200 ui::EventDispatchDetails dispatch_details = SendEventToSink(event); 200 // We should bypass event rewriters here as they've been tried before.
201 ui::EventDispatchDetails dispatch_details =
202 event_sink()->OnEventFromSource(event);
201 if (!dispatch_details.dispatcher_destroyed) 203 if (!dispatch_details.dispatcher_destroyed)
202 dispatcher_->set_skip_ime(false); 204 dispatcher_->set_skip_ime(false);
203 return dispatch_details; 205 return dispatch_details;
204 } 206 }
205 207
206 void WindowTreeHost::Show() { 208 void WindowTreeHost::Show() {
207 // Ensure that compositor has been properly initialized, see InitCompositor() 209 // Ensure that compositor has been properly initialized, see InitCompositor()
208 // and InitHost(). 210 // and InitHost().
209 DCHECK(compositor()); 211 DCHECK(compositor());
210 DCHECK_EQ(compositor()->root_layer(), window()->layer()); 212 DCHECK_EQ(compositor()->root_layer(), window()->layer());
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 client::CursorClient* cursor_client = client::GetCursorClient(window()); 351 client::CursorClient* cursor_client = client::GetCursorClient(window());
350 if (cursor_client) { 352 if (cursor_client) {
351 const display::Display& display = 353 const display::Display& display =
352 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); 354 display::Screen::GetScreen()->GetDisplayNearestWindow(window());
353 cursor_client->SetDisplay(display); 355 cursor_client->SetDisplay(display);
354 } 356 }
355 dispatcher()->OnCursorMovedToRootLocation(root_location); 357 dispatcher()->OnCursorMovedToRootLocation(root_location);
356 } 358 }
357 359
358 } // namespace aura 360 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | ui/aura/window_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698