| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/tabs/dragged_tab_controller.h" | 5 #include "chrome/browser/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 "app/animation.h" | 10 #include "app/animation.h" |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 int to_index = GetInsertionIndexForDraggedBounds(bounds, true); | 713 int to_index = GetInsertionIndexForDraggedBounds(bounds, true); |
| 714 to_index = NormalizeIndexToAttachedTabStrip(to_index); | 714 to_index = NormalizeIndexToAttachedTabStrip(to_index); |
| 715 if (from_index != to_index) { | 715 if (from_index != to_index) { |
| 716 last_move_screen_loc_ = MajorAxisValue(screen_point, attached_tabstrip_); | 716 last_move_screen_loc_ = MajorAxisValue(screen_point, attached_tabstrip_); |
| 717 attached_model->MoveTabContentsAt(from_index, to_index, true); | 717 attached_model->MoveTabContentsAt(from_index, to_index, true); |
| 718 } | 718 } |
| 719 } | 719 } |
| 720 | 720 |
| 721 attached_tab_->SchedulePaint(); | 721 attached_tab_->SchedulePaint(); |
| 722 attached_tab_->SetX(dragged_view_point.x()); | 722 attached_tab_->SetX(dragged_view_point.x()); |
| 723 attached_tab_->SetX( |
| 724 attached_tabstrip_->MirroredLeftPointForRect(attached_tab_->bounds())); |
| 723 attached_tab_->SetY(dragged_view_point.y()); | 725 attached_tab_->SetY(dragged_view_point.y()); |
| 724 attached_tab_->SchedulePaint(); | 726 attached_tab_->SchedulePaint(); |
| 725 } | 727 } |
| 726 | 728 |
| 727 void DraggedTabController::MoveDetachedTab(const gfx::Point& screen_point) { | 729 void DraggedTabController::MoveDetachedTab(const gfx::Point& screen_point) { |
| 728 DCHECK(!attached_tabstrip_); | 730 DCHECK(!attached_tabstrip_); |
| 729 DCHECK(view_.get()); | 731 DCHECK(view_.get()); |
| 730 | 732 |
| 731 int x = screen_point.x() - mouse_offset_.x(); | 733 int x = screen_point.x() - mouse_offset_.x(); |
| 732 int y = screen_point.y() - mouse_offset_.y(); | 734 int y = screen_point.y() - mouse_offset_.y(); |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 #else | 1344 #else |
| 1343 NOTIMPLEMENTED(); | 1345 NOTIMPLEMENTED(); |
| 1344 #endif | 1346 #endif |
| 1345 } | 1347 } |
| 1346 } | 1348 } |
| 1347 | 1349 |
| 1348 TabStripModel* DraggedTabController::GetModel(BaseTabStrip* tabstrip) const { | 1350 TabStripModel* DraggedTabController::GetModel(BaseTabStrip* tabstrip) const { |
| 1349 return static_cast<BrowserTabStripController*>(tabstrip->controller())-> | 1351 return static_cast<BrowserTabStripController*>(tabstrip->controller())-> |
| 1350 model(); | 1352 model(); |
| 1351 } | 1353 } |
| OLD | NEW |