OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/dragged_tab_controller.h" | 5 #include "chrome/browser/ui/views/tabs/dragged_tab_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 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 } | 1341 } |
1342 | 1342 |
1343 gfx::Point DraggedTabController::GetCursorScreenPoint() const { | 1343 gfx::Point DraggedTabController::GetCursorScreenPoint() const { |
1344 #if defined(OS_WIN) | 1344 #if defined(OS_WIN) |
1345 DWORD pos = GetMessagePos(); | 1345 DWORD pos = GetMessagePos(); |
1346 return gfx::Point(pos); | 1346 return gfx::Point(pos); |
1347 #elif defined(TOOLKIT_USES_GTK) | 1347 #elif defined(TOOLKIT_USES_GTK) |
1348 gint x, y; | 1348 gint x, y; |
1349 gdk_display_get_pointer(gdk_display_get_default(), NULL, &x, &y, NULL); | 1349 gdk_display_get_pointer(gdk_display_get_default(), NULL, &x, &y, NULL); |
1350 return gfx::Point(x, y); | 1350 return gfx::Point(x, y); |
| 1351 #else |
| 1352 NOTIMPLEMENTED(); |
| 1353 return gfx::Point(); |
1351 #endif | 1354 #endif |
1352 } | 1355 } |
1353 | 1356 |
1354 gfx::Rect DraggedTabController::GetViewScreenBounds(views::View* view) const { | 1357 gfx::Rect DraggedTabController::GetViewScreenBounds(views::View* view) const { |
1355 gfx::Point view_topleft; | 1358 gfx::Point view_topleft; |
1356 views::View::ConvertPointToScreen(view, &view_topleft); | 1359 views::View::ConvertPointToScreen(view, &view_topleft); |
1357 gfx::Rect view_screen_bounds = view->GetLocalBounds(); | 1360 gfx::Rect view_screen_bounds = view->GetLocalBounds(); |
1358 view_screen_bounds.Offset(view_topleft.x(), view_topleft.y()); | 1361 view_screen_bounds.Offset(view_topleft.x(), view_topleft.y()); |
1359 return view_screen_bounds; | 1362 return view_screen_bounds; |
1360 } | 1363 } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 | 1438 |
1436 bool DraggedTabController::AreTabsConsecutive() { | 1439 bool DraggedTabController::AreTabsConsecutive() { |
1437 for (size_t i = 1; i < drag_data_.size(); ++i) { | 1440 for (size_t i = 1; i < drag_data_.size(); ++i) { |
1438 if (drag_data_[i - 1].source_model_index + 1 != | 1441 if (drag_data_[i - 1].source_model_index + 1 != |
1439 drag_data_[i].source_model_index) { | 1442 drag_data_[i].source_model_index) { |
1440 return false; | 1443 return false; |
1441 } | 1444 } |
1442 } | 1445 } |
1443 return true; | 1446 return true; |
1444 } | 1447 } |
OLD | NEW |