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

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

Issue 2228713003: mash: Convert ShelfView to wm common types, clean up Shelf access (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix control reaches end of non-void function warnings Created 4 years, 4 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_view_test_api.cc ('k') | ash/wm/panels/panel_layout_manager_unittest.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 c2c85df5d93124f91b94d57c222e12f71aed27df..027455983d0b98759208e745227f04679a37f0b3 100644
--- a/ash/wm/panels/attached_panel_window_targeter.cc
+++ b/ash/wm/panels/attached_panel_window_targeter.cc
@@ -4,8 +4,8 @@
#include "ash/wm/panels/attached_panel_window_targeter.h"
-#include "ash/aura/wm_shelf_aura.h"
#include "ash/aura/wm_window_aura.h"
+#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/wm/panels/panel_layout_manager.h"
#include "ash/common/wm_shell.h"
#include "ash/shelf/shelf.h"
@@ -53,12 +53,21 @@ void AttachedPanelWindowTargeter::UpdateTouchExtend(aura::Window* root_window) {
DCHECK(panel_layout_manager_->shelf());
gfx::Insets touch(default_touch_extend_);
- set_touch_extend(
- WmShelfAura::GetShelf(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)));
+ switch (panel_layout_manager_->shelf()->GetAlignment()) {
+ case SHELF_ALIGNMENT_BOTTOM:
+ case SHELF_ALIGNMENT_BOTTOM_LOCKED:
+ set_touch_extend(
+ gfx::Insets(touch.top(), touch.left(), 0, touch.right()));
+ break;
+ case SHELF_ALIGNMENT_LEFT:
+ set_touch_extend(
+ gfx::Insets(touch.top(), 0, touch.bottom(), touch.right()));
+ break;
+ case SHELF_ALIGNMENT_RIGHT:
+ set_touch_extend(
+ gfx::Insets(touch.top(), touch.left(), touch.bottom(), 0));
+ break;
+ }
}
} // namespace ash
« no previous file with comments | « ash/test/shelf_view_test_api.cc ('k') | ash/wm/panels/panel_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698