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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 input_method_ = input_method; | 202 input_method_ = input_method; |
| 203 owned_input_method_ = false; | 203 owned_input_method_ = false; |
| 204 } | 204 } |
| 205 | 205 |
| 206 ui::EventDispatchDetails WindowTreeHost::DispatchKeyEventPostIME( | 206 ui::EventDispatchDetails WindowTreeHost::DispatchKeyEventPostIME( |
| 207 ui::KeyEvent* event) { | 207 ui::KeyEvent* event) { |
| 208 return SendEventToProcessor(event); | 208 return SendEventToProcessor(event); |
| 209 } | 209 } |
| 210 | 210 |
| 211 void WindowTreeHost::Show() { | 211 void WindowTreeHost::Show() { |
| 212 if (compositor()) | 212 // Ensure that compositor has been properly initialized, see InitCompositor() |
| 213 compositor()->SetVisible(true); | 213 // and InitHost(). |
| 214 CHECK(compositor()); | |
|
sadrul
2016/12/06 16:10:54
DCHECK() should be fine here too.
| |
| 215 DCHECK_EQ(compositor()->root_layer(), window()->layer()); | |
| 216 compositor()->SetVisible(true); | |
| 214 ShowImpl(); | 217 ShowImpl(); |
| 215 } | 218 } |
| 216 | 219 |
| 217 void WindowTreeHost::Hide() { | 220 void WindowTreeHost::Hide() { |
| 218 HideImpl(); | 221 HideImpl(); |
| 219 if (compositor()) | 222 if (compositor()) |
| 220 compositor()->SetVisible(false); | 223 compositor()->SetVisible(false); |
| 221 } | 224 } |
| 222 | 225 |
| 223 //////////////////////////////////////////////////////////////////////////////// | 226 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 339 client::CursorClient* cursor_client = client::GetCursorClient(window()); | 342 client::CursorClient* cursor_client = client::GetCursorClient(window()); |
| 340 if (cursor_client) { | 343 if (cursor_client) { |
| 341 const display::Display& display = | 344 const display::Display& display = |
| 342 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); | 345 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); |
| 343 cursor_client->SetDisplay(display); | 346 cursor_client->SetDisplay(display); |
| 344 } | 347 } |
| 345 dispatcher()->OnCursorMovedToRootLocation(root_location); | 348 dispatcher()->OnCursorMovedToRootLocation(root_location); |
| 346 } | 349 } |
| 347 | 350 |
| 348 } // namespace aura | 351 } // namespace aura |
| OLD | NEW |