Index: ash/display/extended_mouse_warp_controller.cc |
diff --git a/ash/display/extended_mouse_warp_controller.cc b/ash/display/extended_mouse_warp_controller.cc |
index 8d044637b91f67dcbd7fd421bff48944cbe86f6e..e1846c540fc2b86b179f07b100ffb5704b05ad0f 100644 |
--- a/ash/display/extended_mouse_warp_controller.cc |
+++ b/ash/display/extended_mouse_warp_controller.cc |
@@ -88,18 +88,21 @@ ExtendedMouseWarpController::ExtendedMouseWarpController( |
drag_source != nullptr); |
} |
} else { |
+ // Make sure to set |a| as the primary display, and |b| as the secondary |
+ // display. DisplayLayout::Position is defined in terms of primary. |
DisplayLayout::Position position = |
display_manager->GetCurrentDisplayLayout().position; |
- const gfx::Display& a = display_manager->GetDisplayAt(0); |
- const gfx::Display& b = display_manager->GetDisplayAt(1); |
+ const gfx::Display& a = Shell::GetScreen()->GetPrimaryDisplay(); |
+ const gfx::Display& b = ScreenUtil::GetSecondaryDisplay(); |
// TODO(oshima): Use ComputeBondary instead. |
- if (position == DisplayLayout::TOP || position == DisplayLayout::BOTTOM) |
+ if (position == DisplayLayout::TOP || position == DisplayLayout::BOTTOM) { |
AddWarpRegion(CreateHorizontalEdgeBounds(a, b, position), |
drag_source != nullptr); |
- else |
+ } else { |
AddWarpRegion(CreateVerticalEdgeBounds(a, b, position), |
drag_source != nullptr); |
+ } |
} |
} |
@@ -148,8 +151,8 @@ void ExtendedMouseWarpController::SetEnabled(bool enabled) { |
void ExtendedMouseWarpController::AddWarpRegion( |
scoped_ptr<WarpRegion> warp_region, |
- bool drag_source) { |
- if (drag_source) { |
+ bool has_drag_source) { |
+ if (has_drag_source) { |
warp_region->shared_display_edge_indicator.reset( |
new SharedDisplayEdgeIndicator); |
warp_region->shared_display_edge_indicator->Show( |