OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/browser_window.h" | 10 #include "chrome/browser/browser_window.h" |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 index = std::max(std::min(index, attached_tabstrip_->model()->count()), 0); | 716 index = std::max(std::min(index, attached_tabstrip_->model()->count()), 0); |
717 attached_tabstrip_->model()->InsertTabContentsAt(index, dragged_contents_, | 717 attached_tabstrip_->model()->InsertTabContentsAt(index, dragged_contents_, |
718 true, false); | 718 true, false); |
719 | 719 |
720 tab = GetTabMatchingDraggedContents(attached_tabstrip_); | 720 tab = GetTabMatchingDraggedContents(attached_tabstrip_); |
721 } | 721 } |
722 DCHECK(tab); // We should now have a tab. | 722 DCHECK(tab); // We should now have a tab. |
723 tab->SetVisible(false); | 723 tab->SetVisible(false); |
724 | 724 |
725 // Move the corresponding window to the front. | 725 // Move the corresponding window to the front. |
726 attached_tabstrip_->GetWidget()->MoveToFront(true); | 726 attached_tabstrip_->GetWidget()->GetWindow()->Activate(); |
727 } | 727 } |
728 | 728 |
729 void DraggedTabController::Detach() { | 729 void DraggedTabController::Detach() { |
730 // Prevent the TabContents' HWND from being hidden by any of the model | 730 // Prevent the TabContents' HWND from being hidden by any of the model |
731 // operations performed during the drag. | 731 // operations performed during the drag. |
732 dragged_contents_->set_capturing_contents(true); | 732 dragged_contents_->set_capturing_contents(true); |
733 | 733 |
734 // Update the Model. | 734 // Update the Model. |
735 TabStripModel* attached_model = attached_tabstrip_->model(); | 735 TabStripModel* attached_model = attached_tabstrip_->model(); |
736 int index = attached_model->GetIndexOfTabContents(dragged_contents_); | 736 int index = attached_model->GetIndexOfTabContents(dragged_contents_); |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 // Move the window to the front. | 1143 // Move the window to the front. |
1144 SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, | 1144 SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, |
1145 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); | 1145 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); |
1146 | 1146 |
1147 // The previous call made the window appear on top of the dragged window, | 1147 // The previous call made the window appear on top of the dragged window, |
1148 // move the dragged window to the front. | 1148 // move the dragged window to the front. |
1149 SetWindowPos(view_->GetWidget()->GetNativeView(), HWND_TOP, 0, 0, 0, 0, | 1149 SetWindowPos(view_->GetWidget()->GetNativeView(), HWND_TOP, 0, 0, 0, 0, |
1150 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); | 1150 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); |
1151 } | 1151 } |
1152 } | 1152 } |
OLD | NEW |