Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Side by Side Diff: chrome/browser/ui/panels/old_base_panel_browser_test.cc

Issue 10702029: Move tab functions off Browser into browser_tabstrip and browser_tabrestore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/string_number_conversions.h" 14 #include "base/string_number_conversions.h"
15 #include "chrome/browser/extensions/extension_service.h" 15 #include "chrome/browser/extensions/extension_service.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
18 #include "chrome/browser/ui/browser_tabstrip.h"
18 #include "chrome/browser/ui/panels/native_panel.h" 19 #include "chrome/browser/ui/panels/native_panel.h"
19 #include "chrome/browser/ui/panels/panel_browser_window.h" 20 #include "chrome/browser/ui/panels/panel_browser_window.h"
20 #include "chrome/browser/ui/panels/panel_manager.h" 21 #include "chrome/browser/ui/panels/panel_manager.h"
21 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" 22 #include "chrome/browser/ui/panels/panel_mouse_watcher.h"
22 #include "chrome/browser/ui/tab_contents/tab_contents.h" 23 #include "chrome/browser/ui/tab_contents/tab_contents.h"
23 #include "chrome/common/chrome_notification_types.h" 24 #include "chrome/common/chrome_notification_types.h"
24 #include "chrome/common/chrome_paths.h" 25 #include "chrome/common/chrome_paths.h"
25 #include "chrome/common/chrome_switches.h" 26 #include "chrome/common/chrome_switches.h"
26 #include "chrome/common/extensions/extension_manifest_constants.h" 27 #include "chrome/common/extensions/extension_manifest_constants.h"
27 #include "chrome/common/string_ordinal.h" 28 #include "chrome/common/string_ordinal.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 Browser* panel_browser = Browser::CreateWithParams( 308 Browser* panel_browser = Browser::CreateWithParams(
308 Browser::CreateParams::CreateForApp( 309 Browser::CreateParams::CreateForApp(
309 Browser::TYPE_PANEL, params.name, params.bounds, 310 Browser::TYPE_PANEL, params.name, params.bounds,
310 browser()->profile())); 311 browser()->profile()));
311 EXPECT_TRUE(panel_browser->is_type_panel()); 312 EXPECT_TRUE(panel_browser->is_type_panel());
312 313
313 if (!params.url.is_empty()) { 314 if (!params.url.is_empty()) {
314 ui_test_utils::WindowedNotificationObserver observer( 315 ui_test_utils::WindowedNotificationObserver observer(
315 content::NOTIFICATION_LOAD_STOP, 316 content::NOTIFICATION_LOAD_STOP,
316 content::NotificationService::AllSources()); 317 content::NotificationService::AllSources());
317 panel_browser->AddSelectedTabWithURL(params.url, 318 chrome::AddSelectedTabWithURL(panel_browser, params.url,
318 content::PAGE_TRANSITION_START_PAGE); 319 content::PAGE_TRANSITION_START_PAGE);
319 observer.Wait(); 320 observer.Wait();
320 } 321 }
321 322
322 PanelBrowserWindow* panel_browser_window = 323 PanelBrowserWindow* panel_browser_window =
323 static_cast<PanelBrowserWindow*>(panel_browser->window()); 324 static_cast<PanelBrowserWindow*>(panel_browser->window());
324 Panel* panel = panel_browser_window->panel(); 325 Panel* panel = panel_browser_window->panel();
325 326
326 if (!PanelManager::GetInstance()->auto_sizing_enabled() || 327 if (!PanelManager::GetInstance()->auto_sizing_enabled() ||
327 params.bounds.width() || params.bounds.height()) { 328 params.bounds.width() || params.bounds.height()) {
328 EXPECT_FALSE(panel->auto_resizable()); 329 EXPECT_FALSE(panel->auto_resizable());
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 400
400 // static 401 // static
401 NativePanelTesting* OldBasePanelBrowserTest::CreateNativePanelTesting( 402 NativePanelTesting* OldBasePanelBrowserTest::CreateNativePanelTesting(
402 Panel* panel) { 403 Panel* panel) {
403 return panel->native_panel()->CreateNativePanelTesting(); 404 return panel->native_panel()->CreateNativePanelTesting();
404 } 405 }
405 406
406 void OldBasePanelBrowserTest::CreateTestTabContents(Browser* browser) { 407 void OldBasePanelBrowserTest::CreateTestTabContents(Browser* browser) {
407 TabContents* tab_contents = new TabContents( 408 TabContents* tab_contents = new TabContents(
408 WebContentsTester::CreateTestWebContents(browser->profile(), NULL)); 409 WebContentsTester::CreateTestWebContents(browser->profile(), NULL));
409 browser->AddTab(tab_contents, content::PAGE_TRANSITION_LINK); 410 chrome::AddTab(browser, tab_contents, content::PAGE_TRANSITION_LINK);
410 } 411 }
411 412
412 scoped_refptr<Extension> OldBasePanelBrowserTest::CreateExtension( 413 scoped_refptr<Extension> OldBasePanelBrowserTest::CreateExtension(
413 const FilePath::StringType& path, 414 const FilePath::StringType& path,
414 Extension::Location location, 415 Extension::Location location,
415 const DictionaryValue& extra_value) { 416 const DictionaryValue& extra_value) {
416 #if defined(OS_WIN) 417 #if defined(OS_WIN)
417 FilePath full_path(FILE_PATH_LITERAL("c:\\")); 418 FilePath full_path(FILE_PATH_LITERAL("c:\\"));
418 #else 419 #else
419 FilePath full_path(FILE_PATH_LITERAL("/")); 420 FilePath full_path(FILE_PATH_LITERAL("/"));
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 } 480 }
480 481
481 void OldBasePanelBrowserTest::MoveMouse(const gfx::Point& position) { 482 void OldBasePanelBrowserTest::MoveMouse(const gfx::Point& position) {
482 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); 483 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position);
483 } 484 }
484 485
485 std::string OldBasePanelBrowserTest::MakePanelName(int index) { 486 std::string OldBasePanelBrowserTest::MakePanelName(int index) {
486 std::string panel_name("Panel"); 487 std::string panel_name("Panel");
487 return panel_name + base::IntToString(index); 488 return panel_name + base::IntToString(index);
488 } 489 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/base_panel_browser_test.cc ('k') | chrome/browser/ui/panels/old_panel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698