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

Unified Diff: ash/shelf/shelf_bezel_event_filter.cc

Issue 1877543002: Revise the shelf alignment locking mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update and cleanup tests. Created 4 years, 8 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/shelf/shelf.cc ('k') | ash/shelf/shelf_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_bezel_event_filter.cc
diff --git a/ash/shelf/shelf_bezel_event_filter.cc b/ash/shelf/shelf_bezel_event_filter.cc
index 39f81012cba53ca5dfdbc81e74daffcbd353025c..3d6ab4765be2875066e39bb8dbb66412099b0b93 100644
--- a/ash/shelf/shelf_bezel_event_filter.cc
+++ b/ash/shelf/shelf_bezel_event_filter.cc
@@ -51,24 +51,11 @@ void ShelfBezelEventFilter::OnGestureEvent(
}
}
-bool ShelfBezelEventFilter::IsShelfOnBezel(
- const gfx::Rect& screen,
- const gfx::Point& point) const{
- switch (shelf_->GetAlignment()) {
- case SHELF_ALIGNMENT_BOTTOM:
- if (point.y() >= screen.bottom())
- return true;
- break;
- case SHELF_ALIGNMENT_LEFT:
- if (point.x() <= screen.x())
- return true;
- break;
- case SHELF_ALIGNMENT_RIGHT:
- if (point.x() >= screen.right())
- return true;
- break;
- }
- return false;
+bool ShelfBezelEventFilter::IsShelfOnBezel(const gfx::Rect& screen,
+ const gfx::Point& point) const {
+ return shelf_->SelectValueForShelfAlignment(point.y() >= screen.bottom(),
+ point.x() <= screen.x(),
+ point.x() >= screen.right());
}
} // namespace ash
« no previous file with comments | « ash/shelf/shelf.cc ('k') | ash/shelf/shelf_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698