Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 185 } | 185 } |
| 186 return input_method_; | 186 return input_method_; |
| 187 } | 187 } |
| 188 | 188 |
| 189 void WindowTreeHost::SetSharedInputMethod(ui::InputMethod* input_method) { | 189 void WindowTreeHost::SetSharedInputMethod(ui::InputMethod* input_method) { |
| 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( |
|
sadrul
2017/05/15 18:14:54
Should WindowTreeHost::DispatchKeyEventPostIME() b
Hadi
2017/05/16 14:53:59
Done.
| |
| 196 ui::KeyEvent* event) { | 196 ui::KeyEvent* event) { |
| 197 return SendEventToSink(event); | 197 dispatcher_->set_skip_ime(true); |
| 198 ui::EventDispatchDetails dispatch_details = SendEventToSink(event); | |
| 199 dispatcher_->set_skip_ime(false); | |
|
sadrul
2017/05/15 18:14:54
Check |details.dispatcher_destroyed| before using
Hadi
2017/05/16 14:53:59
Done.
| |
| 200 return dispatch_details; | |
| 198 } | 201 } |
| 199 | 202 |
| 200 void WindowTreeHost::Show() { | 203 void WindowTreeHost::Show() { |
| 201 // Ensure that compositor has been properly initialized, see InitCompositor() | 204 // Ensure that compositor has been properly initialized, see InitCompositor() |
| 202 // and InitHost(). | 205 // and InitHost(). |
| 203 DCHECK(compositor()); | 206 DCHECK(compositor()); |
| 204 DCHECK_EQ(compositor()->root_layer(), window()->layer()); | 207 DCHECK_EQ(compositor()->root_layer(), window()->layer()); |
| 205 compositor()->SetVisible(true); | 208 compositor()->SetVisible(true); |
| 206 ShowImpl(); | 209 ShowImpl(); |
| 207 window()->Show(); | 210 window()->Show(); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 343 client::CursorClient* cursor_client = client::GetCursorClient(window()); | 346 client::CursorClient* cursor_client = client::GetCursorClient(window()); |
| 344 if (cursor_client) { | 347 if (cursor_client) { |
| 345 const display::Display& display = | 348 const display::Display& display = |
| 346 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); | 349 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); |
| 347 cursor_client->SetDisplay(display); | 350 cursor_client->SetDisplay(display); |
| 348 } | 351 } |
| 349 dispatcher()->OnCursorMovedToRootLocation(root_location); | 352 dispatcher()->OnCursorMovedToRootLocation(root_location); |
| 350 } | 353 } |
| 351 | 354 |
| 352 } // namespace aura | 355 } // namespace aura |
| OLD | NEW |