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 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1741 const gfx::Point& point_in_screen, | 1741 const gfx::Point& point_in_screen, |
1742 gfx::Vector2d* drag_offset, | 1742 gfx::Vector2d* drag_offset, |
1743 std::vector<gfx::Rect>* drag_bounds) { | 1743 std::vector<gfx::Rect>* drag_bounds) { |
1744 gfx::Rect new_bounds(CalculateDraggedBrowserBounds(source, | 1744 gfx::Rect new_bounds(CalculateDraggedBrowserBounds(source, |
1745 point_in_screen, | 1745 point_in_screen, |
1746 drag_bounds)); | 1746 drag_bounds)); |
1747 *drag_offset = point_in_screen - new_bounds.origin(); | 1747 *drag_offset = point_in_screen - new_bounds.origin(); |
1748 | 1748 |
1749 Profile* profile = | 1749 Profile* profile = |
1750 Profile::FromBrowserContext(drag_data_[0].contents->GetBrowserContext()); | 1750 Profile::FromBrowserContext(drag_data_[0].contents->GetBrowserContext()); |
1751 Browser::CreateParams create_params(Browser::TYPE_TABBED, | 1751 Browser::CreateParams create_params(Browser::TYPE_TABBED, profile); |
1752 profile, | |
1753 host_desktop_type_); | |
1754 create_params.initial_bounds = new_bounds; | 1752 create_params.initial_bounds = new_bounds; |
1755 Browser* browser = new Browser(create_params); | 1753 Browser* browser = new Browser(create_params); |
1756 is_dragging_new_browser_ = true; | 1754 is_dragging_new_browser_ = true; |
1757 SetWindowPositionManaged(browser->window()->GetNativeWindow(), false); | 1755 SetWindowPositionManaged(browser->window()->GetNativeWindow(), false); |
1758 // If the window is created maximized then the bounds we supplied are ignored. | 1756 // If the window is created maximized then the bounds we supplied are ignored. |
1759 // We need to reset them again so they are honored. | 1757 // We need to reset them again so they are honored. |
1760 browser->window()->SetBounds(new_bounds); | 1758 browser->window()->SetBounds(new_bounds); |
1761 | 1759 |
1762 return browser; | 1760 return browser; |
1763 } | 1761 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1814 for (auto* browser : *BrowserList::GetInstance()) { | 1812 for (auto* browser : *BrowserList::GetInstance()) { |
1815 if (browser->tab_strip_model()->empty()) | 1813 if (browser->tab_strip_model()->empty()) |
1816 exclude.insert(browser->window()->GetNativeWindow()); | 1814 exclude.insert(browser->window()->GetNativeWindow()); |
1817 } | 1815 } |
1818 #endif | 1816 #endif |
1819 return GetLocalProcessWindowAtPoint(host_desktop_type_, | 1817 return GetLocalProcessWindowAtPoint(host_desktop_type_, |
1820 screen_point, | 1818 screen_point, |
1821 exclude); | 1819 exclude); |
1822 | 1820 |
1823 } | 1821 } |
OLD | NEW |