OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
16 #include "ui/aura/client/capture_client.h" | 16 #include "ui/aura/client/capture_client.h" |
17 #include "ui/aura/client/cursor_client.h" | 17 #include "ui/aura/client/cursor_client.h" |
18 #include "ui/aura/client/event_client.h" | 18 #include "ui/aura/client/event_client.h" |
19 #include "ui/aura/client/focus_client.h" | 19 #include "ui/aura/client/focus_client.h" |
20 #include "ui/aura/client/screen_position_client.h" | 20 #include "ui/aura/client/screen_position_client.h" |
21 #include "ui/aura/client/visibility_client.h" | 21 #include "ui/aura/client/visibility_client.h" |
22 #include "ui/aura/env.h" | 22 #include "ui/aura/env.h" |
23 #include "ui/aura/layout_manager.h" | 23 #include "ui/aura/layout_manager.h" |
24 #include "ui/aura/root_window.h" | 24 #include "ui/aura/root_window.h" |
25 #include "ui/aura/window_delegate.h" | 25 #include "ui/aura/window_delegate.h" |
26 #include "ui/aura/window_observer.h" | 26 #include "ui/aura/window_observer.h" |
27 #include "ui/aura/window_tracker.h" | 27 #include "ui/aura/window_tracker.h" |
| 28 #include "ui/aura/window_tree_host.h" |
28 #include "ui/compositor/compositor.h" | 29 #include "ui/compositor/compositor.h" |
29 #include "ui/compositor/layer.h" | 30 #include "ui/compositor/layer.h" |
30 #include "ui/gfx/animation/multi_animation.h" | 31 #include "ui/gfx/animation/multi_animation.h" |
31 #include "ui/gfx/canvas.h" | 32 #include "ui/gfx/canvas.h" |
32 #include "ui/gfx/path.h" | 33 #include "ui/gfx/path.h" |
33 #include "ui/gfx/screen.h" | 34 #include "ui/gfx/screen.h" |
34 | 35 |
35 namespace aura { | 36 namespace aura { |
36 | 37 |
37 class ScopedCursorHider { | 38 class ScopedCursorHider { |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 key, key, NULL, reinterpret_cast<int64>(value), 0); | 646 key, key, NULL, reinterpret_cast<int64>(value), 0); |
646 } | 647 } |
647 | 648 |
648 void* Window::GetNativeWindowProperty(const char* key) const { | 649 void* Window::GetNativeWindowProperty(const char* key) const { |
649 return reinterpret_cast<void*>(GetPropertyInternal(key, 0)); | 650 return reinterpret_cast<void*>(GetPropertyInternal(key, 0)); |
650 } | 651 } |
651 | 652 |
652 void Window::OnDeviceScaleFactorChanged(float device_scale_factor) { | 653 void Window::OnDeviceScaleFactorChanged(float device_scale_factor) { |
653 ScopedCursorHider hider(this); | 654 ScopedCursorHider hider(this); |
654 if (dispatcher_) | 655 if (dispatcher_) |
655 dispatcher_->DeviceScaleFactorChanged(device_scale_factor); | 656 dispatcher_->host()->OnDeviceScaleFactorChanged(device_scale_factor); |
656 if (delegate_) | 657 if (delegate_) |
657 delegate_->OnDeviceScaleFactorChanged(device_scale_factor); | 658 delegate_->OnDeviceScaleFactorChanged(device_scale_factor); |
658 } | 659 } |
659 | 660 |
660 #ifndef NDEBUG | 661 #ifndef NDEBUG |
661 std::string Window::GetDebugInfo() const { | 662 std::string Window::GetDebugInfo() const { |
662 return base::StringPrintf( | 663 return base::StringPrintf( |
663 "%s<%d> bounds(%d, %d, %d, %d) %s %s opacity=%.1f", | 664 "%s<%d> bounds(%d, %d, %d, %d) %s %s opacity=%.1f", |
664 name().empty() ? "Unknown" : name().c_str(), id(), | 665 name().empty() ? "Unknown" : name().c_str(), id(), |
665 bounds().x(), bounds().y(), bounds().width(), bounds().height(), | 666 bounds().x(), bounds().y(), bounds().width(), bounds().height(), |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 bool contains_mouse = false; | 1213 bool contains_mouse = false; |
1213 if (IsVisible()) { | 1214 if (IsVisible()) { |
1214 WindowEventDispatcher* dispatcher = GetDispatcher(); | 1215 WindowEventDispatcher* dispatcher = GetDispatcher(); |
1215 contains_mouse = dispatcher && | 1216 contains_mouse = dispatcher && |
1216 ContainsPointInRoot(dispatcher->GetLastMouseLocationInRoot()); | 1217 ContainsPointInRoot(dispatcher->GetLastMouseLocationInRoot()); |
1217 } | 1218 } |
1218 return contains_mouse; | 1219 return contains_mouse; |
1219 } | 1220 } |
1220 | 1221 |
1221 } // namespace aura | 1222 } // namespace aura |
OLD | NEW |