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/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1170 dragged_widget->GetNativeView()); | 1170 dragged_widget->GetNativeView()); |
1171 #endif | 1171 #endif |
1172 dragged_widget->SetVisibilityChangedAnimationsEnabled(false); | 1172 dragged_widget->SetVisibilityChangedAnimationsEnabled(false); |
1173 Attach(dragged_browser_view->tabstrip(), gfx::Point()); | 1173 Attach(dragged_browser_view->tabstrip(), gfx::Point()); |
1174 AdjustBrowserAndTabBoundsForDrag(last_tabstrip_width, | 1174 AdjustBrowserAndTabBoundsForDrag(last_tabstrip_width, |
1175 point_in_screen, | 1175 point_in_screen, |
1176 &drag_bounds); | 1176 &drag_bounds); |
1177 WindowPositionManagedUpdater updater; | 1177 WindowPositionManagedUpdater updater; |
1178 dragged_widget->AddObserver(&updater); | 1178 dragged_widget->AddObserver(&updater); |
1179 browser->window()->Show(); | 1179 browser->window()->Show(); |
1180 // Set capture after the newly created browser widget is visible. | |
1181 attached_tabstrip_->GetWidget()->SetCapture(attached_tabstrip_); | |
varkha
2014/05/21 20:07:20
This makes sure that capture is really where we th
| |
1180 dragged_widget->RemoveObserver(&updater); | 1182 dragged_widget->RemoveObserver(&updater); |
1181 dragged_widget->SetVisibilityChangedAnimationsEnabled(true); | 1183 dragged_widget->SetVisibilityChangedAnimationsEnabled(true); |
1182 // Activate may trigger a focus loss, destroying us. | 1184 // Activate may trigger a focus loss, destroying us. |
1183 { | 1185 { |
1184 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr()); | 1186 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr()); |
1185 browser->window()->Activate(); | 1187 browser->window()->Activate(); |
1186 if (!ref) | 1188 if (!ref) |
1187 return; | 1189 return; |
1188 } | 1190 } |
1189 RunMoveLoop(drag_offset); | 1191 RunMoveLoop(drag_offset); |
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1937 it != browser_list->end(); ++it) { | 1939 it != browser_list->end(); ++it) { |
1938 if ((*it)->tab_strip_model()->empty()) | 1940 if ((*it)->tab_strip_model()->empty()) |
1939 exclude.insert((*it)->window()->GetNativeWindow()); | 1941 exclude.insert((*it)->window()->GetNativeWindow()); |
1940 } | 1942 } |
1941 #endif | 1943 #endif |
1942 return GetLocalProcessWindowAtPoint(host_desktop_type_, | 1944 return GetLocalProcessWindowAtPoint(host_desktop_type_, |
1943 screen_point, | 1945 screen_point, |
1944 exclude); | 1946 exclude); |
1945 | 1947 |
1946 } | 1948 } |
OLD | NEW |