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

Unified Diff: ash/display/cursor_window_controller.cc

Issue 948583005: Add more tests for mouse rotation,scale&position after display change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/display/cursor_window_controller.cc
diff --git a/ash/display/cursor_window_controller.cc b/ash/display/cursor_window_controller.cc
index a59a5d83ad9e1ca97e3dc32fba61c5489d6e1324..bdb3c58c581cf2054f9e36d5ea2212d5ffb7bf25 100644
--- a/ash/display/cursor_window_controller.cc
+++ b/ash/display/cursor_window_controller.cc
@@ -94,7 +94,6 @@ CursorWindowController::CursorWindowController()
container_(NULL),
cursor_type_(ui::kCursorNone),
cursor_set_(ui::CURSOR_SET_NORMAL),
- cursor_rotation_(gfx::Display::ROTATE_0),
delegate_(new CursorWindowDelegate()) {
}
@@ -128,7 +127,7 @@ void CursorWindowController::UpdateContainer() {
display_ = Shell::GetScreen()->GetPrimaryDisplay();
SetContainer(mirror_window);
}
- // Updates the hot point based on the current display/container.
+ // Updates the hot point based on the current display.
UpdateCursorImage();
}
@@ -145,6 +144,8 @@ void CursorWindowController::SetDisplay(const gfx::Display& display) {
SetContainer(GetRootWindowController(root_window)->GetContainer(
kShellWindowId_MouseCursorContainer));
SetBoundsInScreen(display.bounds());
+ // Updates the hot point based on the current display.
+ UpdateCursorImage();
oshima 2015/03/09 23:08:20 can you move the method to private, then you don't
pkotwicz 2015/03/10 03:13:05 I don't think I understand your comment. CursorWi
}
void CursorWindowController::UpdateLocation() {
@@ -163,11 +164,9 @@ void CursorWindowController::UpdateLocation() {
}
void CursorWindowController::SetCursor(gfx::NativeCursor cursor) {
- if (cursor_type_ == cursor.native_type() &&
- cursor_rotation_ == display_.rotation())
+ if (cursor_type_ == cursor.native_type())
return;
cursor_type_ = cursor.native_type();
- cursor_rotation_ = display_.rotation();
UpdateCursorImage();
}
@@ -201,6 +200,7 @@ void CursorWindowController::SetContainer(aura::Window* container) {
cursor_window_->Init(aura::WINDOW_LAYER_TEXTURED);
cursor_window_->set_ignore_events(true);
cursor_window_->set_owned_by_parent(false);
+ // Call UpdateCursorImage() to figure out |cursor_window_|'s desired size.
UpdateCursorImage();
container->AddChild(cursor_window_.get());
@@ -227,7 +227,7 @@ void CursorWindowController::UpdateCursorImage() {
ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resource_id);
gfx::ImageSkia rotated = *image;
if (!is_cursor_compositing_enabled_) {
- switch (cursor_rotation_) {
+ switch (display_.rotation()) {
case gfx::Display::ROTATE_0:
break;
case gfx::Display::ROTATE_90:

Powered by Google App Engine
This is Rietveld 408576698