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

Unified Diff: ash/display/mouse_cursor_event_filter.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tidy Created 8 years, 2 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/mouse_cursor_event_filter.cc
diff --git a/ash/display/mouse_cursor_event_filter.cc b/ash/display/mouse_cursor_event_filter.cc
index 44618684ecb9f3cd7af8a2c089ae14cbe82f6074..c3a379c0dba1c383c53ef36b1e95444d551d9ceb 100644
--- a/ash/display/mouse_cursor_event_filter.cc
+++ b/ash/display/mouse_cursor_event_filter.cc
@@ -48,7 +48,8 @@ MouseCursorEventFilter::~MouseCursorEventFilter() {
void MouseCursorEventFilter::ShowSharedEdgeIndicator(
const aura::RootWindow* from) {
HideSharedEdgeIndicator();
- if (gfx::Screen::GetNumDisplays() <= 1 || from == NULL) {
+ if (gfx::Screen::GetNumDisplays(ash::Shell::GetRootNativeView()) <= 1 ||
+ from == NULL) {
src_indicator_bounds_.SetRect(0, 0, 0, 0);
dst_indicator_bounds_.SetRect(0, 0, 0, 0);
drag_source_root_ = NULL;
@@ -107,7 +108,8 @@ ui::EventResult MouseCursorEventFilter::PreHandleGestureEvent(
bool MouseCursorEventFilter::WarpMouseCursorIfNecessary(
aura::RootWindow* target_root,
const gfx::Point& point_in_screen) {
- if (gfx::Screen::GetNumDisplays() <= 1 || mouse_warp_mode_ == WARP_NONE)
+ if (gfx::Screen::GetNumDisplays(ash::Shell::GetRootNativeView()) <= 1 ||
+ mouse_warp_mode_ == WARP_NONE)
return false;
const float scale = ui::GetDeviceScaleFactor(target_root->layer());
@@ -157,7 +159,8 @@ bool MouseCursorEventFilter::WarpMouseCursorIfNecessary(
void MouseCursorEventFilter::UpdateHorizontalIndicatorWindowBounds() {
bool from_primary = Shell::GetPrimaryRootWindow() == drag_source_root_;
- const gfx::Rect& primary_bounds = gfx::Screen::GetPrimaryDisplay().bounds();
+ const gfx::Rect& primary_bounds = gfx::Screen::GetPrimaryDisplay(
+ ash::Shell::GetRootNativeView()).bounds();
const gfx::Rect& secondary_bounds = ScreenAsh::GetSecondaryDisplay().bounds();
DisplayLayout::Position position = Shell::GetInstance()->
display_controller()->GetCurrentDisplayLayout().position;
@@ -184,7 +187,8 @@ void MouseCursorEventFilter::UpdateHorizontalIndicatorWindowBounds() {
void MouseCursorEventFilter::UpdateVerticalIndicatorWindowBounds() {
bool in_primary = Shell::GetPrimaryRootWindow() == drag_source_root_;
- const gfx::Rect& primary_bounds = gfx::Screen::GetPrimaryDisplay().bounds();
+ const gfx::Rect& primary_bounds = gfx::Screen::GetPrimaryDisplay(
+ ash::Shell::GetRootNativeView()).bounds();
const gfx::Rect& secondary_bounds = ScreenAsh::GetSecondaryDisplay().bounds();
DisplayLayout::Position position = Shell::GetInstance()->
display_controller()->GetCurrentDisplayLayout().position;

Powered by Google App Engine
This is Rietveld 408576698