| 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/thread_task_runner_handle.h" | 7 #include "base/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 14 matching lines...) Expand all Loading... |
| 25 #include "ui/gfx/geometry/point_conversions.h" | 25 #include "ui/gfx/geometry/point_conversions.h" |
| 26 #include "ui/gfx/geometry/size_conversions.h" | 26 #include "ui/gfx/geometry/size_conversions.h" |
| 27 #include "ui/gfx/screen.h" | 27 #include "ui/gfx/screen.h" |
| 28 | 28 |
| 29 namespace aura { | 29 namespace aura { |
| 30 | 30 |
| 31 const char kWindowTreeHostForAcceleratedWidget[] = | 31 const char kWindowTreeHostForAcceleratedWidget[] = |
| 32 "__AURA_WINDOW_TREE_HOST_ACCELERATED_WIDGET__"; | 32 "__AURA_WINDOW_TREE_HOST_ACCELERATED_WIDGET__"; |
| 33 | 33 |
| 34 float GetDeviceScaleFactorFromDisplay(Window* window) { | 34 float GetDeviceScaleFactorFromDisplay(Window* window) { |
| 35 gfx::Display display = gfx::Screen::GetScreenFor(window)-> | 35 gfx::Display display = |
| 36 GetDisplayNearestWindow(window); | 36 gfx::Screen::GetScreen()->GetDisplayNearestWindow(window); |
| 37 DCHECK(display.is_valid()); | 37 DCHECK(display.is_valid()); |
| 38 return display.device_scale_factor(); | 38 return display.device_scale_factor(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 //////////////////////////////////////////////////////////////////////////////// | 41 //////////////////////////////////////////////////////////////////////////////// |
| 42 // WindowTreeHost, public: | 42 // WindowTreeHost, public: |
| 43 | 43 |
| 44 WindowTreeHost::~WindowTreeHost() { | 44 WindowTreeHost::~WindowTreeHost() { |
| 45 DCHECK(!compositor_) << "compositor must be destroyed before root window"; | 45 DCHECK(!compositor_) << "compositor must be destroyed before root window"; |
| 46 if (owned_input_method_) { | 46 if (owned_input_method_) { |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 //////////////////////////////////////////////////////////////////////////////// | 307 //////////////////////////////////////////////////////////////////////////////// |
| 308 // WindowTreeHost, private: | 308 // WindowTreeHost, private: |
| 309 | 309 |
| 310 void WindowTreeHost::MoveCursorToInternal(const gfx::Point& root_location, | 310 void WindowTreeHost::MoveCursorToInternal(const gfx::Point& root_location, |
| 311 const gfx::Point& host_location) { | 311 const gfx::Point& host_location) { |
| 312 last_cursor_request_position_in_host_ = host_location; | 312 last_cursor_request_position_in_host_ = host_location; |
| 313 MoveCursorToNative(host_location); | 313 MoveCursorToNative(host_location); |
| 314 client::CursorClient* cursor_client = client::GetCursorClient(window()); | 314 client::CursorClient* cursor_client = client::GetCursorClient(window()); |
| 315 if (cursor_client) { | 315 if (cursor_client) { |
| 316 const gfx::Display& display = | 316 const gfx::Display& display = |
| 317 gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window()); | 317 gfx::Screen::GetScreen()->GetDisplayNearestWindow(window()); |
| 318 cursor_client->SetDisplay(display); | 318 cursor_client->SetDisplay(display); |
| 319 } | 319 } |
| 320 dispatcher()->OnCursorMovedToRootLocation(root_location); | 320 dispatcher()->OnCursorMovedToRootLocation(root_location); |
| 321 } | 321 } |
| 322 | 322 |
| 323 } // namespace aura | 323 } // namespace aura |
| OLD | NEW |