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/panels/old_base_panel_browser_test.h" | 5 #include "chrome/browser/ui/panels/old_base_panel_browser_test.h" |
6 | 6 |
7 #include "chrome/browser/ui/browser_list.h" | 7 #include "chrome/browser/ui/browser_list.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 #if defined(OS_MACOSX) | 292 #if defined(OS_MACOSX) |
293 // Opening panels on a Mac causes NSWindowController of the Panel window | 293 // Opening panels on a Mac causes NSWindowController of the Panel window |
294 // to be autoreleased. We need a pool drained after it's done so the test | 294 // to be autoreleased. We need a pool drained after it's done so the test |
295 // can close correctly. The NSWindowController of the Panel window controls | 295 // can close correctly. The NSWindowController of the Panel window controls |
296 // lifetime of the Browser object so we want to release it as soon as | 296 // lifetime of the Browser object so we want to release it as soon as |
297 // possible. In real Chrome, this is done by message pump. | 297 // possible. In real Chrome, this is done by message pump. |
298 // On non-Mac platform, this is an empty class. | 298 // On non-Mac platform, this is an empty class. |
299 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 299 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
300 #endif | 300 #endif |
301 | 301 |
302 Browser* panel_browser = Browser::CreateWithParams( | 302 Browser* panel_browser = new Browser( |
303 Browser::CreateParams::CreateForApp( | 303 Browser::CreateParams::CreateForApp( |
304 Browser::TYPE_PANEL, params.name, params.bounds, | 304 Browser::TYPE_PANEL, params.name, params.bounds, |
305 browser()->profile())); | 305 browser()->profile())); |
306 EXPECT_TRUE(panel_browser->is_type_panel()); | 306 EXPECT_TRUE(panel_browser->is_type_panel()); |
307 | 307 |
308 if (!params.url.is_empty()) { | 308 if (!params.url.is_empty()) { |
309 content::WindowedNotificationObserver observer( | 309 content::WindowedNotificationObserver observer( |
310 content::NOTIFICATION_LOAD_STOP, | 310 content::NOTIFICATION_LOAD_STOP, |
311 content::NotificationService::AllSources()); | 311 content::NotificationService::AllSources()); |
312 chrome::AddSelectedTabWithURL(panel_browser, params.url, | 312 chrome::AddSelectedTabWithURL(panel_browser, params.url, |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 } | 478 } |
479 | 479 |
480 void OldBasePanelBrowserTest::MoveMouse(const gfx::Point& position) { | 480 void OldBasePanelBrowserTest::MoveMouse(const gfx::Point& position) { |
481 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); | 481 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); |
482 } | 482 } |
483 | 483 |
484 std::string OldBasePanelBrowserTest::MakePanelName(int index) { | 484 std::string OldBasePanelBrowserTest::MakePanelName(int index) { |
485 std::string panel_name("Panel"); | 485 std::string panel_name("Panel"); |
486 return panel_name + base::IntToString(index); | 486 return panel_name + base::IntToString(index); |
487 } | 487 } |
OLD | NEW |