| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_platform.h" | 5 #include "ui/aura/window_tree_host_platform.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "ui/aura/window_event_dispatcher.h" | 11 #include "ui/aura/window_event_dispatcher.h" |
| 12 #include "ui/compositor/compositor.h" | 12 #include "ui/compositor/compositor.h" |
| 13 #include "ui/display/screen.h" |
| 13 #include "ui/events/event.h" | 14 #include "ui/events/event.h" |
| 14 #include "ui/gfx/screen.h" | |
| 15 | 15 |
| 16 #if defined(OS_ANDROID) | 16 #if defined(OS_ANDROID) |
| 17 #include "ui/platform_window/android/platform_window_android.h" | 17 #include "ui/platform_window/android/platform_window_android.h" |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 #if defined(USE_OZONE) | 20 #if defined(USE_OZONE) |
| 21 #include "ui/ozone/public/ozone_platform.h" | 21 #include "ui/ozone/public/ozone_platform.h" |
| 22 #endif | 22 #endif |
| 23 | 23 |
| 24 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 void WindowTreeHostPlatform::MoveCursorToNative(const gfx::Point& location) { | 118 void WindowTreeHostPlatform::MoveCursorToNative(const gfx::Point& location) { |
| 119 window_->MoveCursorTo(location); | 119 window_->MoveCursorTo(location); |
| 120 } | 120 } |
| 121 | 121 |
| 122 void WindowTreeHostPlatform::OnCursorVisibilityChangedNative(bool show) { | 122 void WindowTreeHostPlatform::OnCursorVisibilityChangedNative(bool show) { |
| 123 NOTIMPLEMENTED(); | 123 NOTIMPLEMENTED(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void WindowTreeHostPlatform::OnBoundsChanged(const gfx::Rect& new_bounds) { | 126 void WindowTreeHostPlatform::OnBoundsChanged(const gfx::Rect& new_bounds) { |
| 127 float current_scale = compositor()->device_scale_factor(); | 127 float current_scale = compositor()->device_scale_factor(); |
| 128 float new_scale = gfx::Screen::GetScreen() | 128 float new_scale = display::Screen::GetScreen() |
| 129 ->GetDisplayNearestWindow(window()) | 129 ->GetDisplayNearestWindow(window()) |
| 130 .device_scale_factor(); | 130 .device_scale_factor(); |
| 131 gfx::Rect old_bounds = bounds_; | 131 gfx::Rect old_bounds = bounds_; |
| 132 bounds_ = new_bounds; | 132 bounds_ = new_bounds; |
| 133 if (bounds_.origin() != old_bounds.origin()) { | 133 if (bounds_.origin() != old_bounds.origin()) { |
| 134 OnHostMoved(bounds_.origin()); | 134 OnHostMoved(bounds_.origin()); |
| 135 } | 135 } |
| 136 if (bounds_.size() != old_bounds.size() || current_scale != new_scale) { | 136 if (bounds_.size() != old_bounds.size() || current_scale != new_scale) { |
| 137 OnHostResized(bounds_.size()); | 137 OnHostResized(bounds_.size()); |
| 138 } | 138 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 DCHECK_EQ(widget, widget_); | 179 DCHECK_EQ(widget, widget_); |
| 180 widget_ = gfx::kNullAcceleratedWidget; | 180 widget_ = gfx::kNullAcceleratedWidget; |
| 181 } | 181 } |
| 182 | 182 |
| 183 void WindowTreeHostPlatform::OnActivationChanged(bool active) { | 183 void WindowTreeHostPlatform::OnActivationChanged(bool active) { |
| 184 if (active) | 184 if (active) |
| 185 OnHostActivated(); | 185 OnHostActivated(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace aura | 188 } // namespace aura |
| OLD | NEW |