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

Unified Diff: ash/wm/panels/attached_panel_window_targeter.cc

Issue 1907363004: (Merge to M-51) Revise the shelf alignment locking mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: 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/test/shelf_test_api.cc ('k') | ash/wm/panels/panel_layout_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/panels/attached_panel_window_targeter.cc
diff --git a/ash/wm/panels/attached_panel_window_targeter.cc b/ash/wm/panels/attached_panel_window_targeter.cc
index 23b0141fa443cc540d8fd41266063510383398f4..cb3c67ff99d76acbd38bb92c08fa8dca7429fb98 100644
--- a/ash/wm/panels/attached_panel_window_targeter.cc
+++ b/ash/wm/panels/attached_panel_window_targeter.cc
@@ -49,21 +49,11 @@ void AttachedPanelWindowTargeter::UpdateTouchExtend(aura::Window* root_window) {
return;
DCHECK(panel_layout_manager_->shelf());
-
gfx::Insets touch(default_touch_extend_);
- switch (panel_layout_manager_->shelf()->alignment()) {
- case SHELF_ALIGNMENT_BOTTOM:
- touch = gfx::Insets(touch.top(), touch.left(), 0, touch.right());
- break;
- case SHELF_ALIGNMENT_LEFT:
- touch = gfx::Insets(touch.top(), 0, touch.bottom(), touch.right());
- break;
- case SHELF_ALIGNMENT_RIGHT:
- touch = gfx::Insets(touch.top(), touch.left(), touch.bottom(), 0);
- break;
- }
-
- set_touch_extend(touch);
+ set_touch_extend(panel_layout_manager_->shelf()->SelectValueForShelfAlignment(
+ gfx::Insets(touch.top(), touch.left(), 0, touch.right()),
+ gfx::Insets(touch.top(), 0, touch.bottom(), touch.right()),
+ gfx::Insets(touch.top(), touch.left(), touch.bottom(), 0)));
}
} // namespace ash
« no previous file with comments | « ash/test/shelf_test_api.cc ('k') | ash/wm/panels/panel_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698