| 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 "chrome/browser/ui/views/tabs/tab_drag_controller.h" | 5 #include "chrome/browser/ui/views/tabs/tab_drag_controller.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 2165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2176 // Find a topmost non-popup window and stack the recipient browser above | 2176 // Find a topmost non-popup window and stack the recipient browser above |
| 2177 // it in order to avoid stacking the browser window on top of the phantom | 2177 // it in order to avoid stacking the browser window on top of the phantom |
| 2178 // drag widget created by DragWindowController in a second display. | 2178 // drag widget created by DragWindowController in a second display. |
| 2179 for (aura::Window::Windows::const_reverse_iterator it = | 2179 for (aura::Window::Windows::const_reverse_iterator it = |
| 2180 browser_window->parent()->children().rbegin(); | 2180 browser_window->parent()->children().rbegin(); |
| 2181 it != browser_window->parent()->children().rend(); ++it) { | 2181 it != browser_window->parent()->children().rend(); ++it) { |
| 2182 // If the iteration reached the recipient browser window then it is | 2182 // If the iteration reached the recipient browser window then it is |
| 2183 // already topmost and it is safe to return with no stacking change. | 2183 // already topmost and it is safe to return with no stacking change. |
| 2184 if (*it == browser_window) | 2184 if (*it == browser_window) |
| 2185 return; | 2185 return; |
| 2186 if ((*it)->type() != aura::client::WINDOW_TYPE_POPUP) { | 2186 if ((*it)->type() != ui::wm::WINDOW_TYPE_POPUP) { |
| 2187 widget_window->StackAbove(*it); | 2187 widget_window->StackAbove(*it); |
| 2188 break; | 2188 break; |
| 2189 } | 2189 } |
| 2190 } | 2190 } |
| 2191 } else { | 2191 } else { |
| 2192 widget_window->StackAtTop(); | 2192 widget_window->StackAtTop(); |
| 2193 } | 2193 } |
| 2194 #else | 2194 #else |
| 2195 widget_window->StackAtTop(); | 2195 widget_window->StackAtTop(); |
| 2196 #endif | 2196 #endif |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2354 gfx::Vector2d TabDragController::GetWindowOffset( | 2354 gfx::Vector2d TabDragController::GetWindowOffset( |
| 2355 const gfx::Point& point_in_screen) { | 2355 const gfx::Point& point_in_screen) { |
| 2356 TabStrip* owning_tabstrip = (attached_tabstrip_ && detach_into_browser_) ? | 2356 TabStrip* owning_tabstrip = (attached_tabstrip_ && detach_into_browser_) ? |
| 2357 attached_tabstrip_ : source_tabstrip_; | 2357 attached_tabstrip_ : source_tabstrip_; |
| 2358 views::View* toplevel_view = owning_tabstrip->GetWidget()->GetContentsView(); | 2358 views::View* toplevel_view = owning_tabstrip->GetWidget()->GetContentsView(); |
| 2359 | 2359 |
| 2360 gfx::Point point = point_in_screen; | 2360 gfx::Point point = point_in_screen; |
| 2361 views::View::ConvertPointFromScreen(toplevel_view, &point); | 2361 views::View::ConvertPointFromScreen(toplevel_view, &point); |
| 2362 return point.OffsetFromOrigin(); | 2362 return point.OffsetFromOrigin(); |
| 2363 } | 2363 } |
| OLD | NEW |