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/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/screen_ash.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" |
11 #include "ash/shelf/shelf_widget.h" | 11 #include "ash/shelf/shelf_widget.h" |
12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
13 #include "ash/shell_window_ids.h" | 13 #include "ash/shell_window_ids.h" |
14 #include "ash/wm/coordinate_conversion.h" | 14 #include "ash/wm/coordinate_conversion.h" |
15 #include "ash/wm/panels/panel_layout_manager.h" | 15 #include "ash/wm/panels/panel_layout_manager.h" |
16 #include "ash/wm/window_state.h" | 16 #include "ash/wm/window_state.h" |
17 #include "ash/wm/window_util.h" | 17 #include "ash/wm/window_util.h" |
18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 internal::kShellWindowId_PanelContainer); | 129 internal::kShellWindowId_PanelContainer); |
130 initial_panel_container_ = panel_container_; | 130 initial_panel_container_ = panel_container_; |
131 } | 131 } |
132 | 132 |
133 bool PanelWindowResizer::AttachToLauncher(const gfx::Rect& bounds, | 133 bool PanelWindowResizer::AttachToLauncher(const gfx::Rect& bounds, |
134 gfx::Point* offset) { | 134 gfx::Point* offset) { |
135 bool should_attach = false; | 135 bool should_attach = false; |
136 if (panel_container_) { | 136 if (panel_container_) { |
137 internal::PanelLayoutManager* panel_layout_manager = | 137 internal::PanelLayoutManager* panel_layout_manager = |
138 GetPanelLayoutManager(panel_container_); | 138 GetPanelLayoutManager(panel_container_); |
139 gfx::Rect launcher_bounds = ScreenAsh::ConvertRectFromScreen( | 139 gfx::Rect launcher_bounds = ScreenUtil::ConvertRectFromScreen( |
140 GetTarget()->parent(), | 140 GetTarget()->parent(), |
141 panel_layout_manager->shelf()-> | 141 panel_layout_manager->shelf()-> |
142 shelf_widget()->GetWindowBoundsInScreen()); | 142 shelf_widget()->GetWindowBoundsInScreen()); |
143 switch (panel_layout_manager->shelf()->alignment()) { | 143 switch (panel_layout_manager->shelf()->alignment()) { |
144 case SHELF_ALIGNMENT_BOTTOM: | 144 case SHELF_ALIGNMENT_BOTTOM: |
145 if (bounds.bottom() >= (launcher_bounds.y() - | 145 if (bounds.bottom() >= (launcher_bounds.y() - |
146 kPanelSnapToLauncherDistance)) { | 146 kPanelSnapToLauncherDistance)) { |
147 should_attach = true; | 147 should_attach = true; |
148 offset->set_y(launcher_bounds.y() - bounds.height() - bounds.y()); | 148 offset->set_y(launcher_bounds.y() - bounds.height() - bounds.y()); |
149 } | 149 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 } | 219 } |
220 | 220 |
221 void PanelWindowResizer::UpdateLauncherPosition() { | 221 void PanelWindowResizer::UpdateLauncherPosition() { |
222 if (panel_container_) { | 222 if (panel_container_) { |
223 GetPanelLayoutManager(panel_container_)->shelf()-> | 223 GetPanelLayoutManager(panel_container_)->shelf()-> |
224 UpdateIconPositionForWindow(GetTarget()); | 224 UpdateIconPositionForWindow(GetTarget()); |
225 } | 225 } |
226 } | 226 } |
227 | 227 |
228 } // namespace aura | 228 } // namespace aura |
OLD | NEW |