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 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 #endif | 660 #endif |
661 if (target_tabstrip != attached_tabstrip_) { | 661 if (target_tabstrip != attached_tabstrip_) { |
662 // Make sure we're fully detached from whatever TabStrip we're attached to | 662 // Make sure we're fully detached from whatever TabStrip we're attached to |
663 // (if any). | 663 // (if any). |
664 if (attached_tabstrip_) | 664 if (attached_tabstrip_) |
665 Detach(); | 665 Detach(); |
666 if (target_tabstrip) | 666 if (target_tabstrip) |
667 Attach(target_tabstrip, screen_point); | 667 Attach(target_tabstrip, screen_point); |
668 } | 668 } |
669 if (!target_tabstrip) { | 669 if (!target_tabstrip) { |
670 bring_to_front_timer_.Start(FROM_HERE, | 670 bring_to_front_timer_.Start( |
671 base::TimeDelta::FromMilliseconds(kBringToFrontDelay), this, | 671 base::TimeDelta::FromMilliseconds(kBringToFrontDelay), this, |
672 &DraggedTabController::BringWindowUnderMouseToFront); | 672 &DraggedTabController::BringWindowUnderMouseToFront); |
673 } | 673 } |
674 | 674 |
675 UpdateDockInfo(screen_point); | 675 UpdateDockInfo(screen_point); |
676 | 676 |
677 if (attached_tabstrip_) | 677 if (attached_tabstrip_) |
678 MoveAttached(screen_point); | 678 MoveAttached(screen_point); |
679 else | 679 else |
680 MoveDetached(screen_point); | 680 MoveDetached(screen_point); |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1430 | 1430 |
1431 bool DraggedTabController::AreTabsConsecutive() { | 1431 bool DraggedTabController::AreTabsConsecutive() { |
1432 for (size_t i = 1; i < drag_data_.size(); ++i) { | 1432 for (size_t i = 1; i < drag_data_.size(); ++i) { |
1433 if (drag_data_[i - 1].source_model_index + 1 != | 1433 if (drag_data_[i - 1].source_model_index + 1 != |
1434 drag_data_[i].source_model_index) { | 1434 drag_data_[i].source_model_index) { |
1435 return false; | 1435 return false; |
1436 } | 1436 } |
1437 } | 1437 } |
1438 return true; | 1438 return true; |
1439 } | 1439 } |
OLD | NEW |