| 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_display(display); | 43 cursor_loader_->set_rotation(display.rotation()); |
| 44 cursor_loader_->set_scale(display.device_scale_factor()); |
| 44 | 45 |
| 45 if (cursor_loader_updater_.get()) | 46 if (cursor_loader_updater_.get()) |
| 46 cursor_loader_updater_->OnDisplayUpdated(display, cursor_loader_.get()); | 47 cursor_loader_updater_->OnDisplayUpdated(display, cursor_loader_.get()); |
| 47 | 48 |
| 48 SetCursor(delegate->GetCursor(), delegate); | 49 SetCursor(delegate->GetCursor(), delegate); |
| 49 } | 50 } |
| 50 | 51 |
| 51 void DesktopNativeCursorManager::SetCursor( | 52 void DesktopNativeCursorManager::SetCursor( |
| 52 gfx::NativeCursor cursor, | 53 gfx::NativeCursor cursor, |
| 53 wm::NativeCursorManagerDelegate* delegate) { | 54 wm::NativeCursorManagerDelegate* delegate) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // TODO(erg): In the ash version, we set the last mouse location on Env. I'm | 94 // TODO(erg): In the ash version, we set the last mouse location on Env. I'm |
| 94 // not sure this concept makes sense on the desktop. | 95 // not sure this concept makes sense on the desktop. |
| 95 | 96 |
| 96 SetVisibility(delegate->IsCursorVisible(), delegate); | 97 SetVisibility(delegate->IsCursorVisible(), delegate); |
| 97 | 98 |
| 98 for (Hosts::const_iterator i = hosts_.begin(); i != hosts_.end(); ++i) | 99 for (Hosts::const_iterator i = hosts_.begin(); i != hosts_.end(); ++i) |
| 99 (*i)->dispatcher()->OnMouseEventsEnableStateChanged(enabled); | 100 (*i)->dispatcher()->OnMouseEventsEnableStateChanged(enabled); |
| 100 } | 101 } |
| 101 | 102 |
| 102 } // namespace views | 103 } // namespace views |
| OLD | NEW |