OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/wm/panels/attached_panel_window_targeter.h" | 5 #include "ash/wm/panels/attached_panel_window_targeter.h" |
6 | 6 |
7 #include "ash/shelf/shelf.h" | 7 #include "ash/shelf/shelf.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/wm/panels/panel_layout_manager.h" | 9 #include "ash/wm/panels/panel_layout_manager.h" |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 UpdateTouchExtend(root_window); | 42 UpdateTouchExtend(root_window); |
43 } | 43 } |
44 | 44 |
45 void AttachedPanelWindowTargeter::UpdateTouchExtend(aura::Window* root_window) { | 45 void AttachedPanelWindowTargeter::UpdateTouchExtend(aura::Window* root_window) { |
46 // Only update the touch insets for panels if they are attached to the shelf | 46 // Only update the touch insets for panels if they are attached to the shelf |
47 // in |root_window|. | 47 // in |root_window|. |
48 if (panel_container_->GetRootWindow() != root_window) | 48 if (panel_container_->GetRootWindow() != root_window) |
49 return; | 49 return; |
50 | 50 |
51 DCHECK(panel_layout_manager_->shelf()); | 51 DCHECK(panel_layout_manager_->shelf()); |
52 | |
53 gfx::Insets touch(default_touch_extend_); | 52 gfx::Insets touch(default_touch_extend_); |
54 switch (panel_layout_manager_->shelf()->alignment()) { | 53 set_touch_extend(panel_layout_manager_->shelf()->SelectValueForShelfAlignment( |
55 case SHELF_ALIGNMENT_BOTTOM: | 54 gfx::Insets(touch.top(), touch.left(), 0, touch.right()), |
56 touch = gfx::Insets(touch.top(), touch.left(), 0, touch.right()); | 55 gfx::Insets(touch.top(), 0, touch.bottom(), touch.right()), |
57 break; | 56 gfx::Insets(touch.top(), touch.left(), touch.bottom(), 0))); |
58 case SHELF_ALIGNMENT_LEFT: | |
59 touch = gfx::Insets(touch.top(), 0, touch.bottom(), touch.right()); | |
60 break; | |
61 case SHELF_ALIGNMENT_RIGHT: | |
62 touch = gfx::Insets(touch.top(), touch.left(), touch.bottom(), 0); | |
63 break; | |
64 } | |
65 | |
66 set_touch_extend(touch); | |
67 } | 57 } |
68 | 58 |
69 } // namespace ash | 59 } // namespace ash |
OLD | NEW |