Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: ash/wm/ash_native_cursor_manager.cc

Issue 258893002: app_shell: Add support for mouse cursors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move an include Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/wm/ash_native_cursor_manager.cc
diff --git a/ash/wm/ash_native_cursor_manager.cc b/ash/wm/ash_native_cursor_manager.cc
index e78eb94db29f6d1ca950131e205bb7b10f10b04b..7c7a00ea13f26f45e888c6a6cf9f0d887a24d701 100644
--- a/ash/wm/ash_native_cursor_manager.cc
+++ b/ash/wm/ash_native_cursor_manager.cc
@@ -7,12 +7,12 @@
#include "ash/display/cursor_window_controller.h"
#include "ash/display/display_controller.h"
#include "ash/shell.h"
-#include "ash/wm/image_cursors.h"
#include "base/logging.h"
#include "ui/aura/env.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/cursor/cursor.h"
+#include "ui/base/cursor/image_cursors.h"
namespace ash {
namespace {
@@ -54,7 +54,7 @@ void NotifyMouseEventsEnableStateChange(bool enabled) {
AshNativeCursorManager::AshNativeCursorManager()
: native_cursor_enabled_(true),
- image_cursors_(new ImageCursors) {
+ image_cursors_(new ui::ImageCursors) {
}
AshNativeCursorManager::~AshNativeCursorManager() {
@@ -72,7 +72,12 @@ void AshNativeCursorManager::SetNativeCursorEnabled(bool enabled) {
void AshNativeCursorManager::SetDisplay(
const gfx::Display& display,
::wm::NativeCursorManagerDelegate* delegate) {
- if (image_cursors_->SetDisplay(display))
+ DCHECK(display.is_valid());
+ // Use the platform's device scale factor instead of the display's, which
+ // might have been adjusted for the UI scale.
+ const float scale_factor = Shell::GetInstance()->display_manager()->
+ GetDisplayInfo(display.id()).device_scale_factor();
+ if (image_cursors_->SetDisplay(display, scale_factor))
SetCursor(delegate->GetCursor(), delegate);
#if defined(OS_CHROMEOS)
Shell::GetInstance()->display_controller()->cursor_window_controller()->

Powered by Google App Engine
This is Rietveld 408576698