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

Unified Diff: ash/display/mouse_cursor_event_filter.cc

Issue 10870036: Allow storing display preferences per device. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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/mouse_cursor_event_filter.h ('k') | ash/display/mouse_cursor_event_filter_unittest.cc » ('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 d2ad3e4d87692b6df83842b7213a830cbb8355ba..b84986e2394ec4aeffbf1c51b207cb694f4c8986 100644
--- a/ash/display/mouse_cursor_event_filter.cc
+++ b/ash/display/mouse_cursor_event_filter.cc
@@ -55,9 +55,9 @@ void MouseCursorEventFilter::ShowSharedEdgeIndicator(
}
drag_source_root_ = from;
- DisplayController::SecondaryDisplayLayout layout =
- Shell::GetInstance()->display_controller()->secondary_display_layout();
- if (layout == DisplayController::TOP || layout == DisplayController::BOTTOM)
+ DisplayLayout::Position position = Shell::GetInstance()->
+ display_controller()->default_display_layout().position;
+ if (position == DisplayLayout::TOP || position == DisplayLayout::BOTTOM)
UpdateHorizontalIndicatorWindowBounds();
else
UpdateVerticalIndicatorWindowBounds();
@@ -165,8 +165,8 @@ void MouseCursorEventFilter::UpdateHorizontalIndicatorWindowBounds() {
const gfx::Rect& primary_bounds = display_manager->GetDisplayAt(0)->bounds();
const gfx::Rect& secondary_bounds =
display_manager->GetDisplayAt(1)->bounds();
- DisplayController::SecondaryDisplayLayout layout =
- Shell::GetInstance()->display_controller()->secondary_display_layout();
+ DisplayLayout::Position position = Shell::GetInstance()->
+ display_controller()->default_display_layout().position;
src_indicator_bounds_.set_x(
std::max(primary_bounds.x(), secondary_bounds.x()));
@@ -175,14 +175,14 @@ void MouseCursorEventFilter::UpdateHorizontalIndicatorWindowBounds() {
src_indicator_bounds_.x());
src_indicator_bounds_.set_height(kIndicatorThickness);
src_indicator_bounds_.set_y(
- layout == DisplayController::TOP ?
+ position == DisplayLayout::TOP ?
primary_bounds.y() - (from_primary ? 0 : kIndicatorThickness) :
primary_bounds.bottom() - (from_primary ? kIndicatorThickness : 0));
dst_indicator_bounds_ = src_indicator_bounds_;
dst_indicator_bounds_.set_height(kIndicatorThickness);
dst_indicator_bounds_.set_y(
- layout == DisplayController::TOP ?
+ position == DisplayLayout::TOP ?
primary_bounds.y() - (from_primary ? kIndicatorThickness : 0) :
primary_bounds.bottom() - (from_primary ? 0 : kIndicatorThickness));
}
@@ -194,15 +194,15 @@ void MouseCursorEventFilter::UpdateVerticalIndicatorWindowBounds() {
const gfx::Rect& primary_bounds = display_manager->GetDisplayAt(0)->bounds();
const gfx::Rect& secondary_bounds =
display_manager->GetDisplayAt(1)->bounds();
- DisplayController::SecondaryDisplayLayout layout =
- Shell::GetInstance()->display_controller()->secondary_display_layout();
+ DisplayLayout::Position position = Shell::GetInstance()->
+ display_controller()->default_display_layout().position;
int upper_shared_y = std::max(primary_bounds.y(), secondary_bounds.y());
int lower_shared_y = std::min(primary_bounds.bottom(),
secondary_bounds.bottom());
int shared_height = lower_shared_y - upper_shared_y;
- int dst_x = layout == DisplayController::LEFT ?
+ int dst_x = position == DisplayLayout::LEFT ?
primary_bounds.x() - (in_primary ? kIndicatorThickness : 0) :
primary_bounds.right() - (in_primary ? 0 : kIndicatorThickness);
dst_indicator_bounds_.SetRect(
@@ -211,7 +211,7 @@ void MouseCursorEventFilter::UpdateVerticalIndicatorWindowBounds() {
// The indicator on the source display.
src_indicator_bounds_.set_width(kIndicatorThickness);
src_indicator_bounds_.set_x(
- layout == DisplayController::LEFT ?
+ position == DisplayLayout::LEFT ?
primary_bounds.x() - (in_primary ? 0 : kIndicatorThickness) :
primary_bounds.right() - (in_primary ? kIndicatorThickness : 0));
« no previous file with comments | « ash/display/mouse_cursor_event_filter.h ('k') | ash/display/mouse_cursor_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698