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

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

Issue 1922783002: Move gfx::Display/Screen to display::Display/Screen in aura/events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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/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"
11 #include "ui/aura/env.h" 11 #include "ui/aura/env.h"
12 #include "ui/aura/window.h" 12 #include "ui/aura/window.h"
13 #include "ui/aura/window_event_dispatcher.h" 13 #include "ui/aura/window_event_dispatcher.h"
14 #include "ui/aura/window_targeter.h" 14 #include "ui/aura/window_targeter.h"
15 #include "ui/aura/window_tree_host_observer.h" 15 #include "ui/aura/window_tree_host_observer.h"
16 #include "ui/base/ime/input_method.h" 16 #include "ui/base/ime/input_method.h"
17 #include "ui/base/ime/input_method_factory.h" 17 #include "ui/base/ime/input_method_factory.h"
18 #include "ui/base/view_prop.h" 18 #include "ui/base/view_prop.h"
19 #include "ui/compositor/dip_util.h" 19 #include "ui/compositor/dip_util.h"
20 #include "ui/compositor/layer.h" 20 #include "ui/compositor/layer.h"
21 #include "ui/gfx/display.h" 21 #include "ui/display/display.h"
22 #include "ui/display/screen.h"
22 #include "ui/gfx/geometry/insets.h" 23 #include "ui/gfx/geometry/insets.h"
23 #include "ui/gfx/geometry/point.h" 24 #include "ui/gfx/geometry/point.h"
24 #include "ui/gfx/geometry/point3_f.h" 25 #include "ui/gfx/geometry/point3_f.h"
25 #include "ui/gfx/geometry/point_conversions.h" 26 #include "ui/gfx/geometry/point_conversions.h"
26 #include "ui/gfx/geometry/size_conversions.h" 27 #include "ui/gfx/geometry/size_conversions.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 = 35 display::Display display =
36 gfx::Screen::GetScreen()->GetDisplayNearestWindow(window); 36 display::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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 306
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 display::Display& display =
317 gfx::Screen::GetScreen()->GetDisplayNearestWindow(window()); 317 display::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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698