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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 bool should_attach = false; | 133 bool should_attach = false; |
134 if (panel_container_) { | 134 if (panel_container_) { |
135 PanelLayoutManager* panel_layout_manager = | 135 PanelLayoutManager* panel_layout_manager = |
136 GetPanelLayoutManager(panel_container_); | 136 GetPanelLayoutManager(panel_container_); |
137 gfx::Rect launcher_bounds = ScreenUtil::ConvertRectFromScreen( | 137 gfx::Rect launcher_bounds = ScreenUtil::ConvertRectFromScreen( |
138 GetTarget()->parent(), | 138 GetTarget()->parent(), |
139 panel_layout_manager->shelf()-> | 139 panel_layout_manager->shelf()-> |
140 shelf_widget()->GetWindowBoundsInScreen()); | 140 shelf_widget()->GetWindowBoundsInScreen()); |
141 switch (panel_layout_manager->shelf()->alignment()) { | 141 switch (panel_layout_manager->shelf()->alignment()) { |
142 case SHELF_ALIGNMENT_BOTTOM: | 142 case SHELF_ALIGNMENT_BOTTOM: |
| 143 case SHELF_ALIGNMENT_BOTTOM_LOCKED: |
143 if (bounds.bottom() >= (launcher_bounds.y() - | 144 if (bounds.bottom() >= (launcher_bounds.y() - |
144 kPanelSnapToLauncherDistance)) { | 145 kPanelSnapToLauncherDistance)) { |
145 should_attach = true; | 146 should_attach = true; |
146 offset->set_y(launcher_bounds.y() - bounds.height() - bounds.y()); | 147 offset->set_y(launcher_bounds.y() - bounds.height() - bounds.y()); |
147 } | 148 } |
148 break; | 149 break; |
149 case SHELF_ALIGNMENT_LEFT: | 150 case SHELF_ALIGNMENT_LEFT: |
150 if (bounds.x() <= (launcher_bounds.right() + | 151 if (bounds.x() <= (launcher_bounds.right() + |
151 kPanelSnapToLauncherDistance)) { | 152 kPanelSnapToLauncherDistance)) { |
152 should_attach = true; | 153 should_attach = true; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 } | 210 } |
210 | 211 |
211 void PanelWindowResizer::UpdateLauncherPosition() { | 212 void PanelWindowResizer::UpdateLauncherPosition() { |
212 if (panel_container_) { | 213 if (panel_container_) { |
213 GetPanelLayoutManager(panel_container_)->shelf()-> | 214 GetPanelLayoutManager(panel_container_)->shelf()-> |
214 UpdateIconPositionForWindow(GetTarget()); | 215 UpdateIconPositionForWindow(GetTarget()); |
215 } | 216 } |
216 } | 217 } |
217 | 218 |
218 } // namespace aura | 219 } // namespace aura |
OLD | NEW |