| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| 11 #include "chrome/browser/first_run/first_run.h" | 11 #include "chrome/browser/first_run/first_run.h" |
| 12 #include "chrome/browser/infobars/infobar_tab_helper.h" | 12 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 13 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.h" |
| 14 #include "chrome/browser/prefs/session_startup_pref.h" | 14 #include "chrome/browser/prefs/session_startup_pref.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/profiles/profile_impl.h" | 16 #include "chrome/browser/profiles/profile_impl.h" |
| 17 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
| 18 #include "chrome/browser/sessions/session_restore.h" | 18 #include "chrome/browser/sessions/session_restore.h" |
| 19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
| 20 #include "chrome/browser/ui/browser_finder.h" | 20 #include "chrome/browser/ui/browser_finder.h" |
| 21 #include "chrome/browser/ui/browser_list.h" | 21 #include "chrome/browser/ui/browser_list.h" |
| 22 #include "chrome/browser/ui/browser_list_observer.h" |
| 22 #include "chrome/browser/ui/browser_tabstrip.h" | 23 #include "chrome/browser/ui/browser_tabstrip.h" |
| 23 #include "chrome/browser/ui/browser_window.h" | 24 #include "chrome/browser/ui/browser_window.h" |
| 24 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 25 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 25 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" | 26 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
| 26 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 27 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 27 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 28 #include "chrome/common/pref_names.h" | 29 #include "chrome/common/pref_names.h" |
| 29 #include "chrome/common/url_constants.h" | 30 #include "chrome/common/url_constants.h" |
| 30 #include "chrome/test/base/in_process_browser_test.h" | 31 #include "chrome/test/base/in_process_browser_test.h" |
| 31 #include "chrome/test/base/ui_test_utils.h" | 32 #include "chrome/test/base/ui_test_utils.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 Browser* not_this_browser) { | 94 Browser* not_this_browser) { |
| 94 for (BrowserList::const_iterator i = BrowserList::begin(); | 95 for (BrowserList::const_iterator i = BrowserList::begin(); |
| 95 i != BrowserList::end(); ++i) { | 96 i != BrowserList::end(); ++i) { |
| 96 if (*i != not_this_browser && (*i)->profile() == profile) | 97 if (*i != not_this_browser && (*i)->profile() == profile) |
| 97 return *i; | 98 return *i; |
| 98 } | 99 } |
| 99 return NULL; | 100 return NULL; |
| 100 } | 101 } |
| 101 }; | 102 }; |
| 102 | 103 |
| 103 class OpenURLsPopupObserver : public BrowserList::Observer { | 104 class OpenURLsPopupObserver : public chrome::BrowserListObserver { |
| 104 public: | 105 public: |
| 105 OpenURLsPopupObserver() : added_browser_(NULL) { } | 106 OpenURLsPopupObserver() : added_browser_(NULL) { } |
| 106 | 107 |
| 107 virtual void OnBrowserAdded(Browser* browser) { | 108 virtual void OnBrowserAdded(Browser* browser) { |
| 108 added_browser_ = browser; | 109 added_browser_ = browser; |
| 109 } | 110 } |
| 110 | 111 |
| 111 virtual void OnBrowserRemoved(Browser* browser) { } | 112 virtual void OnBrowserRemoved(Browser* browser) { } |
| 112 | 113 |
| 113 Browser* added_browser_; | 114 Browser* added_browser_; |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 ASSERT_EQ(1u, browser::GetBrowserCount(profile_urls)); | 686 ASSERT_EQ(1u, browser::GetBrowserCount(profile_urls)); |
| 686 new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); | 687 new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); |
| 687 ASSERT_TRUE(new_browser); | 688 ASSERT_TRUE(new_browser); |
| 688 ASSERT_EQ(1, new_browser->tab_count()); | 689 ASSERT_EQ(1, new_browser->tab_count()); |
| 689 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), | 690 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), |
| 690 chrome::GetWebContentsAt(new_browser, 0)->GetURL()); | 691 chrome::GetWebContentsAt(new_browser, 0)->GetURL()); |
| 691 EXPECT_EQ(1U, chrome::GetTabContentsAt(new_browser, 0)->infobar_tab_helper()-> | 692 EXPECT_EQ(1U, chrome::GetTabContentsAt(new_browser, 0)->infobar_tab_helper()-> |
| 692 infobar_count()); | 693 infobar_count()); |
| 693 } | 694 } |
| 694 #endif // !OS_CHROMEOS | 695 #endif // !OS_CHROMEOS |
| OLD | NEW |