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_controller2.h" | 5 #include "chrome/browser/ui/views/tabs/tab_drag_controller2.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/property_bag.h" | 10 #include "base/property_bag.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // be side by side. | 123 // be side by side. |
124 Browser* CreateAnotherWindowBrowserAndRelayout() { | 124 Browser* CreateAnotherWindowBrowserAndRelayout() { |
125 // Add another tab. | 125 // Add another tab. |
126 AddTabAndResetBrowser(browser()); | 126 AddTabAndResetBrowser(browser()); |
127 | 127 |
128 // Create another browser. | 128 // Create another browser. |
129 Browser* browser2 = CreateBrowser(browser()->profile()); | 129 Browser* browser2 = CreateBrowser(browser()->profile()); |
130 ResetIDs(browser2->tabstrip_model(), 100); | 130 ResetIDs(browser2->tabstrip_model(), 100); |
131 | 131 |
132 // Resize the two windows so they're right next to each other. | 132 // Resize the two windows so they're right next to each other. |
133 gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestWindow( | 133 gfx::Rect work_area = gfx::Screen::GetMonitorNearestWindow( |
134 browser()->window()->GetNativeHandle()); | 134 browser()->window()->GetNativeHandle()).work_area(); |
135 gfx::Size half_size = | 135 gfx::Size half_size = |
136 gfx::Size(work_area.width() / 3 - 10, work_area.height() / 2 - 10); | 136 gfx::Size(work_area.width() / 3 - 10, work_area.height() / 2 - 10); |
137 browser()->window()->SetBounds(gfx::Rect(work_area.origin(), half_size)); | 137 browser()->window()->SetBounds(gfx::Rect(work_area.origin(), half_size)); |
138 browser2->window()->SetBounds(gfx::Rect( | 138 browser2->window()->SetBounds(gfx::Rect( |
139 work_area.x() + half_size.width(), work_area.y(), | 139 work_area.x() + half_size.width(), work_area.y(), |
140 half_size.width(), half_size.height())); | 140 half_size.width(), half_size.height())); |
141 return browser2; | 141 return browser2; |
142 } | 142 } |
143 | 143 |
144 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 144 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 596 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
597 browser2, ui::VKEY_ESCAPE, false, false, false, false)); | 597 browser2, ui::VKEY_ESCAPE, false, false, false, false)); |
598 | 598 |
599 ASSERT_FALSE(tab_strip2->IsDragSessionActive()); | 599 ASSERT_FALSE(tab_strip2->IsDragSessionActive()); |
600 ASSERT_FALSE(TabDragController::IsActive()); | 600 ASSERT_FALSE(TabDragController::IsActive()); |
601 EXPECT_EQ("100 0 1", IDString(browser2->tabstrip_model())); | 601 EXPECT_EQ("100 0 1", IDString(browser2->tabstrip_model())); |
602 | 602 |
603 // browser() will have been destroyed, but browser2 should remain. | 603 // browser() will have been destroyed, but browser2 should remain. |
604 ASSERT_EQ(1u, BrowserList::size()); | 604 ASSERT_EQ(1u, BrowserList::size()); |
605 } | 605 } |
OLD | NEW |