Chromium Code Reviews| 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 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1106 drag_offset, move_loop_source, escape_behavior); | 1106 drag_offset, move_loop_source, escape_behavior); | 
| 1107 content::NotificationService::current()->Notify( | 1107 content::NotificationService::current()->Notify( | 
| 1108 chrome::NOTIFICATION_TAB_DRAG_LOOP_DONE, | 1108 chrome::NOTIFICATION_TAB_DRAG_LOOP_DONE, | 
| 1109 content::NotificationService::AllBrowserContextsAndSources(), | 1109 content::NotificationService::AllBrowserContextsAndSources(), | 
| 1110 content::NotificationService::NoDetails()); | 1110 content::NotificationService::NoDetails()); | 
| 1111 | 1111 | 
| 1112 if (!ref) | 1112 if (!ref) | 
| 1113 return; | 1113 return; | 
| 1114 if (move_loop_widget_) { | 1114 if (move_loop_widget_) { | 
| 1115 move_loop_widget_->RemoveObserver(this); | 1115 move_loop_widget_->RemoveObserver(this); | 
| 1116 if (result != views::Widget::MOVE_LOOP_CANCELED) | |
| 1117 SetWindowPositionManaged(move_loop_widget_->GetNativeWindow(), true); | |
| 
 
sky
2016/11/19 14:55:03
Can you clarify why tab dragging code needs to exp
 
afakhry
2016/11/22 18:15:05
I was hoping that you would answer this question a
 
 | |
| 1116 move_loop_widget_ = NULL; | 1118 move_loop_widget_ = NULL; | 
| 1117 } | 1119 } | 
| 1118 is_dragging_window_ = false; | 1120 is_dragging_window_ = false; | 
| 1119 waiting_for_run_loop_to_exit_ = false; | 1121 waiting_for_run_loop_to_exit_ = false; | 
| 1120 if (end_run_loop_behavior_ == END_RUN_LOOP_CONTINUE_DRAGGING) { | 1122 if (end_run_loop_behavior_ == END_RUN_LOOP_CONTINUE_DRAGGING) { | 
| 1121 end_run_loop_behavior_ = END_RUN_LOOP_STOP_DRAGGING; | 1123 end_run_loop_behavior_ = END_RUN_LOOP_STOP_DRAGGING; | 
| 1122 if (tab_strip_to_attach_to_after_exit_) { | 1124 if (tab_strip_to_attach_to_after_exit_) { | 
| 1123 gfx::Point point_in_screen(GetCursorScreenPoint()); | 1125 gfx::Point point_in_screen(GetCursorScreenPoint()); | 
| 1124 Detach(DONT_RELEASE_CAPTURE); | 1126 Detach(DONT_RELEASE_CAPTURE); | 
| 1125 Attach(tab_strip_to_attach_to_after_exit_, point_in_screen); | 1127 Attach(tab_strip_to_attach_to_after_exit_, point_in_screen); | 
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1827 // TODO(pkotwicz): Fix this properly (crbug.com/358482) | 1829 // TODO(pkotwicz): Fix this properly (crbug.com/358482) | 
| 1828 for (auto* browser : *BrowserList::GetInstance()) { | 1830 for (auto* browser : *BrowserList::GetInstance()) { | 
| 1829 if (browser->tab_strip_model()->empty()) | 1831 if (browser->tab_strip_model()->empty()) | 
| 1830 exclude.insert(browser->window()->GetNativeWindow()); | 1832 exclude.insert(browser->window()->GetNativeWindow()); | 
| 1831 } | 1833 } | 
| 1832 #endif | 1834 #endif | 
| 1833 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr()); | 1835 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr()); | 
| 1834 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude); | 1836 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude); | 
| 1835 return ref ? Liveness::ALIVE : Liveness::DELETED; | 1837 return ref ? Liveness::ALIVE : Liveness::DELETED; | 
| 1836 } | 1838 } | 
| OLD | NEW |