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