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 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1788 | 1788 |
1789 gfx::Point point = point_in_screen; | 1789 gfx::Point point = point_in_screen; |
1790 views::View::ConvertPointFromScreen(toplevel_view, &point); | 1790 views::View::ConvertPointFromScreen(toplevel_view, &point); |
1791 return point.OffsetFromOrigin(); | 1791 return point.OffsetFromOrigin(); |
1792 } | 1792 } |
1793 | 1793 |
1794 gfx::NativeWindow TabDragController::GetLocalProcessWindow( | 1794 gfx::NativeWindow TabDragController::GetLocalProcessWindow( |
1795 const gfx::Point& screen_point, | 1795 const gfx::Point& screen_point, |
1796 bool exclude_dragged_view) { | 1796 bool exclude_dragged_view) { |
1797 std::set<gfx::NativeWindow> exclude; | 1797 std::set<gfx::NativeWindow> exclude; |
1798 if (exclude_dragged_view) { | 1798 gfx::NativeWindow dragged_window = |
1799 gfx::NativeWindow dragged_window = | 1799 attached_tabstrip_->GetWidget()->GetNativeWindow(); |
1800 attached_tabstrip_->GetWidget()->GetNativeWindow(); | 1800 if (exclude_dragged_view && dragged_window) |
1801 if (dragged_window) | 1801 exclude.insert(dragged_window); |
1802 exclude.insert(dragged_window); | 1802 gfx::NativeWindow root_window = |
1803 } | 1803 dragged_window ? dragged_window->GetRootWindow() : nullptr; |
1804 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 1804 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
1805 // Exclude windows which are pending deletion via Browser::TabStripEmpty(). | 1805 // Exclude windows which are pending deletion via Browser::TabStripEmpty(). |
1806 // These windows can be returned in the Linux Aura port because the browser | 1806 // These windows can be returned in the Linux Aura port because the browser |
1807 // window which was used for dragging is not hidden once all of its tabs are | 1807 // window which was used for dragging is not hidden once all of its tabs are |
1808 // attached to another browser window in DragBrowserToNewTabStrip(). | 1808 // attached to another browser window in DragBrowserToNewTabStrip(). |
1809 // TODO(pkotwicz): Fix this properly (crbug.com/358482) | 1809 // TODO(pkotwicz): Fix this properly (crbug.com/358482) |
1810 BrowserList* browser_list = BrowserList::GetInstance( | 1810 BrowserList* browser_list = BrowserList::GetInstance( |
1811 chrome::HOST_DESKTOP_TYPE_NATIVE); | 1811 chrome::HOST_DESKTOP_TYPE_NATIVE); |
1812 for (BrowserList::const_iterator it = browser_list->begin(); | 1812 for (BrowserList::const_iterator it = browser_list->begin(); |
1813 it != browser_list->end(); ++it) { | 1813 it != browser_list->end(); ++it) { |
1814 if ((*it)->tab_strip_model()->empty()) | 1814 if ((*it)->tab_strip_model()->empty()) |
1815 exclude.insert((*it)->window()->GetNativeWindow()); | 1815 exclude.insert((*it)->window()->GetNativeWindow()); |
1816 } | 1816 } |
1817 #endif | 1817 #endif |
1818 return GetLocalProcessWindowAtPoint(host_desktop_type_, | 1818 return GetLocalProcessWindowAtPoint(host_desktop_type_, screen_point, exclude, |
mfomitchev
2015/11/04 18:20:36
nit: code style: each param on separate line (or a
bshe
2015/11/04 22:20:20
Actually, "git cl format" formatted it for me...
I
mfomitchev
2015/11/04 23:26:09
Ok, sgtm
| |
1819 screen_point, | 1819 root_window); |
1820 exclude); | |
1821 | |
1822 } | 1820 } |
OLD | NEW |