Chromium Code Reviews| 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/drag_window_resizer.h" | 5 #include "ash/wm/drag_window_resizer.h" |
| 6 | 6 |
| 7 #include "ash/display/mouse_cursor_event_filter.h" | 7 #include "ash/display/mouse_cursor_event_filter.h" |
| 8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/wm/coordinate_conversion.h" | 10 #include "ash/wm/coordinate_conversion.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 | 103 |
| 104 GetTarget()->layer()->SetOpacity(details_.initial_opacity); | 104 GetTarget()->layer()->SetOpacity(details_.initial_opacity); |
| 105 drag_window_controller_.reset(); | 105 drag_window_controller_.reset(); |
| 106 | 106 |
| 107 // Check if the destination is another display. | 107 // Check if the destination is another display. |
| 108 gfx::Point last_mouse_location_in_screen = last_mouse_location_; | 108 gfx::Point last_mouse_location_in_screen = last_mouse_location_; |
| 109 wm::ConvertPointToScreen(GetTarget()->parent(), | 109 wm::ConvertPointToScreen(GetTarget()->parent(), |
| 110 &last_mouse_location_in_screen); | 110 &last_mouse_location_in_screen); |
| 111 gfx::Screen* screen = Shell::GetScreen(); | 111 gfx::Screen* screen = Shell::GetScreen(); |
| 112 const gfx::Display dst_display = | 112 const gfx::Display dst_display = |
| 113 screen->GetDisplayNearestPoint(last_mouse_location_in_screen); | 113 ScreenAsh::FindDisplayContainingPoint(last_mouse_location_in_screen); |
| 114 | 114 if (!dst_display.is_valid()) |
|
flackr
2013/09/06 02:18:43
What happens in this case? If the drag crossed int
varkha
2013/09/09 15:38:42
I think this only happens when you don't --ash-con
| |
| 115 return; | |
| 115 if (dst_display.id() != | 116 if (dst_display.id() != |
| 116 screen->GetDisplayNearestWindow(GetTarget()->GetRootWindow()).id()) { | 117 screen->GetDisplayNearestWindow(GetTarget()->GetRootWindow()).id()) { |
| 117 const gfx::Rect dst_bounds = | 118 const gfx::Rect dst_bounds = |
| 118 ScreenAsh::ConvertRectToScreen(GetTarget()->parent(), | 119 ScreenAsh::ConvertRectToScreen(GetTarget()->parent(), |
| 119 GetTarget()->bounds()); | 120 GetTarget()->bounds()); |
| 120 GetTarget()->SetBoundsInScreen(dst_bounds, dst_display); | 121 GetTarget()->SetBoundsInScreen(dst_bounds, dst_display); |
| 121 } | 122 } |
| 122 } | 123 } |
| 123 | 124 |
| 124 void DragWindowResizer::RevertDrag() { | 125 void DragWindowResizer::RevertDrag() { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 201 | 202 |
| 202 bool DragWindowResizer::ShouldAllowMouseWarp() { | 203 bool DragWindowResizer::ShouldAllowMouseWarp() { |
| 203 return (details_.window_component == HTCAPTION) && | 204 return (details_.window_component == HTCAPTION) && |
| 204 !GetTarget()->transient_parent() && | 205 !GetTarget()->transient_parent() && |
| 205 (GetTarget()->type() == aura::client::WINDOW_TYPE_NORMAL || | 206 (GetTarget()->type() == aura::client::WINDOW_TYPE_NORMAL || |
| 206 GetTarget()->type() == aura::client::WINDOW_TYPE_PANEL); | 207 GetTarget()->type() == aura::client::WINDOW_TYPE_PANEL); |
| 207 } | 208 } |
| 208 | 209 |
| 209 } // namespace internal | 210 } // namespace internal |
| 210 } // namespace ash | 211 } // namespace ash |
| OLD | NEW |