| 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/callback.h" | 10 #include "base/callback.h" |
| (...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1864 return true; | 1864 return true; |
| 1865 } | 1865 } |
| 1866 | 1866 |
| 1867 Browser* TabDragController::CreateBrowserForDrag( | 1867 Browser* TabDragController::CreateBrowserForDrag( |
| 1868 TabStrip* source, | 1868 TabStrip* source, |
| 1869 const gfx::Point& screen_point, | 1869 const gfx::Point& screen_point, |
| 1870 std::vector<gfx::Rect>* drag_bounds) { | 1870 std::vector<gfx::Rect>* drag_bounds) { |
| 1871 Browser* browser = Browser::Create(drag_data_[0].contents->profile()); | 1871 Browser* browser = Browser::Create(drag_data_[0].contents->profile()); |
| 1872 gfx::Point center(0, source->height() / 2); | 1872 gfx::Point center(0, source->height() / 2); |
| 1873 views::View::ConvertPointToWidget(source, ¢er); | 1873 views::View::ConvertPointToWidget(source, ¢er); |
| 1874 gfx::Rect new_bounds(source->GetWidget()->GetWindowScreenBounds()); | 1874 gfx::Rect new_bounds(source->GetWidget()->GetWindowBoundsInScreen()); |
| 1875 new_bounds.set_y(screen_point.y() - center.y()); | 1875 new_bounds.set_y(screen_point.y() - center.y()); |
| 1876 switch (GetDetachPosition(screen_point)) { | 1876 switch (GetDetachPosition(screen_point)) { |
| 1877 case DETACH_BEFORE: | 1877 case DETACH_BEFORE: |
| 1878 new_bounds.set_x(screen_point.x() - center.x()); | 1878 new_bounds.set_x(screen_point.x() - center.x()); |
| 1879 new_bounds.Offset(-mouse_offset_.x(), 0); | 1879 new_bounds.Offset(-mouse_offset_.x(), 0); |
| 1880 break; | 1880 break; |
| 1881 | 1881 |
| 1882 case DETACH_AFTER: { | 1882 case DETACH_AFTER: { |
| 1883 gfx::Point right_edge(source->width(), 0); | 1883 gfx::Point right_edge(source->width(), 0); |
| 1884 views::View::ConvertPointToWidget(source, &right_edge); | 1884 views::View::ConvertPointToWidget(source, &right_edge); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1909 gfx::Point touch_point; | 1909 gfx::Point touch_point; |
| 1910 bool got_touch_point = widget_window->GetRootWindow()-> | 1910 bool got_touch_point = widget_window->GetRootWindow()-> |
| 1911 gesture_recognizer()->GetLastTouchPointForTarget(widget_window, | 1911 gesture_recognizer()->GetLastTouchPointForTarget(widget_window, |
| 1912 &touch_point); | 1912 &touch_point); |
| 1913 DCHECK(got_touch_point); | 1913 DCHECK(got_touch_point); |
| 1914 return touch_point; | 1914 return touch_point; |
| 1915 } | 1915 } |
| 1916 #endif | 1916 #endif |
| 1917 return gfx::Screen::GetCursorScreenPoint(); | 1917 return gfx::Screen::GetCursorScreenPoint(); |
| 1918 } | 1918 } |
| OLD | NEW |