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 19 matching lines...) Expand all Loading... | |
| 30 #include "ui/gfx/icc_profile.h" | 30 #include "ui/gfx/icc_profile.h" |
| 31 | 31 |
| 32 namespace aura { | 32 namespace aura { |
| 33 | 33 |
| 34 const char kWindowTreeHostForAcceleratedWidget[] = | 34 const char kWindowTreeHostForAcceleratedWidget[] = |
| 35 "__AURA_WINDOW_TREE_HOST_ACCELERATED_WIDGET__"; | 35 "__AURA_WINDOW_TREE_HOST_ACCELERATED_WIDGET__"; |
| 36 | 36 |
| 37 float GetDeviceScaleFactorFromDisplay(Window* window) { | 37 float GetDeviceScaleFactorFromDisplay(Window* window) { |
| 38 display::Display display = | 38 display::Display display = |
| 39 display::Screen::GetScreen()->GetDisplayNearestWindow(window); | 39 display::Screen::GetScreen()->GetDisplayNearestWindow(window); |
| 40 // TODO: This assertion fails in external mode because no display is available | |
|
kylechar
2017/02/21 15:15:11
Removing this DCHECK shouldn't be necessary. You'l
fwang
2017/02/21 17:30:19
OK, as discussed on IRC, the next patch will make
| |
| 41 // when the window tree is embedded. Come back to this once bug 693081 is | |
| 42 // fixed. | |
| 43 #if !defined(USE_OZONE) || defined(OS_CHROMEOS) | |
| 40 DCHECK(display.is_valid()); | 44 DCHECK(display.is_valid()); |
| 45 #endif | |
| 41 return display.device_scale_factor(); | 46 return display.device_scale_factor(); |
| 42 } | 47 } |
| 43 | 48 |
| 44 //////////////////////////////////////////////////////////////////////////////// | 49 //////////////////////////////////////////////////////////////////////////////// |
| 45 // WindowTreeHost, public: | 50 // WindowTreeHost, public: |
| 46 | 51 |
| 47 WindowTreeHost::~WindowTreeHost() { | 52 WindowTreeHost::~WindowTreeHost() { |
| 48 DCHECK(!compositor_) << "compositor must be destroyed before root window"; | 53 DCHECK(!compositor_) << "compositor must be destroyed before root window"; |
| 49 if (owned_input_method_) { | 54 if (owned_input_method_) { |
| 50 delete input_method_; | 55 delete input_method_; |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 347 client::CursorClient* cursor_client = client::GetCursorClient(window()); | 352 client::CursorClient* cursor_client = client::GetCursorClient(window()); |
| 348 if (cursor_client) { | 353 if (cursor_client) { |
| 349 const display::Display& display = | 354 const display::Display& display = |
| 350 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); | 355 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); |
| 351 cursor_client->SetDisplay(display); | 356 cursor_client->SetDisplay(display); |
| 352 } | 357 } |
| 353 dispatcher()->OnCursorMovedToRootLocation(root_location); | 358 dispatcher()->OnCursorMovedToRootLocation(root_location); |
| 354 } | 359 } |
| 355 | 360 |
| 356 } // namespace aura | 361 } // namespace aura |
| OLD | NEW |