| 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/aura/wm_shelf_aura.h" |
| 9 #include "ash/wm/panels/panel_layout_manager.h" | 10 #include "ash/wm/panels/panel_layout_manager.h" |
| 10 | 11 |
| 11 namespace ash { | 12 namespace ash { |
| 12 | 13 |
| 13 AttachedPanelWindowTargeter::AttachedPanelWindowTargeter( | 14 AttachedPanelWindowTargeter::AttachedPanelWindowTargeter( |
| 14 aura::Window* container, | 15 aura::Window* container, |
| 15 const gfx::Insets& default_mouse_extend, | 16 const gfx::Insets& default_mouse_extend, |
| 16 const gfx::Insets& default_touch_extend, | 17 const gfx::Insets& default_touch_extend, |
| 17 PanelLayoutManager* panel_layout_manager) | 18 PanelLayoutManager* panel_layout_manager) |
| 18 : ::wm::EasyResizeWindowTargeter(container, | 19 : ::wm::EasyResizeWindowTargeter(container, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 43 } | 44 } |
| 44 | 45 |
| 45 void AttachedPanelWindowTargeter::UpdateTouchExtend(aura::Window* root_window) { | 46 void AttachedPanelWindowTargeter::UpdateTouchExtend(aura::Window* root_window) { |
| 46 // Only update the touch insets for panels if they are attached to the shelf | 47 // Only update the touch insets for panels if they are attached to the shelf |
| 47 // in |root_window|. | 48 // in |root_window|. |
| 48 if (panel_container_->GetRootWindow() != root_window) | 49 if (panel_container_->GetRootWindow() != root_window) |
| 49 return; | 50 return; |
| 50 | 51 |
| 51 DCHECK(panel_layout_manager_->shelf()); | 52 DCHECK(panel_layout_manager_->shelf()); |
| 52 gfx::Insets touch(default_touch_extend_); | 53 gfx::Insets touch(default_touch_extend_); |
| 53 set_touch_extend(panel_layout_manager_->shelf()->SelectValueForShelfAlignment( | 54 set_touch_extend( |
| 54 gfx::Insets(touch.top(), touch.left(), 0, touch.right()), | 55 wm::WmShelfAura::GetShelf(panel_layout_manager_->shelf()) |
| 55 gfx::Insets(touch.top(), 0, touch.bottom(), touch.right()), | 56 ->SelectValueForShelfAlignment( |
| 56 gfx::Insets(touch.top(), touch.left(), touch.bottom(), 0))); | 57 gfx::Insets(touch.top(), touch.left(), 0, touch.right()), |
| 58 gfx::Insets(touch.top(), 0, touch.bottom(), touch.right()), |
| 59 gfx::Insets(touch.top(), touch.left(), touch.bottom(), 0))); |
| 57 } | 60 } |
| 58 | 61 |
| 59 } // namespace ash | 62 } // namespace ash |
| OLD | NEW |