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

Unified Diff: ash/display/mouse_cursor_event_filter.cc

Issue 10905288: Switch primary display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 3 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
« no previous file with comments | « ash/display/display_controller_unittest.cc ('k') | ash/display/multi_display_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 469db416c15aa664b9d6f859830ff0a6ea29da36..e725e43e00e26ef52f7172204589e4535bb3ce57 100644
--- a/ash/display/mouse_cursor_event_filter.cc
+++ b/ash/display/mouse_cursor_event_filter.cc
@@ -6,6 +6,7 @@
#include "ash/display/display_controller.h"
#include "ash/display/shared_display_edge_indicator.h"
+#include "ash/screen_ash.h"
#include "ash/shell.h"
#include "ash/wm/coordinate_conversion.h"
#include "ash/wm/cursor_manager.h"
@@ -56,7 +57,7 @@ void MouseCursorEventFilter::ShowSharedEdgeIndicator(
drag_source_root_ = from;
DisplayLayout::Position position = Shell::GetInstance()->
- display_controller()->default_display_layout().position;
+ display_controller()->GetCurrentDisplayLayout().position;
if (position == DisplayLayout::TOP || position == DisplayLayout::BOTTOM)
UpdateHorizontalIndicatorWindowBounds();
else
@@ -163,13 +164,10 @@ bool MouseCursorEventFilter::WarpMouseCursorIfNecessary(
void MouseCursorEventFilter::UpdateHorizontalIndicatorWindowBounds() {
bool from_primary = Shell::GetPrimaryRootWindow() == drag_source_root_;
- aura::DisplayManager* display_manager =
- aura::Env::GetInstance()->display_manager();
- const gfx::Rect& primary_bounds = display_manager->GetDisplayAt(0)->bounds();
- const gfx::Rect& secondary_bounds =
- display_manager->GetDisplayAt(1)->bounds();
+ const gfx::Rect& primary_bounds = gfx::Screen::GetPrimaryDisplay().bounds();
+ const gfx::Rect& secondary_bounds = ScreenAsh::GetSecondaryDisplay().bounds();
DisplayLayout::Position position = Shell::GetInstance()->
- display_controller()->default_display_layout().position;
+ display_controller()->GetCurrentDisplayLayout().position;
src_indicator_bounds_.set_x(
std::max(primary_bounds.x(), secondary_bounds.x()));
@@ -192,13 +190,11 @@ void MouseCursorEventFilter::UpdateHorizontalIndicatorWindowBounds() {
void MouseCursorEventFilter::UpdateVerticalIndicatorWindowBounds() {
bool in_primary = Shell::GetPrimaryRootWindow() == drag_source_root_;
- aura::DisplayManager* display_manager =
- aura::Env::GetInstance()->display_manager();
- const gfx::Rect& primary_bounds = display_manager->GetDisplayAt(0)->bounds();
- const gfx::Rect& secondary_bounds =
- display_manager->GetDisplayAt(1)->bounds();
+
+ const gfx::Rect& primary_bounds = gfx::Screen::GetPrimaryDisplay().bounds();
+ const gfx::Rect& secondary_bounds = ScreenAsh::GetSecondaryDisplay().bounds();
DisplayLayout::Position position = Shell::GetInstance()->
- display_controller()->default_display_layout().position;
+ display_controller()->GetCurrentDisplayLayout().position;
int upper_shared_y = std::max(primary_bounds.y(), secondary_bounds.y());
int lower_shared_y = std::min(primary_bounds.bottom(),
« no previous file with comments | « ash/display/display_controller_unittest.cc ('k') | ash/display/multi_display_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698