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