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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 void PanelWindowResizer::Drag(const gfx::Point& location, int event_flags) { | 52 void PanelWindowResizer::Drag(const gfx::Point& location, int event_flags) { |
53 last_location_ = location; | 53 last_location_ = location; |
54 ::wm::ConvertPointToScreen(GetTarget()->parent(), &last_location_); | 54 ::wm::ConvertPointToScreen(GetTarget()->parent(), &last_location_); |
55 if (!did_move_or_resize_) { | 55 if (!did_move_or_resize_) { |
56 did_move_or_resize_ = true; | 56 did_move_or_resize_ = true; |
57 StartedDragging(); | 57 StartedDragging(); |
58 } | 58 } |
59 | 59 |
60 // Check if the destination has changed displays. | 60 // Check if the destination has changed displays. |
61 gfx::Screen* screen = Shell::GetScreen(); | 61 gfx::Screen* screen = gfx::Screen::GetScreen(); |
62 const gfx::Display dst_display = | 62 const gfx::Display dst_display = |
63 screen->GetDisplayNearestPoint(last_location_); | 63 screen->GetDisplayNearestPoint(last_location_); |
64 if (dst_display.id() != | 64 if (dst_display.id() != |
65 screen->GetDisplayNearestWindow(panel_container_->GetRootWindow()).id()) { | 65 screen->GetDisplayNearestWindow(panel_container_->GetRootWindow()).id()) { |
66 // The panel is being dragged to a new display. If the previous container is | 66 // The panel is being dragged to a new display. If the previous container is |
67 // the current parent of the panel it will be informed of the end of drag | 67 // the current parent of the panel it will be informed of the end of drag |
68 // when the panel is reparented, otherwise let the previous container know | 68 // when the panel is reparented, otherwise let the previous container know |
69 // the drag is complete. If we told the panel's parent that the drag was | 69 // the drag is complete. If we told the panel's parent that the drag was |
70 // complete it would begin positioning the panel. | 70 // complete it would begin positioning the panel. |
71 if (GetTarget()->parent() != panel_container_) | 71 if (GetTarget()->parent() != panel_container_) |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 } | 216 } |
217 | 217 |
218 void PanelWindowResizer::UpdateLauncherPosition() { | 218 void PanelWindowResizer::UpdateLauncherPosition() { |
219 if (panel_container_) { | 219 if (panel_container_) { |
220 GetPanelLayoutManager(panel_container_)->shelf()-> | 220 GetPanelLayoutManager(panel_container_)->shelf()-> |
221 UpdateIconPositionForWindow(GetTarget()); | 221 UpdateIconPositionForWindow(GetTarget()); |
222 } | 222 } |
223 } | 223 } |
224 | 224 |
225 } // namespace aura | 225 } // namespace aura |
OLD | NEW |