| 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/desktop/desktop_cursor_client.h" | 5 #include "ui/aura/desktop/desktop_cursor_client.h" |
| 6 | 6 |
| 7 #include "ui/aura/root_window.h" | 7 #include "ui/aura/root_window.h" |
| 8 #include "ui/base/cursor/cursor_loader.h" |
| 8 | 9 |
| 9 namespace aura { | 10 namespace aura { |
| 10 | 11 |
| 11 DesktopCursorClient::DesktopCursorClient(aura::RootWindow* window) | 12 DesktopCursorClient::DesktopCursorClient(aura::RootWindow* window) |
| 12 : root_window_(window) { | 13 : root_window_(window), |
| 14 cursor_loader_(ui::CursorLoader::Create()) { |
| 13 } | 15 } |
| 14 | 16 |
| 15 DesktopCursorClient::~DesktopCursorClient() { | 17 DesktopCursorClient::~DesktopCursorClient() { |
| 16 } | 18 } |
| 17 | 19 |
| 18 void DesktopCursorClient::SetCursor(gfx::NativeCursor cursor) { | 20 void DesktopCursorClient::SetCursor(gfx::NativeCursor cursor) { |
| 21 cursor_loader_->SetPlatformCursor(&cursor); |
| 19 root_window_->SetCursor(cursor); | 22 root_window_->SetCursor(cursor); |
| 20 } | 23 } |
| 21 | 24 |
| 22 void DesktopCursorClient::ShowCursor(bool show) { | 25 void DesktopCursorClient::ShowCursor(bool show) { |
| 23 root_window_->ShowCursor(show); | 26 root_window_->ShowCursor(show); |
| 24 } | 27 } |
| 25 | 28 |
| 26 bool DesktopCursorClient::IsCursorVisible() const { | 29 bool DesktopCursorClient::IsCursorVisible() const { |
| 27 return root_window_->cursor_shown(); | 30 return root_window_->cursor_shown(); |
| 28 } | 31 } |
| 29 | 32 |
| 30 void DesktopCursorClient::SetDeviceScaleFactor(float device_scale_factor) { | 33 void DesktopCursorClient::SetDeviceScaleFactor(float device_scale_factor) { |
| 31 // TODO(ben|erg): Use the device scale factor set here for the cursor. | 34 cursor_loader_->UnloadAll(); |
| 35 cursor_loader_->set_device_scale_factor(device_scale_factor); |
| 32 } | 36 } |
| 33 | 37 |
| 34 } // namespace aura | 38 } // namespace aura |
| OLD | NEW |