diff options
-rw-r--r-- | chrome/browser/app_controller_mac.mm | 4 | ||||
-rw-r--r-- | chrome/browser/automation/testing_automation_provider.cc | 2 | ||||
-rw-r--r-- | chrome/browser/chrome_main_browsertest.cc | 14 | ||||
-rw-r--r-- | chrome/browser/extensions/api/management/management_apitest.cc | 16 | ||||
-rw-r--r-- | chrome/browser/extensions/app_process_apitest.cc | 6 | ||||
-rw-r--r-- | chrome/browser/extensions/window_open_apitest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/popup_blocker_browsertest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/browser.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/browser_browsertest.cc | 18 | ||||
-rw-r--r-- | chrome/browser/ui/browser_finder.cc | 10 | ||||
-rw-r--r-- | chrome/browser/ui/browser_finder.h | 7 | ||||
-rw-r--r-- | chrome/browser/ui/panels/panel_browsertest.cc | 8 | ||||
-rw-r--r-- | chrome/browser/ui/startup/startup_browser_creator_browsertest.cc | 28 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/app_non_client_frame_view_ash_browsertest.cc | 7 |
14 files changed, 68 insertions, 62 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 5f6e922..c89bb11 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -349,8 +349,8 @@ void RecordLastRunAppBundlePath() { } - (void)didEndMainMessageLoop { - DCHECK_EQ(0u, browser::GetBrowserCount([self lastProfile])); - if (!browser::GetBrowserCount([self lastProfile])) { + DCHECK_EQ(0u, chrome::GetBrowserCount([self lastProfile])); + if (!chrome::GetBrowserCount([self lastProfile])) { // As we're shutting down, we need to nuke the TabRestoreService, which // will start the shutdown of the NavigationControllers and allow for // proper shutdown. If we don't do this, Chrome won't shut down cleanly, diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 0999612..fe66604 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -618,7 +618,7 @@ void TestingAutomationProvider::GetBrowserWindowCount(int* window_count) { } void TestingAutomationProvider::GetNormalBrowserWindowCount(int* window_count) { - *window_count = static_cast<int>(browser::GetTabbedBrowserCount(profile_)); + *window_count = static_cast<int>(chrome::GetTabbedBrowserCount(profile_)); } void TestingAutomationProvider::GetBrowserWindow(int index, int* handle) { diff --git a/chrome/browser/chrome_main_browsertest.cc b/chrome/browser/chrome_main_browsertest.cc index 50e45a6..0236d409 100644 --- a/chrome/browser/chrome_main_browsertest.cc +++ b/chrome/browser/chrome_main_browsertest.cc @@ -42,7 +42,7 @@ IN_PROC_BROWSER_TEST_F(ChromeMainTest, SecondLaunch) { ui_test_utils::BrowserAddedObserver observer; Relaunch(GetCommandLineForRelaunch()); observer.WaitForSingleNewBrowser(); - ASSERT_EQ(2u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile())); } IN_PROC_BROWSER_TEST_F(ChromeMainTest, ReuseBrowserInstanceWhenOpeningFile) { @@ -71,7 +71,7 @@ IN_PROC_BROWSER_TEST_F(ChromeMainTest, ReuseBrowserInstanceWhenOpeningFile) { IN_PROC_BROWSER_TEST_F(ChromeMainTest, MAYBE_SecondLaunchWithIncognitoUrl) { // We should start with one normal window. - ASSERT_EQ(1u, browser::GetTabbedBrowserCount(browser()->profile())); + ASSERT_EQ(1u, chrome::GetTabbedBrowserCount(browser()->profile())); // Run with --incognito switch and an URL specified. FilePath test_file_path = ui_test_utils::GetTestFilePath( @@ -88,18 +88,18 @@ IN_PROC_BROWSER_TEST_F(ChromeMainTest, MAYBE_SecondLaunchWithIncognitoUrl) { observer.WaitForSingleNewBrowser(); ASSERT_EQ(2u, BrowserList::size()); - ASSERT_EQ(1u, browser::GetTabbedBrowserCount(browser()->profile())); + ASSERT_EQ(1u, chrome::GetTabbedBrowserCount(browser()->profile())); } IN_PROC_BROWSER_TEST_F(ChromeMainTest, SecondLaunchFromIncognitoWithNormalUrl) { // We should start with one normal window. - ASSERT_EQ(1u, browser::GetTabbedBrowserCount(browser()->profile())); + ASSERT_EQ(1u, chrome::GetTabbedBrowserCount(browser()->profile())); // Create an incognito window. chrome::NewIncognitoWindow(browser()); ASSERT_EQ(2u, BrowserList::size()); - ASSERT_EQ(1u, browser::GetTabbedBrowserCount(browser()->profile())); + ASSERT_EQ(1u, chrome::GetTabbedBrowserCount(browser()->profile())); // Close the first window. Profile* profile = browser()->profile(); @@ -111,7 +111,7 @@ IN_PROC_BROWSER_TEST_F(ChromeMainTest, SecondLaunchFromIncognitoWithNormalUrl) { // There should only be the incognito window open now. ASSERT_EQ(1u, BrowserList::size()); - ASSERT_EQ(0u, browser::GetTabbedBrowserCount(profile)); + ASSERT_EQ(0u, chrome::GetTabbedBrowserCount(profile)); // Run with just an URL specified, no --incognito switch. FilePath test_file_path = ui_test_utils::GetTestFilePath( @@ -126,7 +126,7 @@ IN_PROC_BROWSER_TEST_F(ChromeMainTest, SecondLaunchFromIncognitoWithNormalUrl) { // There should be one normal and one incognito window now. ASSERT_EQ(2u, BrowserList::size()); - ASSERT_EQ(1u, browser::GetTabbedBrowserCount(profile)); + ASSERT_EQ(1u, chrome::GetTabbedBrowserCount(profile)); } #endif // !OS_MACOSX diff --git a/chrome/browser/extensions/api/management/management_apitest.cc b/chrome/browser/extensions/api/management/management_apitest.cc index bd2f871..aad5b18 100644 --- a/chrome/browser/extensions/api/management/management_apitest.cc +++ b/chrome/browser/extensions/api/management/management_apitest.cc @@ -166,7 +166,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, LaunchPanelApp) { ASSERT_FALSE(HasFatalFailure()); // Stop the test if any ASSERT failed. // Find the app's browser. Check that it is a popup. - ASSERT_EQ(2u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile())); Browser* app_browser = FindOtherBrowser(browser()); ASSERT_TRUE(app_browser->is_type_popup()); ASSERT_TRUE(app_browser->is_app()); @@ -181,7 +181,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, LaunchPanelApp) { // Unload the extension. UninstallExtension(app_id); - ASSERT_EQ(1u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); ASSERT_FALSE(service->GetExtensionById(app_id, true)); // Set a pref indicating that the user wants to launch in a regular tab. @@ -199,7 +199,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, LaunchPanelApp) { // Find the app's browser. Apps that should load in a panel ignore // prefs, so we should still see the launch in a popup. - ASSERT_EQ(2u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile())); app_browser = FindOtherBrowser(browser()); ASSERT_TRUE(app_browser->is_type_popup()); ASSERT_TRUE(app_browser->is_app()); @@ -217,7 +217,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, LaunchTabApp) { // Code below assumes that the test starts with a single browser window // hosting one tab. - ASSERT_EQ(1u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); ASSERT_EQ(1, browser()->tab_count()); // Load an app with app.launch.container = "tab". @@ -226,12 +226,12 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, LaunchTabApp) { ASSERT_FALSE(HasFatalFailure()); // Check that the app opened in a new tab of the existing browser. - ASSERT_EQ(1u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); ASSERT_EQ(2, browser()->tab_count()); // Unload the extension. UninstallExtension(app_id); - ASSERT_EQ(1u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); ASSERT_FALSE(service->GetExtensionById(app_id, true)); // Set a pref indicating that the user wants to launch in a window. @@ -248,12 +248,12 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, LaunchTabApp) { #if defined(OS_MACOSX) // App windows are not yet implemented on mac os. We should fall back // to a normal tab. - ASSERT_EQ(1u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); ASSERT_EQ(2, browser()->tab_count()); #else // Find the app's browser. Opening in a new window will create // a new browser. - ASSERT_EQ(2u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile())); Browser* app_browser = FindOtherBrowser(browser()); ASSERT_TRUE(app_browser->is_app()); ASSERT_FALSE(app_browser->is_type_panel()); diff --git a/chrome/browser/extensions/app_process_apitest.cc b/chrome/browser/extensions/app_process_apitest.cc index b36191c..0496fda 100644 --- a/chrome/browser/extensions/app_process_apitest.cc +++ b/chrome/browser/extensions/app_process_apitest.cc @@ -111,7 +111,7 @@ class AppApiTest : public ExtensionApiTest { // Opening tabs with window.open should keep the page in the opener's // process. - ASSERT_EQ(1u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); OpenWindow(tab1, base_url.Resolve("path1/empty.html"), true, NULL); LOG(INFO) << "WindowOpenHelper 1."; OpenWindow(tab2, base_url.Resolve("path2/empty.html"), true, NULL); @@ -191,7 +191,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, AppProcess) { chrome::GetWebContentsAt(browser(), 3)->GetRenderProcessHost()); // Now let's do the same using window.open. The same should happen. - ASSERT_EQ(1u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); OpenWindow(tab, base_url.Resolve("path1/empty.html"), true, NULL); LOG(INFO) << "WindowOpenHelper 1."; OpenWindow(tab, base_url.Resolve("path2/empty.html"), true, NULL); @@ -298,7 +298,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, BookmarkAppGetsNormalProcess) { chrome::GetWebContentsAt(browser(), 2)->GetRenderProcessHost()); // Now let's do the same using window.open. The same should happen. - ASSERT_EQ(1u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); OpenWindow(tab, base_url.Resolve("path1/empty.html"), true, NULL); OpenWindow(tab, base_url.Resolve("path2/empty.html"), true, NULL); diff --git a/chrome/browser/extensions/window_open_apitest.cc b/chrome/browser/extensions/window_open_apitest.cc index 3fcc4b67..a00ee77 100644 --- a/chrome/browser/extensions/window_open_apitest.cc +++ b/chrome/browser/extensions/window_open_apitest.cc @@ -54,7 +54,7 @@ void WaitForTabsAndPopups(Browser* browser, const base::TimeDelta kWaitTime = base::TimeDelta::FromSeconds(15); base::TimeTicks end_time = base::TimeTicks::Now() + kWaitTime; while (base::TimeTicks::Now() < end_time) { - if (browser::GetBrowserCount(browser->profile()) == num_browsers && + if (chrome::GetBrowserCount(browser->profile()) == num_browsers && browser->tab_count() == num_tabs && PanelManager::GetInstance()->num_panels() == num_panels) break; @@ -62,7 +62,7 @@ void WaitForTabsAndPopups(Browser* browser, content::RunAllPendingInMessageLoop(); } - EXPECT_EQ(num_browsers, browser::GetBrowserCount(browser->profile())); + EXPECT_EQ(num_browsers, chrome::GetBrowserCount(browser->profile())); EXPECT_EQ(num_tabs, browser->tab_count()); EXPECT_EQ(num_panels, PanelManager::GetInstance()->num_panels()); diff --git a/chrome/browser/popup_blocker_browsertest.cc b/chrome/browser/popup_blocker_browsertest.cc index dd8a5c4..231f4ff 100644 --- a/chrome/browser/popup_blocker_browsertest.cc +++ b/chrome/browser/popup_blocker_browsertest.cc @@ -68,7 +68,7 @@ class PopupBlockerBrowserTest : public InProcessBrowserTest { ui_test_utils::NavigateToURL(browser, url); observer.Wait(); - ASSERT_EQ(2u, browser::GetBrowserCount(browser->profile())); + ASSERT_EQ(2u, chrome::GetBrowserCount(browser->profile())); std::vector<WebContents*> blocked_contents = GetBlockedContents(browser); ASSERT_TRUE(blocked_contents.empty()); @@ -81,7 +81,7 @@ class PopupBlockerBrowserTest : public InProcessBrowserTest { // If the popup blocker blocked the blank post, there should be only one // tab in only one browser window and the URL of current tab must be equal // to the original URL. - EXPECT_EQ(1u, browser::GetBrowserCount(browser->profile())); + EXPECT_EQ(1u, chrome::GetBrowserCount(browser->profile())); EXPECT_EQ(1, browser->tab_count()); WebContents* web_contents = chrome::GetActiveWebContents(browser); EXPECT_EQ(url, web_contents->GetURL()); diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 8a90607..d8051d3 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -480,7 +480,7 @@ Browser::~Browser() { tab_restore_service->BrowserClosed(tab_restore_service_delegate()); #if !defined(OS_MACOSX) - if (!browser::GetBrowserCount(profile_)) { + if (!chrome::GetBrowserCount(profile_)) { // We're the last browser window with this profile. We need to nuke the // TabRestoreService, which will start the shutdown of the // NavigationControllers and allow for proper shutdown. If we don't do this diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc index e7c89ff..ed283e1 100644 --- a/chrome/browser/ui/browser_browsertest.cc +++ b/chrome/browser/ui/browser_browsertest.cc @@ -783,7 +783,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, DISABLED_ConvertTabToAppShortcut) { WebContents* app_tab = chrome::AddSelectedTabWithURL( browser(), http_url, content::PAGE_TRANSITION_TYPED)->web_contents(); ASSERT_EQ(2, browser()->tab_count()); - ASSERT_EQ(1u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); // Normal tabs should accept load drops. EXPECT_TRUE(initial_tab->GetMutableRendererPrefs()->can_accept_load_drops); @@ -793,7 +793,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, DISABLED_ConvertTabToAppShortcut) { chrome::ConvertTabToAppWindow(browser(), app_tab); // The launch should have created a new browser. - ASSERT_EQ(2u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile())); // Find the new browser. Browser* app_browser = NULL; @@ -921,7 +921,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, AppIdSwitch) { // Check that the new browser has an app name. // The launch should have created a new browser. - ASSERT_EQ(2u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile())); // Find the new browser. Browser* new_browser = NULL; @@ -1027,7 +1027,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, RestorePinnedTabs) { launch.ProcessStartupURLs(std::vector<GURL>()); // The launch should have created a new browser. - ASSERT_EQ(2u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile())); // Find the new browser. Browser* new_browser = NULL; @@ -1098,7 +1098,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, OpenAppWindowLikeNtp) { EXPECT_EQ(extension_app->GetFullLaunchURL(), app_window->GetURL()); // The launch should have created a new browser. - ASSERT_EQ(2u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile())); // Find the new browser. Browser* new_browser = NULL; @@ -1746,7 +1746,7 @@ class ClickModifierTest : public InProcessBrowserTest { WebKit::WebMouseEvent::Button button, WindowOpenDisposition disposition) { ui_test_utils::NavigateToURL(browser, url); - EXPECT_EQ(1u, browser::GetBrowserCount(browser->profile())); + EXPECT_EQ(1u, chrome::GetBrowserCount(browser->profile())); EXPECT_EQ(1, browser->tab_count()); content::WebContents* web_contents = chrome::GetActiveWebContents(browser); EXPECT_EQ(url, web_contents->GetURL()); @@ -1764,7 +1764,7 @@ class ClickModifierTest : public InProcessBrowserTest { same_tab_observer.WaitForObservation( base::Bind(&content::RunThisRunLoop, base::Unretained(&run_loop)), content::GetQuitTaskForRunLoop(&run_loop)); - EXPECT_EQ(1u, browser::GetBrowserCount(browser->profile())); + EXPECT_EQ(1u, chrome::GetBrowserCount(browser->profile())); EXPECT_EQ(1, browser->tab_count()); EXPECT_EQ(getSecondPageTitle(), web_contents->GetTitle()); return; @@ -1777,11 +1777,11 @@ class ClickModifierTest : public InProcessBrowserTest { observer.Wait(); if (disposition == NEW_WINDOW) { - EXPECT_EQ(2u, browser::GetBrowserCount(browser->profile())); + EXPECT_EQ(2u, chrome::GetBrowserCount(browser->profile())); return; } - EXPECT_EQ(1u, browser::GetBrowserCount(browser->profile())); + EXPECT_EQ(1u, chrome::GetBrowserCount(browser->profile())); EXPECT_EQ(2, browser->tab_count()); web_contents = chrome::GetActiveWebContents(browser); WaitForLoadStop(web_contents); diff --git a/chrome/browser/ui/browser_finder.cc b/chrome/browser/ui/browser_finder.cc index 3e650a6..88021af 100644 --- a/chrome/browser/ui/browser_finder.cc +++ b/chrome/browser/ui/browser_finder.cc @@ -15,8 +15,6 @@ using content::WebContents; -namespace browser { - namespace { // TODO(mad) eventually move this to host_desktop_type.h. @@ -127,6 +125,8 @@ size_t GetBrowserCountImpl(Profile* profile, } // namespace +namespace browser { + Browser* FindTabbedBrowser(Profile* profile, bool match_original_profiles) { return FindTabbedBrowser(profile, match_original_profiles, @@ -210,6 +210,10 @@ Browser* FindLastActiveWithHostDesktopType(chrome::HostDesktopType type) { return NULL; } +} // namespace browser + +namespace chrome { + size_t GetBrowserCount(Profile* profile) { return GetBrowserCountImpl(profile, kDefaultHostDesktopType, kMatchAny); } @@ -218,4 +222,4 @@ size_t GetTabbedBrowserCount(Profile* profile) { return GetBrowserCountImpl(profile, kDefaultHostDesktopType, kMatchTabbed); } -} // namespace browser +} // namespace chrome diff --git a/chrome/browser/ui/browser_finder.h b/chrome/browser/ui/browser_finder.h index 87718c1..acffca0 100644 --- a/chrome/browser/ui/browser_finder.h +++ b/chrome/browser/ui/browser_finder.h @@ -11,7 +11,6 @@ class Profile; namespace contents { -class NavigationController; class WebContents; } @@ -76,12 +75,16 @@ Browser* FindLastActiveWithProfile(Profile* profile); // BrowserList::GetLastActive(). Browser* FindLastActiveWithHostDesktopType(chrome::HostDesktopType type); +} // namespace browser + +namespace chrome { + // Returns the number of browsers with the Profile |profile|. size_t GetBrowserCount(Profile* profile); // Returns the number of tabbed browsers with the Profile |profile|. size_t GetTabbedBrowserCount(Profile* profile); -} // namespace browser +} // namespace chrome #endif // CHROME_BROWSER_UI_BROWSER_FINDER_H_ diff --git a/chrome/browser/ui/panels/panel_browsertest.cc b/chrome/browser/ui/panels/panel_browsertest.cc index 1f397be..bc8fd20 100644 --- a/chrome/browser/ui/panels/panel_browsertest.cc +++ b/chrome/browser/ui/panels/panel_browsertest.cc @@ -1599,7 +1599,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, DevTools) { // Open devtools. size_t num_browsers = 1; - EXPECT_EQ(num_browsers, browser::GetBrowserCount(browser()->profile())); + EXPECT_EQ(num_browsers, chrome::GetBrowserCount(browser()->profile())); content::WindowedNotificationObserver signal( chrome::NOTIFICATION_BROWSER_WINDOW_READY, content::NotificationService::AllSources()); @@ -1608,7 +1608,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, DevTools) { // Check that the new browser window that opened is dev tools window. ++num_browsers; - EXPECT_EQ(num_browsers, browser::GetBrowserCount(browser()->profile())); + EXPECT_EQ(num_browsers, chrome::GetBrowserCount(browser()->profile())); for (BrowserList::const_iterator iter = BrowserList::begin(); iter != BrowserList::end(); ++iter) { if (*iter == browser()) @@ -1630,7 +1630,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, DevToolsConsole) { // Open devtools console. size_t num_browsers = 1; - EXPECT_EQ(num_browsers, browser::GetBrowserCount(browser()->profile())); + EXPECT_EQ(num_browsers, chrome::GetBrowserCount(browser()->profile())); content::WindowedNotificationObserver signal( chrome::NOTIFICATION_BROWSER_WINDOW_READY, content::NotificationService::AllSources()); @@ -1639,7 +1639,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, DevToolsConsole) { // Check that the new browser window that opened is dev tools window. ++num_browsers; - EXPECT_EQ(num_browsers, browser::GetBrowserCount(browser()->profile())); + EXPECT_EQ(num_browsers, chrome::GetBrowserCount(browser()->profile())); for (BrowserList::const_iterator iter = BrowserList::begin(); iter != BrowserList::end(); ++iter) { if (*iter == browser()) diff --git a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc index 86be442..6c51fbf 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc @@ -70,7 +70,7 @@ class StartupBrowserCreatorTest : public ExtensionBrowserTest { ASSERT_TRUE(*out_app_extension); // Code that opens a new browser assumes we start with exactly one. - ASSERT_EQ(1u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); } void SetAppLaunchPref(const std::string& app_id, @@ -82,7 +82,7 @@ class StartupBrowserCreatorTest : public ExtensionBrowserTest { // Check that there are two browsers. Find the one that is not |browser()|. void FindOneOtherBrowser(Browser** out_other_browser) { // There should only be one other browser. - ASSERT_EQ(2u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile())); // Find the new browser. Browser* other_browser = NULL; @@ -310,7 +310,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenAppShortcutTabPref) { // When an app shortcut is open and the pref indicates a tab should // open, the tab is open in a new browser window. Expect a new window. - ASSERT_EQ(2u, browser::GetBrowserCount(browser()->profile())); + ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile())); Browser* new_browser = NULL; ASSERT_NO_FATAL_FAILURE(FindOneOtherBrowser(&new_browser)); @@ -402,13 +402,13 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, StartupURLsForTwoProfiles) { Browser* new_browser = NULL; // |browser()| is still around at this point, even though we've closed its // window. Thus the browser count for default_profile is 2. - ASSERT_EQ(2u, browser::GetBrowserCount(default_profile)); + ASSERT_EQ(2u, chrome::GetBrowserCount(default_profile)); new_browser = FindOneOtherBrowserForProfile(default_profile, browser()); ASSERT_TRUE(new_browser); ASSERT_EQ(1, new_browser->tab_count()); EXPECT_EQ(urls1[0], chrome::GetWebContentsAt(new_browser, 0)->GetURL()); - ASSERT_EQ(1u, browser::GetBrowserCount(other_profile)); + ASSERT_EQ(1u, chrome::GetBrowserCount(other_profile)); new_browser = FindOneOtherBrowserForProfile(other_profile, NULL); ASSERT_TRUE(new_browser); ASSERT_EQ(1, new_browser->tab_count()); @@ -472,14 +472,14 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, UpdateWithTwoProfiles) { EXPECT_TRUE(profile2->restored_last_session()); Browser* new_browser = NULL; - ASSERT_EQ(1u, browser::GetBrowserCount(profile1)); + ASSERT_EQ(1u, chrome::GetBrowserCount(profile1)); new_browser = FindOneOtherBrowserForProfile(profile1, NULL); ASSERT_TRUE(new_browser); ASSERT_EQ(1, new_browser->tab_count()); EXPECT_EQ(GURL(chrome::kAboutBlankURL), chrome::GetWebContentsAt(new_browser, 0)->GetURL()); - ASSERT_EQ(1u, browser::GetBrowserCount(profile2)); + ASSERT_EQ(1u, chrome::GetBrowserCount(profile2)); new_browser = FindOneOtherBrowserForProfile(profile2, NULL); ASSERT_TRUE(new_browser); ASSERT_EQ(1, new_browser->tab_count()); @@ -557,7 +557,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, Browser* new_browser = NULL; // The last open profile (the profile_home1 in this case) will always be // launched, even if it will open just the home page. - ASSERT_EQ(1u, browser::GetBrowserCount(profile_home1)); + ASSERT_EQ(1u, chrome::GetBrowserCount(profile_home1)); new_browser = FindOneOtherBrowserForProfile(profile_home1, NULL); ASSERT_TRUE(new_browser); ASSERT_EQ(1, new_browser->tab_count()); @@ -565,14 +565,14 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, chrome::GetWebContentsAt(new_browser, 0)->GetURL()); // profile_urls opened the urls. - ASSERT_EQ(1u, browser::GetBrowserCount(profile_urls)); + ASSERT_EQ(1u, chrome::GetBrowserCount(profile_urls)); new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); ASSERT_TRUE(new_browser); ASSERT_EQ(1, new_browser->tab_count()); EXPECT_EQ(urls[0], chrome::GetWebContentsAt(new_browser, 0)->GetURL()); // profile_last opened the last open pages. - ASSERT_EQ(1u, browser::GetBrowserCount(profile_last)); + ASSERT_EQ(1u, chrome::GetBrowserCount(profile_last)); new_browser = FindOneOtherBrowserForProfile(profile_last, NULL); ASSERT_TRUE(new_browser); ASSERT_EQ(1, new_browser->tab_count()); @@ -580,7 +580,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, chrome::GetWebContentsAt(new_browser, 0)->GetURL()); // profile_home2 was not launched since it would've only opened the home page. - ASSERT_EQ(0u, browser::GetBrowserCount(profile_home2)); + ASSERT_EQ(0u, chrome::GetBrowserCount(profile_home2)); } IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ProfilesLaunchedAfterCrash) { @@ -647,7 +647,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ProfilesLaunchedAfterCrash) { // The profile which normally opens the home page displays the new tab page. Browser* new_browser = NULL; - ASSERT_EQ(1u, browser::GetBrowserCount(profile_home)); + ASSERT_EQ(1u, chrome::GetBrowserCount(profile_home)); new_browser = FindOneOtherBrowserForProfile(profile_home, NULL); ASSERT_TRUE(new_browser); ASSERT_EQ(1, new_browser->tab_count()); @@ -658,7 +658,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ProfilesLaunchedAfterCrash) { GetInfoBarCount()); // The profile which normally opens last open pages displays the new tab page. - ASSERT_EQ(1u, browser::GetBrowserCount(profile_last)); + ASSERT_EQ(1u, chrome::GetBrowserCount(profile_last)); new_browser = FindOneOtherBrowserForProfile(profile_last, NULL); ASSERT_TRUE(new_browser); ASSERT_EQ(1, new_browser->tab_count()); @@ -669,7 +669,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ProfilesLaunchedAfterCrash) { GetInfoBarCount()); // The profile which normally opens URLs displays the new tab page. - ASSERT_EQ(1u, browser::GetBrowserCount(profile_urls)); + ASSERT_EQ(1u, chrome::GetBrowserCount(profile_urls)); new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); ASSERT_TRUE(new_browser); ASSERT_EQ(1, new_browser->tab_count()); diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash_browsertest.cc b/chrome/browser/ui/views/frame/app_non_client_frame_view_ash_browsertest.cc index b93e364..8ca8535 100644 --- a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash_browsertest.cc +++ b/chrome/browser/ui/views/frame/app_non_client_frame_view_ash_browsertest.cc @@ -146,8 +146,7 @@ IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, ClickClose) { content::Source<Browser>(app_browser())); eg.ClickLeftButton(); signal.Wait(); - EXPECT_EQ(1, - static_cast<int>(browser::GetBrowserCount(browser()->profile()))); + EXPECT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); } // Ensure that closing a maximized app with Ctrl-W does not crash the @@ -157,7 +156,7 @@ IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, KeyboardClose) { aura::test::EventGenerator eg(root_window); // Base browser and app browser. - EXPECT_EQ(2u, browser::GetBrowserCount(browser()->profile())); + EXPECT_EQ(2u, chrome::GetBrowserCount(browser()->profile())); // Send Control-W. content::WindowedNotificationObserver signal( @@ -168,7 +167,7 @@ IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, KeyboardClose) { signal.Wait(); // App browser is closed. - EXPECT_EQ(1u, browser::GetBrowserCount(browser()->profile())); + EXPECT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); } // Ensure that snapping left with Alt-[ closes the control window. |