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/views/widget/desktop_aura/desktop_native_cursor_manager.h" | 5 #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" |
6 | 6 |
7 #include "ui/aura/window_event_dispatcher.h" | 7 #include "ui/aura/window_event_dispatcher.h" |
8 #include "ui/aura/window_tree_host.h" | 8 #include "ui/aura/window_tree_host.h" |
9 #include "ui/base/cursor/cursor_loader.h" | 9 #include "ui/base/cursor/cursor_loader.h" |
10 #include "ui/views/widget/desktop_aura/desktop_cursor_loader_updater.h" | 10 #include "ui/views/widget/desktop_aura/desktop_cursor_loader_updater.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 | 34 |
35 void DesktopNativeCursorManager::RemoveHost(aura::WindowTreeHost* host) { | 35 void DesktopNativeCursorManager::RemoveHost(aura::WindowTreeHost* host) { |
36 hosts_.erase(host); | 36 hosts_.erase(host); |
37 } | 37 } |
38 | 38 |
39 void DesktopNativeCursorManager::SetDisplay( | 39 void DesktopNativeCursorManager::SetDisplay( |
40 const gfx::Display& display, | 40 const gfx::Display& display, |
41 wm::NativeCursorManagerDelegate* delegate) { | 41 wm::NativeCursorManagerDelegate* delegate) { |
42 cursor_loader_->UnloadAll(); | 42 cursor_loader_->UnloadAll(); |
43 cursor_loader_->set_rotation(display.rotation()); | 43 cursor_loader_->set_display(display); |
44 cursor_loader_->set_scale(display.device_scale_factor()); | |
45 | 44 |
46 if (cursor_loader_updater_.get()) | 45 if (cursor_loader_updater_.get()) |
47 cursor_loader_updater_->OnDisplayUpdated(display, cursor_loader_.get()); | 46 cursor_loader_updater_->OnDisplayUpdated(display, cursor_loader_.get()); |
48 | 47 |
49 SetCursor(delegate->GetCursor(), delegate); | 48 SetCursor(delegate->GetCursor(), delegate); |
50 } | 49 } |
51 | 50 |
52 void DesktopNativeCursorManager::SetCursor( | 51 void DesktopNativeCursorManager::SetCursor( |
53 gfx::NativeCursor cursor, | 52 gfx::NativeCursor cursor, |
54 wm::NativeCursorManagerDelegate* delegate) { | 53 wm::NativeCursorManagerDelegate* delegate) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // TODO(erg): In the ash version, we set the last mouse location on Env. I'm | 93 // TODO(erg): In the ash version, we set the last mouse location on Env. I'm |
95 // not sure this concept makes sense on the desktop. | 94 // not sure this concept makes sense on the desktop. |
96 | 95 |
97 SetVisibility(delegate->IsCursorVisible(), delegate); | 96 SetVisibility(delegate->IsCursorVisible(), delegate); |
98 | 97 |
99 for (Hosts::const_iterator i = hosts_.begin(); i != hosts_.end(); ++i) | 98 for (Hosts::const_iterator i = hosts_.begin(); i != hosts_.end(); ++i) |
100 (*i)->dispatcher()->OnMouseEventsEnableStateChanged(enabled); | 99 (*i)->dispatcher()->OnMouseEventsEnableStateChanged(enabled); |
101 } | 100 } |
102 | 101 |
103 } // namespace views | 102 } // namespace views |
OLD | NEW |