| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/panel_window_resizer.h" | 5 #include "ash/wm/panels/panel_window_resizer.h" |
| 6 | 6 |
| 7 #include "ash/display/window_tree_host_manager.h" | 7 #include "ash/display/window_tree_host_manager.h" |
| 8 #include "ash/screen_util.h" | 8 #include "ash/screen_util.h" |
| 9 #include "ash/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" |
| 10 #include "ash/shelf/shelf_types.h" | 10 #include "ash/shelf/shelf_types.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 offset->set_x(launcher_bounds.right() - bounds.x()); | 153 offset->set_x(launcher_bounds.right() - bounds.x()); |
| 154 } | 154 } |
| 155 break; | 155 break; |
| 156 case SHELF_ALIGNMENT_RIGHT: | 156 case SHELF_ALIGNMENT_RIGHT: |
| 157 if (bounds.right() >= (launcher_bounds.x() - | 157 if (bounds.right() >= (launcher_bounds.x() - |
| 158 kPanelSnapToLauncherDistance)) { | 158 kPanelSnapToLauncherDistance)) { |
| 159 should_attach = true; | 159 should_attach = true; |
| 160 offset->set_x(launcher_bounds.x() - bounds.width() - bounds.x()); | 160 offset->set_x(launcher_bounds.x() - bounds.width() - bounds.x()); |
| 161 } | 161 } |
| 162 break; | 162 break; |
| 163 case SHELF_ALIGNMENT_TOP: | |
| 164 if (bounds.y() <= (launcher_bounds.bottom() + | |
| 165 kPanelSnapToLauncherDistance)) { | |
| 166 should_attach = true; | |
| 167 offset->set_y(launcher_bounds.bottom() - bounds.y()); | |
| 168 } | |
| 169 break; | |
| 170 } | 163 } |
| 171 } | 164 } |
| 172 return should_attach; | 165 return should_attach; |
| 173 } | 166 } |
| 174 | 167 |
| 175 void PanelWindowResizer::StartedDragging() { | 168 void PanelWindowResizer::StartedDragging() { |
| 176 // Tell the panel layout manager that we are dragging this panel before | 169 // Tell the panel layout manager that we are dragging this panel before |
| 177 // attaching it so that it does not get repositioned. | 170 // attaching it so that it does not get repositioned. |
| 178 if (panel_container_) | 171 if (panel_container_) |
| 179 GetPanelLayoutManager(panel_container_)->StartDragging(GetTarget()); | 172 GetPanelLayoutManager(panel_container_)->StartDragging(GetTarget()); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 } | 209 } |
| 217 | 210 |
| 218 void PanelWindowResizer::UpdateLauncherPosition() { | 211 void PanelWindowResizer::UpdateLauncherPosition() { |
| 219 if (panel_container_) { | 212 if (panel_container_) { |
| 220 GetPanelLayoutManager(panel_container_)->shelf()-> | 213 GetPanelLayoutManager(panel_container_)->shelf()-> |
| 221 UpdateIconPositionForWindow(GetTarget()); | 214 UpdateIconPositionForWindow(GetTarget()); |
| 222 } | 215 } |
| 223 } | 216 } |
| 224 | 217 |
| 225 } // namespace aura | 218 } // namespace aura |
| OLD | NEW |