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 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1606 } | 1606 } |
1607 } | 1607 } |
1608 } | 1608 } |
1609 if (!has_one_valid_tab) | 1609 if (!has_one_valid_tab) |
1610 return; | 1610 return; |
1611 | 1611 |
1612 model->SetSelectionFromModel(selection_model); | 1612 model->SetSelectionFromModel(selection_model); |
1613 } | 1613 } |
1614 | 1614 |
1615 void TabDragController::RevertDragAt(size_t drag_index) { | 1615 void TabDragController::RevertDragAt(size_t drag_index) { |
1616 DCHECK(started_drag_ && source_tabstrip_); | 1616 DCHECK(started_drag_); |
| 1617 DCHECK(source_tabstrip_); |
1617 | 1618 |
1618 TabDragData* data = &(drag_data_[drag_index]); | 1619 TabDragData* data = &(drag_data_[drag_index]); |
1619 if (attached_tabstrip_) { | 1620 if (attached_tabstrip_) { |
1620 int index = | 1621 int index = |
1621 GetModel(attached_tabstrip_)->GetIndexOfTabContents(data->contents); | 1622 GetModel(attached_tabstrip_)->GetIndexOfTabContents(data->contents); |
1622 if (attached_tabstrip_ != source_tabstrip_) { | 1623 if (attached_tabstrip_ != source_tabstrip_) { |
1623 // The Tab was inserted into another TabStrip. We need to put it back | 1624 // The Tab was inserted into another TabStrip. We need to put it back |
1624 // into the original one. | 1625 // into the original one. |
1625 GetModel(attached_tabstrip_)->DetachTabContentsAt(index); | 1626 GetModel(attached_tabstrip_)->DetachTabContentsAt(index); |
1626 // TODO(beng): (Cleanup) seems like we should use Attach() for this | 1627 // TODO(beng): (Cleanup) seems like we should use Attach() for this |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1925 gfx::Point touch_point; | 1926 gfx::Point touch_point; |
1926 bool got_touch_point = widget_window->GetRootWindow()-> | 1927 bool got_touch_point = widget_window->GetRootWindow()-> |
1927 gesture_recognizer()->GetLastTouchPointForTarget(widget_window, | 1928 gesture_recognizer()->GetLastTouchPointForTarget(widget_window, |
1928 &touch_point); | 1929 &touch_point); |
1929 DCHECK(got_touch_point); | 1930 DCHECK(got_touch_point); |
1930 return touch_point; | 1931 return touch_point; |
1931 } | 1932 } |
1932 #endif | 1933 #endif |
1933 return gfx::Screen::GetCursorScreenPoint(); | 1934 return gfx::Screen::GetCursorScreenPoint(); |
1934 } | 1935 } |
OLD | NEW |