Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove TabStripModel wrapper use.

BUG=167548
TEST=no functional change


Review URL: https://chromiumcodereview.appspot.com/11953065

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@179199 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
  • Loading branch information...
commit 99e3dedfb7d413f24547ec5b57b8a2d2f9cd7ce7 1 parent 6bb56df
avi@chromium.org authored
Showing with 213 additions and 165 deletions.
  1. +3 −2 accessibility/accessibility_extension_apitest.cc
  2. +1 −0  autofill/DEPS
  3. +25 −17 autofill/autofill_browsertest.cc
  4. +2 −1  autofill/autofill_external_delegate_browsertest.cc
  5. +3 −3 autofill/form_structure_browsertest.cc
  6. +2 −2 automation/automation_misc_browsertest.cc
  7. +8 −5 browser_encoding_browsertest.cc
  8. +2 −2 browsing_data/browsing_data_remover_browsertest.cc
  9. +2 −2 chrome_switches_browsertest.cc
  10. +3 −2 chrome_to_mobile_service_unittest.cc
  11. +5 −3 chromeos/extensions/file_browser_resource_throttle_browsertest.cc
  12. +1 −2  chromeos/memory/oom_priority_manager_browsertest.cc
  13. +5 −3 collected_cookies_browsertest.cc
  14. +19 −17 content_settings/content_settings_browsertest.cc
  15. +5 −3 crash_recovery_browsertest.cc
  16. +6 −4 custom_handlers/protocol_handler_registry_browsertest.cc
  17. +6 −6 do_not_track_browsertest.cc
  18. +4 −4 extensions/api/extension_action/page_as_browser_action_apitest.cc
  19. +13 −13 extensions/extension_resource_request_policy_apitest.cc
  20. +2 −2 iframe_browsertest.cc
  21. +4 −3 page_cycler/page_cycler.cc
  22. +5 −3 repost_form_warning_browsertest.cc
  23. +29 −23 ui/browser_focus_uitest.cc
  24. +4 −2 ui/cocoa/extensions/media_galleries_dialog_cocoa_browsertest.mm
  25. +6 −3 ui/cocoa/ssl_client_certificate_selector_cocoa_browsertest.mm
  26. +4 −4 ui/fullscreen/fullscreen_controller_interactive_browsertest.cc
  27. +2 −2 ui/fullscreen/fullscreen_controller_test.cc
  28. +13 −10 ui/gtk/browser_window_gtk.cc
  29. +9 −7 ui/omnibox/omnibox_view_browsertest.cc
  30. +2 −2 ui/toolbar/wrench_menu_model_unittest.cc
  31. +3 −3 ui/views/bookmarks/bookmark_context_menu_controller_views_win.cc
  32. +5 −3 ui/webui/constrained_web_dialog_ui_browsertest.cc
  33. +3 −2 ui/webui/inspect_ui_browsertest.cc
  34. +4 −3 ui/webui/options/options_ui_browsertest.cc
  35. +3 −2 ui/webui/options/preferences_browsertest.cc
View
5 accessibility/accessibility_extension_apitest.cc
@@ -7,7 +7,7 @@
#include "chrome/browser/api/infobars/simple_alert_infobar_delegate.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
// Times out on win asan, http://crbug.com/166026
@@ -17,7 +17,8 @@
#define MAYBE_GetAlertsForTab GetAlertsForTab
#endif
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_GetAlertsForTab) {
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(web_contents);
InfoBarService* infobar_service =
InfoBarService::FromWebContents(web_contents);
View
1  autofill/DEPS
@@ -42,6 +42,7 @@ specific_include_rules = {
"!chrome/browser/ui/browser.h",
"!chrome/browser/ui/browser_tabstrip.h",
"!chrome/browser/ui/browser_window.h",
+ "!chrome/browser/ui/tabs/tab_strip_model.h",
],
# TODO(joi): May be able to get rid of the need for this by moving
View
42 autofill/autofill_browsertest.cc
@@ -27,8 +27,8 @@
#include "chrome/browser/translate/translate_infobar_delegate.h"
#include "chrome/browser/translate/translate_manager.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/render_messages.h"
#include "chrome/test/base/in_process_browser_test.h"
@@ -134,8 +134,8 @@ class WindowedPersonalDataManagerObserver
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE {
// Accept in the infobar.
- infobar_service_ =
- InfoBarService::FromWebContents(chrome::GetActiveWebContents(browser_));
+ infobar_service_ = InfoBarService::FromWebContents(
+ browser_->tab_strip_model()->GetActiveWebContents());
InfoBarDelegate* infobar = infobar_service_->GetInfoBarDelegateAt(0);
ConfirmInfoBarDelegate* confirm_infobar =
@@ -292,7 +292,7 @@ class AutofillTest : public InProcessBrowserTest {
const std::string& expected_value) {
std::string value;
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send("
" document.getElementById('" + field_name + "').value);",
&value));
@@ -300,7 +300,8 @@ class AutofillTest : public InProcessBrowserTest {
}
RenderViewHost* render_view_host() {
- return chrome::GetActiveWebContents(browser())->GetRenderViewHost();
+ return browser()->tab_strip_model()->GetActiveWebContents()->
+ GetRenderViewHost();
}
void SimulateURLFetch(bool success) {
@@ -345,7 +346,9 @@ class AutofillTest : public InProcessBrowserTest {
void FocusFirstNameField() {
LOG(WARNING) << "Clicking on the tab.";
- content::SimulateMouseClick(chrome::GetActiveWebContents(browser()), 0,
+ content::SimulateMouseClick(
+ browser()->tab_strip_model()->GetActiveWebContents(),
+ 0,
WebKit::WebMouseEvent::ButtonLeft);
LOG(WARNING) << "Focusing the first name field.";
@@ -375,8 +378,9 @@ class AutofillTest : public InProcessBrowserTest {
void SendKeyAndWait(ui::KeyboardCode key, int notification_type) {
content::WindowedNotificationObserver observer(
notification_type, content::Source<RenderViewHost>(render_view_host()));
- content::SimulateKeyPress(chrome::GetActiveWebContents(browser()),
- key, false, false, false, false);
+ content::SimulateKeyPress(
+ browser()->tab_strip_model()->GetActiveWebContents(),
+ key, false, false, false, false);
observer.Wait();
}
@@ -799,7 +803,7 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, MAYBE_AutofillAfterReload) {
// Reload the page.
LOG(WARNING) << "Reloading the page.";
- WebContents* tab = chrome::GetActiveWebContents(browser());
+ WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
tab->GetController().Reload(false);
content::WaitForLoadStop(tab);
@@ -849,8 +853,8 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, DISABLED_AutofillAfterTranslate) {
RenderViewHostTester::TestOnMessageReceived(
render_view_host(),
ChromeViewHostMsg_TranslateLanguageDetermined(0, "ja", true));
- TranslateInfoBarDelegate* infobar =
- InfoBarService::FromWebContents(chrome::GetActiveWebContents(browser()))->
+ TranslateInfoBarDelegate* infobar = InfoBarService::FromWebContents(
+ browser()->tab_strip_model()->GetActiveWebContents())->
GetInfoBarDelegateAt(0)->AsTranslateInfoBarDelegate();
ASSERT_TRUE(infobar != NULL);
@@ -1084,7 +1088,8 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, InvalidCreditCardNumberIsNotAggregated) {
SubmitCreditCard("Bob Smith", card.c_str(), "12", "2014");
ASSERT_EQ(0u,
InfoBarService::FromWebContents(
- chrome::GetActiveWebContents(browser()))->GetInfoBarCount());
+ browser()->tab_strip_model()->GetActiveWebContents())->
+ GetInfoBarCount());
}
// Test whitespaces and separator chars are stripped for valid CC numbers.
@@ -1306,7 +1311,8 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, CCInfoNotStoredWhenAutocompleteOff) {
ASSERT_EQ(0u,
InfoBarService::FromWebContents(
- chrome::GetActiveWebContents(browser()))->GetInfoBarCount());
+ browser()->tab_strip_model()->GetActiveWebContents())->
+ GetInfoBarCount());
}
// http://crbug.com/150084
@@ -1362,7 +1368,7 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, MAYBE_FormFillableOnReset) {
PopulateForm("NAME_FIRST");
ASSERT_TRUE(content::ExecuteScript(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"document.getElementById('testform').reset()"));
PopulateForm("NAME_FIRST");
@@ -1510,7 +1516,8 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, MAYBE_FormFillLatencyAfterSubmit) {
content::WindowedNotificationObserver load_stop_observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<content::NavigationController>(
- &chrome::GetActiveWebContents(browser())->GetController()));
+ &browser()->tab_strip_model()->GetActiveWebContents()->
+ GetController()));
ASSERT_TRUE(content::ExecuteScript(
render_view_host(),
@@ -1550,8 +1557,9 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, MAYBE_DisableAutocompleteWhileFilling) {
// Press the down arrow to select the suggestion and attempt to preview the
// autofilled form.
- content::SimulateKeyPress(chrome::GetActiveWebContents(browser()),
- ui::VKEY_DOWN, false, false, false, false);
+ content::SimulateKeyPress(
+ browser()->tab_strip_model()->GetActiveWebContents(),
+ ui::VKEY_DOWN, false, false, false, false);
// Wait for any IPCs to complete by performing an action that generates an
// IPC that's easy to wait for. Chrome shouldn't crash.
View
3  autofill/autofill_external_delegate_browsertest.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/ui/autofill/autofill_popup_view.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "content/public/browser/navigation_controller.h"
@@ -56,7 +57,7 @@ class AutofillExternalDelegateBrowserTest
virtual ~AutofillExternalDelegateBrowserTest() {}
virtual void SetUpOnMainThread() OVERRIDE {
- web_contents_ = chrome::GetActiveWebContents(browser());
+ web_contents_ = browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(web_contents_ != NULL);
Observe(web_contents_);
View
6 autofill/form_structure_browsertest.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/autofill/data_driven_test.h"
#include "chrome/browser/autofill/form_structure.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -68,8 +68,8 @@ void FormStructureBrowserTest::GenerateResults(const std::string& input,
ASSERT_NO_FATAL_FAILURE(ui_test_utils::NavigateToURL(browser(),
HTMLToDataURI(input)));
- AutofillManager* autofill_manager =
- AutofillManager::FromWebContents(chrome::GetActiveWebContents(browser()));
+ AutofillManager* autofill_manager = AutofillManager::FromWebContents(
+ browser()->tab_strip_model()->GetActiveWebContents());
ASSERT_NE(static_cast<AutofillManager*>(NULL), autofill_manager);
std::vector<FormStructure*> forms = autofill_manager->form_structures_.get();
*output = FormStructureBrowserTest::FormStructuresToString(forms);
View
4 automation/automation_misc_browsertest.cc
@@ -8,7 +8,7 @@
#include "base/callback.h"
#include "chrome/browser/automation/automation_provider_observers.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/automation_constants.h"
#include "chrome/common/automation_events.h"
#include "chrome/test/base/in_process_browser_test.h"
@@ -72,7 +72,7 @@ IN_PROC_BROWSER_TEST_F(AutomationMiscBrowserTest, ProcessMouseEvent) {
.Times(2);
content::RenderViewHost* view =
- chrome::GetActiveWebContents(browser())->GetRenderViewHost();
+ browser()->tab_strip_model()->GetActiveWebContents()->GetRenderViewHost();
ASSERT_TRUE(content::ExecuteScript(
view,
"window.didClick = false;"
View
13 browser_encoding_browsertest.cc
@@ -11,7 +11,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -123,7 +123,7 @@ class BrowserEncodingTest
SavePackageFinishedObserver observer(
content::BrowserContext::GetDownloadManager(browser()->profile()),
loop_runner->QuitClosure());
- chrome::GetActiveWebContents(browser())->SavePage(
+ browser()->tab_strip_model()->GetActiveWebContents()->SavePage(
full_file_name, temp_sub_resource_dir_,
content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML);
loop_runner->Run();
@@ -165,7 +165,8 @@ IN_PROC_BROWSER_TEST_P(BrowserEncodingTest, TestEncodingAliasMapping) {
GURL url = content::URLRequestMockHTTPJob::GetMockUrl(test_file_path);
ui_test_utils::NavigateToURL(browser(), url);
EXPECT_EQ(GetParam().encoding_name,
- chrome::GetActiveWebContents(browser())->GetEncoding());
+ browser()->tab_strip_model()->GetActiveWebContents()->
+ GetEncoding());
}
INSTANTIATE_TEST_CASE_P(EncodingAliases,
@@ -183,7 +184,8 @@ IN_PROC_BROWSER_TEST_F(BrowserEncodingTest, TestOverrideEncoding) {
test_dir_path = test_dir_path.AppendASCII(kTestFileName);
GURL url = content::URLRequestMockHTTPJob::GetMockUrl(test_dir_path);
ui_test_utils::NavigateToURL(browser(), url);
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
EXPECT_EQ("ISO-8859-1", web_contents->GetEncoding());
// Override the encoding to "gb18030".
@@ -288,7 +290,8 @@ IN_PROC_BROWSER_TEST_F(BrowserEncodingTest, MAYBE_TestEncodingAutoDetect) {
browser()->profile()->GetPrefs()->SetString(prefs::kDefaultCharset,
"ISO-8859-4");
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestDatas); ++i) {
// Disable auto detect if it is on.
browser()->profile()->GetPrefs()->SetBoolean(
View
4 browsing_data/browsing_data_remover_browsertest.cc
@@ -9,7 +9,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/in_process_browser_test.h"
@@ -47,7 +47,7 @@ class BrowsingDataRemoverBrowserTest : public InProcessBrowserTest {
const std::string& result) {
std::string data;
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()), script, &data));
+ browser()->tab_strip_model()->GetActiveWebContents(), script, &data));
ASSERT_EQ(data, result);
}
View
4 chrome_switches_browsertest.cc
@@ -4,7 +4,7 @@
#include "base/command_line.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -40,7 +40,7 @@ IN_PROC_BROWSER_TEST_F(HostRulesTest, TestMap) {
std::string html;
EXPECT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(document.body.outerHTML);",
&html));
View
5 chrome_to_mobile_service_unittest.cc
@@ -10,7 +10,8 @@
#include "chrome/browser/command_updater.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/signin/token_service.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/feature_switch.h"
#include "chrome/common/pref_names.h"
@@ -172,7 +173,7 @@ TEST_F(ChromeToMobileServiceTest, CertainSchemesAreRequired) {
};
content::NavigationController* controller =
- &chrome::GetActiveWebContents(browser())->GetController();
+ &browser()->tab_strip_model()->GetActiveWebContents()->GetController();
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) {
NavigateAndCommit(controller, GURL(cases[i].url));
EXPECT_EQ(cases[i].enabled, UpdateAndGetVerifiedCommandState());
View
8 chromeos/extensions/file_browser_resource_throttle_browsertest.cc
@@ -15,7 +15,7 @@
#include "chrome/browser/google_apis/test_server/http_server.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.cc"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/pref_names.cc"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/download_item.h"
@@ -260,7 +260,8 @@ IN_PROC_BROWSER_TEST_F(FileBrowserResourceThrottleExtensionApiTest, Basic) {
// Get child and routing id from the current web contents (the real values
// should be used so the FileBrowserHandlerEventRouter can correctly extract
// profile from them).
- WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(web_contents);
int child_id = web_contents->GetRenderProcessHost()->GetID();
int routing_id = web_contents->GetRoutingID();
@@ -365,7 +366,8 @@ IN_PROC_BROWSER_TEST_F(FileBrowserResourceThrottleExtensionApiTest,
downloads_dir_.path().Append(FILE_PATH_LITERAL("download_target.txt"));
// Set the downloads parameters.
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(web_contents);
scoped_ptr<DownloadUrlParameters> params(
DownloadUrlParameters::FromWebContents(web_contents, url));
View
3  chromeos/memory/oom_priority_manager_browsertest.cc
@@ -6,7 +6,6 @@
#include "chrome/browser/chromeos/memory/oom_priority_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/find_bar/find_bar_controller.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/url_constants.h"
@@ -117,7 +116,7 @@ IN_PROC_BROWSER_TEST_F(OomPriorityManagerTest, OomPriorityManagerBasics) {
reload1.Wait();
// Make sure the FindBarController gets the right WebContents.
EXPECT_EQ(browser()->GetFindBarController()->web_contents(),
- chrome::GetActiveWebContents(browser()));
+ browser()->tab_strip_model()->GetActiveWebContents());
EXPECT_EQ(0, browser()->tab_strip_model()->active_index());
EXPECT_FALSE(browser()->tab_strip_model()->IsTabDiscarded(0));
EXPECT_FALSE(browser()->tab_strip_model()->IsTabDiscarded(1));
View
8 collected_cookies_browsertest.cc
@@ -9,7 +9,7 @@
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -36,7 +36,8 @@ IN_PROC_BROWSER_TEST_F(CollectedCookiesTest, DoubleDisplay) {
browser(), test_server()->GetURL("files/cookie1.html"));
// Click on the info link twice.
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
chrome::ShowCollectedCookiesDialog(web_contents);
chrome::ShowCollectedCookiesDialog(web_contents);
}
@@ -53,7 +54,8 @@ IN_PROC_BROWSER_TEST_F(CollectedCookiesTest, NavigateAway) {
browser(), test_server()->GetURL("files/cookie1.html"));
// Click on the info link.
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
chrome::ShowCollectedCookiesDialog(web_contents);
// Navigate to another page.
View
36 content_settings/content_settings_browsertest.cc
@@ -13,7 +13,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/render_messages.h"
@@ -232,7 +231,8 @@ IN_PROC_BROWSER_TEST_F(ContentSettingsTest, RedirectLoopCookies) {
ui_test_utils::NavigateToURL(browser(), test_url);
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_EQ(UTF8ToUTF16(test_url.spec() + " failed to load"),
web_contents->GetTitle());
@@ -248,7 +248,8 @@ IN_PROC_BROWSER_TEST_F(ContentSettingsTest, ContentSettingsBlockDataURLs) {
ui_test_utils::NavigateToURL(browser(), url);
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_EQ(UTF8ToUTF16("Data URL"), web_contents->GetTitle());
EXPECT_TRUE(TabSpecificContentSettings::FromWebContents(web_contents)->
@@ -273,7 +274,8 @@ IN_PROC_BROWSER_TEST_F(ContentSettingsTest, RedirectCrossOrigin) {
ui_test_utils::NavigateToURL(browser(), test_url);
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
EXPECT_TRUE(TabSpecificContentSettings::FromWebContents(web_contents)->
IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES));
@@ -307,10 +309,10 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, Basic) {
string16 expected_title(ASCIIToUTF16("OK"));
content::TitleWatcher title_watcher(
- chrome::GetActiveWebContents(browser()), expected_title);
+ browser()->tab_strip_model()->GetActiveWebContents(), expected_title);
content::RenderViewHost* host =
- chrome::GetActiveWebContents(browser())->GetRenderViewHost();
+ browser()->tab_strip_model()->GetActiveWebContents()->GetRenderViewHost();
host->Send(new ChromeViewMsg_LoadBlockedPlugins(
host->GetRoutingID(), std::string()));
@@ -333,7 +335,7 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, AllowException) {
string16 expected_title(ASCIIToUTF16("OK"));
content::TitleWatcher title_watcher(
- chrome::GetActiveWebContents(browser()), expected_title);
+ browser()->tab_strip_model()->GetActiveWebContents(), expected_title);
ui_test_utils::NavigateToURL(browser(), url);
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
}
@@ -352,7 +354,7 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, BlockException) {
string16 expected_title(ASCIIToUTF16("Click To Play"));
content::TitleWatcher title_watcher(
- chrome::GetActiveWebContents(browser()), expected_title);
+ browser()->tab_strip_model()->GetActiveWebContents(), expected_title);
ui_test_utils::NavigateToURL(browser(), url);
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
}
@@ -367,20 +369,20 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, LoadAllBlockedPlugins) {
string16 expected_title1(ASCIIToUTF16("1"));
content::TitleWatcher title_watcher1(
- chrome::GetActiveWebContents(browser()), expected_title1);
+ browser()->tab_strip_model()->GetActiveWebContents(), expected_title1);
content::RenderViewHost* host =
- chrome::GetActiveWebContents(browser())->GetRenderViewHost();
+ browser()->tab_strip_model()->GetActiveWebContents()->GetRenderViewHost();
host->Send(new ChromeViewMsg_LoadBlockedPlugins(
host->GetRoutingID(), std::string()));
EXPECT_EQ(expected_title1, title_watcher1.WaitAndGetTitle());
string16 expected_title2(ASCIIToUTF16("2"));
content::TitleWatcher title_watcher2(
- chrome::GetActiveWebContents(browser()), expected_title2);
+ browser()->tab_strip_model()->GetActiveWebContents(), expected_title2);
ASSERT_TRUE(content::ExecuteScript(
- chrome::GetActiveWebContents(browser()), "window.inject()"));
+ browser()->tab_strip_model()->GetActiveWebContents(), "window.inject()"));
EXPECT_EQ(expected_title2, title_watcher2.WaitAndGetTitle());
}
@@ -395,15 +397,15 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, NoCallbackAtLoad) {
// Inject the callback function into the HTML page generated by the browser.
ASSERT_TRUE(content::ExecuteScript(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"CallOnStartup = function() { document.title = \"OK\"; }"));
string16 expected_title(ASCIIToUTF16("OK"));
content::TitleWatcher title_watcher(
- chrome::GetActiveWebContents(browser()), expected_title);
+ browser()->tab_strip_model()->GetActiveWebContents(), expected_title);
content::RenderViewHost* host =
- chrome::GetActiveWebContents(browser())->GetRenderViewHost();
+ browser()->tab_strip_model()->GetActiveWebContents()->GetRenderViewHost();
host->Send(new ChromeViewMsg_LoadBlockedPlugins(
host->GetRoutingID(), std::string()));
@@ -420,10 +422,10 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, DeleteSelfAtLoad) {
string16 expected_title(ASCIIToUTF16("OK"));
content::TitleWatcher title_watcher(
- chrome::GetActiveWebContents(browser()), expected_title);
+ browser()->tab_strip_model()->GetActiveWebContents(), expected_title);
content::RenderViewHost* host =
- chrome::GetActiveWebContents(browser())->GetRenderViewHost();
+ browser()->tab_strip_model()->GetActiveWebContents()->GetRenderViewHost();
host->Send(new ChromeViewMsg_LoadBlockedPlugins(
host->GetRoutingID(), std::string()));
View
8 crash_recovery_browsertest.cc
@@ -5,7 +5,7 @@
#include "base/file_path.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -53,7 +53,8 @@ IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, Reload) {
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(
- &chrome::GetActiveWebContents(browser())->GetController()));
+ &browser()->tab_strip_model()->GetActiveWebContents()->
+ GetController()));
chrome::Reload(browser(), CURRENT_TAB);
observer.Wait();
ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(),
@@ -81,7 +82,8 @@ IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, LoadInNewTab) {
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(
- &chrome::GetActiveWebContents(browser())->GetController()));
+ &browser()->tab_strip_model()->GetActiveWebContents()->
+ GetController()));
chrome::Reload(browser(), CURRENT_TAB);
observer.Wait();
ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(),
View
10 custom_handlers/protocol_handler_registry_browsertest.cc
@@ -10,7 +10,7 @@
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/tab_contents/render_view_context_menu.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/navigation_controller.h"
@@ -52,7 +52,8 @@ class RegisterProtocolHandlerBrowserTest : public InProcessBrowserTest {
params.media_type = WebKit::WebContextMenuData::MediaTypeNone;
params.link_url = url;
params.unfiltered_link_url = url;
- WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
params.page_url = web_contents->GetController().GetActiveEntry()->GetURL();
#if defined(OS_MACOSX)
params.writing_direction_default = 0;
@@ -60,7 +61,7 @@ class RegisterProtocolHandlerBrowserTest : public InProcessBrowserTest {
params.writing_direction_right_to_left = 0;
#endif // OS_MACOSX
TestRenderViewContextMenu* menu = new TestRenderViewContextMenu(
- chrome::GetActiveWebContents(browser()), params);
+ browser()->tab_strip_model()->GetActiveWebContents(), params);
menu->Init();
return menu;
}
@@ -108,5 +109,6 @@ IN_PROC_BROWSER_TEST_F(RegisterProtocolHandlerBrowserTest, CustomHandler) {
ui_test_utils::NavigateToURL(browser(), GURL("foo:test"));
- ASSERT_EQ(handler_url, chrome::GetActiveWebContents(browser())->GetURL());
+ ASSERT_EQ(handler_url,
+ browser()->tab_strip_model()->GetActiveWebContents()->GetURL());
}
View
12 do_not_track_browsertest.cc
@@ -7,7 +7,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -27,7 +27,7 @@ IN_PROC_BROWSER_TEST_F(DoNotTrackTest, Simple) {
ui_test_utils::NavigateToURL(browser(), url);
int matches = ui_test_utils::FindInPage(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
string16(ASCIIToUTF16("1")),
true /* forward */, false /* match case */, NULL /* ordinal */,
NULL /* selection_rect */);
@@ -48,7 +48,7 @@ IN_PROC_BROWSER_TEST_F(DoNotTrackTest, Redirect) {
ui_test_utils::NavigateToURL(browser(), url);
int matches = ui_test_utils::FindInPage(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
string16(ASCIIToUTF16("1")),
true /* forward */, false /* match case */, NULL /* ordinal */,
NULL /* selection_rect */);
@@ -62,11 +62,11 @@ IN_PROC_BROWSER_TEST_F(DoNotTrackTest, DOMProperty) {
prefs->SetBoolean(prefs::kEnableDoNotTrack, true);
ASSERT_NO_FATAL_FAILURE(content::WaitForLoadStop(
- chrome::GetActiveWebContents(browser())));
+ browser()->tab_strip_model()->GetActiveWebContents()));
std::string do_not_track;
EXPECT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(navigator.doNotTrack)",
&do_not_track));
EXPECT_EQ("1", do_not_track);
@@ -76,7 +76,7 @@ IN_PROC_BROWSER_TEST_F(DoNotTrackTest, DOMProperty) {
prefs->SetBoolean(prefs::kEnableDoNotTrack, false);
EXPECT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send("
" navigator.doNotTrack === null ? '0' : '1')",
&do_not_track));
View
8 extensions/api/extension_action/page_as_browser_action_apitest.cc
@@ -14,9 +14,9 @@
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/omnibox/location_bar.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -77,7 +77,7 @@ IN_PROC_BROWSER_TEST_F(PageAsBrowserActionApiTest, Basic) {
// Test that we received the changes.
int tab_id = ExtensionTabUtil::GetTabId(
- chrome::GetActiveWebContents(browser()));
+ browser()->tab_strip_model()->GetActiveWebContents());
ExtensionAction* action =
extension_action_manager()->GetBrowserAction(*extension);
ASSERT_TRUE(action);
@@ -116,7 +116,7 @@ IN_PROC_BROWSER_TEST_F(PageAsBrowserActionApiTest, AddPopup) {
ASSERT_TRUE(extension) << message_;
int tab_id = ExtensionTabUtil::GetTabId(
- chrome::GetActiveWebContents(browser()));
+ browser()->tab_strip_model()->GetActiveWebContents());
ExtensionAction* page_action =
extension_action_manager()->GetBrowserAction(*extension);
@@ -164,7 +164,7 @@ IN_PROC_BROWSER_TEST_F(PageAsBrowserActionApiTest, RemovePopup) {
ASSERT_TRUE(extension) << message_;
int tab_id = ExtensionTabUtil::GetTabId(
- chrome::GetActiveWebContents(browser()));
+ browser()->tab_strip_model()->GetActiveWebContents());
ExtensionAction* page_action =
extension_action_manager()->GetBrowserAction(*extension);
View
26 extensions/extension_resource_request_policy_apitest.cc
@@ -5,7 +5,7 @@
#include "base/logging.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/web_contents.h"
@@ -51,7 +51,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest, OriginPrivileges) {
browser(), web_resource.ReplaceComponents(make_host_a_com));
std::string result;
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(document.title)",
&result));
EXPECT_EQ(result, "Loaded");
@@ -63,7 +63,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest, OriginPrivileges) {
"non_existent_extension.html"));
ui_test_utils::NavigateToURL(browser(), non_existent_extension);
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(document.title)",
&result));
EXPECT_EQ(result, "Image failed to load");
@@ -77,7 +77,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest, OriginPrivileges) {
ui_test_utils::NavigateToURL(browser(),
GURL(std::string("data:text/html;charset=utf-8,") + file_source));
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(document.title)",
&result));
EXPECT_EQ(result, "Loaded");
@@ -93,7 +93,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest, OriginPrivileges) {
browser(),
GURL("chrome-extension://pbkkcbgdkliohhfaeefcijaghglkahja/index.html"));
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(document.title)",
&result));
EXPECT_EQ(result, "Loaded");
@@ -157,7 +157,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest,
"web_accessible/accessible_resource.html"));
ui_test_utils::NavigateToURL(browser(), accessible_resource);
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(document.title)",
&result));
EXPECT_EQ("Loaded", result);
@@ -169,7 +169,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest,
ui_test_utils::NavigateToURL(
browser(), xhr_accessible_resource);
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(document.title)",
&result));
EXPECT_EQ("XHR completed with status: 200", result);
@@ -181,7 +181,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest,
ui_test_utils::NavigateToURL(
browser(), xhr_inaccessible_resource);
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(document.title)",
&result));
EXPECT_EQ("XHR failed to load resource", result);
@@ -192,7 +192,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest,
"web_accessible/nonaccessible_resource.html"));
ui_test_utils::NavigateToURL(browser(), nonaccessible_resource);
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(document.title)",
&result));
EXPECT_EQ("Image failed to load", result);
@@ -203,7 +203,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest,
"web_accessible/nonexistent_resource.html"));
ui_test_utils::NavigateToURL(browser(), nonexistent_resource);
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(document.title)",
&result));
EXPECT_EQ("Image failed to load", result);
@@ -214,7 +214,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest,
"web_accessible/nonaccessible_chrome_resource_scheme.html"));
ui_test_utils::NavigateToURL(browser(), nonaccessible_cer_resource);
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(document.title)",
&result));
EXPECT_EQ("Loading CER:// failed.", result);
@@ -228,7 +228,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest,
ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(
browser(), accessible_newtab_override, 2);
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(document.title)",
&result));
EXPECT_EQ("New Tab Page Loaded Successfully", result);
@@ -248,7 +248,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest,
"web_accessible/accessible_resource_with_csp.html"));
ui_test_utils::NavigateToURL(browser(), accessible_resource_with_csp);
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(document.title)",
&result));
EXPECT_EQ("Loaded", result);
View
4 iframe_browsertest.cc
@@ -5,7 +5,7 @@
#include "base/file_path.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/web_contents.h"
@@ -19,7 +19,7 @@ class IFrameTest : public InProcessBrowserTest {
ui_test_utils::NavigateToURL(browser(), url);
EXPECT_EQ(ASCIIToUTF16(page_title),
- chrome::GetActiveWebContents(browser())->GetTitle());
+ browser()->tab_strip_model()->GetActiveWebContents()->GetTitle());
}
};
View
7 page_cycler/page_cycler.cc
@@ -16,7 +16,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_list.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/test/base/chrome_process_util.h"
#include "chrome/test/perf/perf_test.h"
@@ -33,7 +33,8 @@ using content::WebContents;
PageCycler::PageCycler(Browser* browser,
const FilePath& urls_file)
- : content::WebContentsObserver(chrome::GetActiveWebContents(browser)),
+ : content::WebContentsObserver(
+ browser->tab_strip_model()->GetActiveWebContents()),
browser_(browser),
urls_file_(urls_file),
url_index_(0),
@@ -134,7 +135,7 @@ void PageCycler::BeginCycle() {
// result in the browser being in a state of loading when PageCycler is ready
// to start. Instead of interrupting the load, we wait for it to finish, and
// will call LoadNextURL() from DidFinishLoad() or DidFailProvisionalLoad().
- if (chrome::GetActiveWebContents(browser_)->IsLoading())
+ if (browser_->tab_strip_model()->GetActiveWebContents()->IsLoading())
return;
LoadNextURL();
}
View
8 repost_form_warning_browsertest.cc
@@ -5,7 +5,7 @@
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/web_contents_modal_dialog_manager.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/url_constants.h"
@@ -32,7 +32,8 @@ IN_PROC_BROWSER_TEST_F(RepostFormWarningTest, TestDoubleReload) {
GURL("javascript:document.getElementById('form').submit()"));
// Try to reload it twice, checking for repost.
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
web_contents->GetController().Reload(true);
web_contents->GetController().Reload(true);
@@ -61,7 +62,8 @@ IN_PROC_BROWSER_TEST_F(RepostFormWarningTest, TestLoginAfterRepost) {
GURL("javascript:document.getElementById('form').submit()"));
// Try to reload it, checking for repost.
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
web_contents->GetController().Reload(true);
// Navigate to a page that requires authentication, bringing up another
View
52 ui/browser_focus_uitest.cc
@@ -394,8 +394,9 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_TabsRememberFocusFindInPage) {
ui_test_utils::NavigateToURL(browser(), url);
chrome::Find(browser());
- ui_test_utils::FindInPage(chrome::GetActiveWebContents(browser()),
- ASCIIToUTF16("a"), true, false, NULL, NULL);
+ ui_test_utils::FindInPage(
+ browser()->tab_strip_model()->GetActiveWebContents(),
+ ASCIIToUTF16("a"), true, false, NULL, NULL);
ASSERT_TRUE(IsViewFocused(VIEW_ID_FIND_IN_PAGE_TEXT_FIELD));
// Focus the location bar.
@@ -484,7 +485,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, LocationBarLockFocus) {
chrome::FocusLocationBar(browser());
ASSERT_TRUE(content::ExecuteScript(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"stealFocus();"));
// Make sure the location bar is still focused.
@@ -530,7 +531,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) {
// Let's make sure the focus is on the expected element in the page.
std::string actual;
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(getFocusedElement());",
&actual));
ASSERT_STREQ(kExpElementIDs[j], actual.c_str());
@@ -546,7 +547,8 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) {
browser(), ui::VKEY_TAB, false, false, false, false,
content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
content::NotificationSource(content::Source<RenderViewHost>(
- chrome::GetActiveWebContents(browser())->GetRenderViewHost())),
+ browser()->tab_strip_model()->GetActiveWebContents()->
+ GetRenderViewHost())),
details));
} else {
// On the last tab key press, the focus returns to the browser.
@@ -589,7 +591,8 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) {
browser(), ui::VKEY_TAB, false, true, false, false,
content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
content::NotificationSource(content::Source<RenderViewHost>(
- chrome::GetActiveWebContents(browser())->GetRenderViewHost())),
+ browser()->tab_strip_model()->GetActiveWebContents()->
+ GetRenderViewHost())),
details));
} else {
// On the last tab key press, the focus returns to the browser.
@@ -602,7 +605,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) {
// Let's make sure the focus is on the expected element in the page.
std::string actual;
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(getFocusedElement());",
&actual));
ASSERT_STREQ(next_element, actual.c_str());
@@ -628,9 +631,9 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversalOnInterstitial) {
ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER));
// Let's show an interstitial.
- TestInterstitialPage* interstitial_page =
- new TestInterstitialPage(chrome::GetActiveWebContents(browser()),
- true, GURL("http://interstitial.com"));
+ TestInterstitialPage* interstitial_page = new TestInterstitialPage(
+ browser()->tab_strip_model()->GetActiveWebContents(),
+ true, GURL("http://interstitial.com"));
// Give some time for the interstitial to show.
MessageLoop::current()->PostDelayedTask(FROM_HERE,
MessageLoop::QuitClosure(),
@@ -745,13 +748,13 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_InterstitialFocus) {
// Page should have focus.
ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER));
- EXPECT_TRUE(chrome::GetActiveWebContents(browser())->GetRenderViewHost()->
- GetView()->HasFocus());
+ EXPECT_TRUE(browser()->tab_strip_model()->GetActiveWebContents()->
+ GetRenderViewHost()->GetView()->HasFocus());
// Let's show an interstitial.
- TestInterstitialPage* interstitial_page =
- new TestInterstitialPage(chrome::GetActiveWebContents(browser()),
- true, GURL("http://interstitial.com"));
+ TestInterstitialPage* interstitial_page = new TestInterstitialPage(
+ browser()->tab_strip_model()->GetActiveWebContents(),
+ true, GURL("http://interstitial.com"));
// Give some time for the interstitial to show.
MessageLoop::current()->PostDelayedTask(FROM_HERE,
MessageLoop::QuitClosure(),
@@ -831,26 +834,26 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_TabInitialFocus) {
// Open the history tab, focus should be on the tab contents.
chrome::ShowHistory(browser());
ASSERT_NO_FATAL_FAILURE(content::WaitForLoadStop(
- chrome::GetActiveWebContents(browser())));
+ browser()->tab_strip_model()->GetActiveWebContents()));
EXPECT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER));
// Open the new tab, focus should be on the location bar.
chrome::NewTab(browser());
ASSERT_NO_FATAL_FAILURE(content::WaitForLoadStop(
- chrome::GetActiveWebContents(browser())));
+ browser()->tab_strip_model()->GetActiveWebContents()));
EXPECT_TRUE(IsViewFocused(location_bar_focus_view_id_));
// Open the download tab, focus should be on the tab contents.
chrome::ShowDownloads(browser());
ASSERT_NO_FATAL_FAILURE(content::WaitForLoadStop(
- chrome::GetActiveWebContents(browser())));
+ browser()->tab_strip_model()->GetActiveWebContents()));
EXPECT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER));
// Open about:blank, focus should be on the location bar.
chrome::AddSelectedTabWithURL(browser(), GURL(chrome::kAboutBlankURL),
content::PAGE_TRANSITION_LINK);
ASSERT_NO_FATAL_FAILURE(content::WaitForLoadStop(
- chrome::GetActiveWebContents(browser())));
+ browser()->tab_strip_model()->GetActiveWebContents()));
EXPECT_TRUE(IsViewFocused(location_bar_focus_view_id_));
}
@@ -873,7 +876,8 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) {
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(
- &chrome::GetActiveWebContents(browser())->GetController()));
+ &browser()->tab_strip_model()->GetActiveWebContents()->
+ GetController()));
chrome::Reload(browser(), CURRENT_TAB);
observer.Wait();
}
@@ -888,7 +892,8 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) {
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(
- &chrome::GetActiveWebContents(browser())->GetController()));
+ &browser()->tab_strip_model()->GetActiveWebContents()->
+ GetController()));
chrome::Reload(browser(), CURRENT_TAB);
observer.Wait();
}
@@ -905,12 +910,13 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_FocusOnReloadCrashedTab) {
// Open a regular page, crash, reload.
ui_test_utils::NavigateToURL(browser(), test_server()->GetURL(kSimplePage));
- content::CrashTab(chrome::GetActiveWebContents(browser()));
+ content::CrashTab(browser()->tab_strip_model()->GetActiveWebContents());
{
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(
- &chrome::GetActiveWebContents(browser())->GetController()));
+ &browser()->tab_strip_model()->GetActiveWebContents()->
+ GetController()));
chrome::Reload(browser(), CURRENT_TAB);
observer.Wait();
}
View
6 ui/cocoa/extensions/media_galleries_dialog_cocoa_browsertest.mm
@@ -5,8 +5,9 @@
#include "chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h"
#include "chrome/browser/media_gallery/media_galleries_dialog_controller_mock.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/web_contents_modal_dialog_manager.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "content/public/test/test_utils.h"
@@ -26,7 +27,8 @@
IN_PROC_BROWSER_TEST_F(MediaGalleriesDialogBrowserTest, Close) {
NiceMock<MediaGalleriesDialogControllerMock> controller;
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
EXPECT_CALL(controller, web_contents()).
WillRepeatedly(Return(web_contents));
View
9 ui/cocoa/ssl_client_certificate_selector_cocoa_browsertest.mm
@@ -8,8 +8,9 @@
#include "base/bind.h"
#include "chrome/browser/ssl/ssl_client_certificate_selector_test.h"
+#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/web_contents_modal_dialog_manager.h"
#include "chrome/browser/ssl/ssl_client_certificate_selector.h"
#include "content/public/browser/web_contents.h"
@@ -32,7 +33,8 @@ void OnCertificateSelected(net::X509Certificate** out_cert,
SSLClientCertificateSelectorCocoaTest;
IN_PROC_BROWSER_TEST_F(SSLClientCertificateSelectorCocoaTest, Basic) {
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
WebContentsModalDialogManager* web_contents_modal_dialog_manager =
WebContentsModalDialogManager::FromWebContents(web_contents);
EXPECT_FALSE(web_contents_modal_dialog_manager->IsShowingDialog());
@@ -68,7 +70,8 @@ void OnCertificateSelected(net::X509Certificate** out_cert,
initWithNetworkSession:auth_requestor_->http_network_session_
certRequestInfo:auth_requestor_->cert_request_info_
callback:chrome::SelectCertificateCallback()];
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
[selector displayForWebContents:web_contents];
content::RunAllPendingInMessageLoop();
View
8 ui/fullscreen/fullscreen_controller_interactive_browsertest.cc
@@ -7,9 +7,9 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/fullscreen/fullscreen_controller_test.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/render_view_host.h"
@@ -50,7 +50,7 @@ class FullscreenControllerInteractiveTest
// Verify that IsMouseLocked is consistent between the
// Fullscreen Controller and the Render View Host View.
EXPECT_TRUE(browser()->IsMouseLocked() ==
- chrome::GetActiveWebContents(browser())->
+ browser()->tab_strip_model()->GetActiveWebContents()->
GetRenderViewHost()->GetView()->IsMouseLocked());
return browser()->IsMouseLocked();
}
@@ -156,7 +156,7 @@ FullscreenControllerInteractiveTest::TestFullscreenMouseLockContentSettings() {
void FullscreenControllerInteractiveTest::ToggleTabFullscreen_Internal(
bool enter_fullscreen, bool retry_until_success) {
- WebContents* tab = chrome::GetActiveWebContents(browser());
+ WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
do {
FullscreenNotificationObserver fullscreen_observer;
browser()->ToggleFullscreenModeForTab(tab, enter_fullscreen);
@@ -363,7 +363,7 @@ IN_PROC_BROWSER_TEST_F(
AddTabAtIndex(0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED);
- WebContents* tab = chrome::GetActiveWebContents(browser());
+ WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
{
FullscreenNotificationObserver fullscreen_observer;
View
4 ui/fullscreen/fullscreen_controller_test.cc
@@ -7,9 +7,9 @@
#include "base/command_line.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/test_navigation_observer.h"
@@ -22,7 +22,7 @@ const char FullscreenControllerTest::kFullscreenMouseLockHTML[] =
void FullscreenControllerTest::RequestToLockMouse(
bool user_gesture,
bool last_unlocked_by_target) {
- WebContents* tab = chrome::GetActiveWebContents(browser());
+ WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
browser()->RequestToLockMouse(tab, user_gesture,
last_unlocked_by_target);
}
View
23 ui/gtk/browser_window_gtk.cc
@@ -41,7 +41,6 @@
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_list.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window_state.h"
#include "chrome/browser/ui/find_bar/find_bar_controller.h"
#include "chrome/browser/ui/find_bar/find_tab_helper.h"
@@ -740,7 +739,8 @@ void BrowserWindowGtk::BookmarkBarStateChanged(
}
void BrowserWindowGtk::UpdateDevTools() {
- UpdateDevToolsForContents(chrome::GetActiveWebContents(browser_.get()));
+ UpdateDevToolsForContents(
+ browser_->tab_strip_model()->GetActiveWebContents());
}
void BrowserWindowGtk::UpdateLoadingAnimations(bool should_animate) {
@@ -770,7 +770,8 @@ void BrowserWindowGtk::LoadingAnimationCallback() {
tabstrip_->UpdateLoadingAnimations();
} else if (ShouldShowWindowIcon()) {
// ... or in the window icon area for popups and app windows.
- WebContents* web_contents = chrome::GetActiveWebContents(browser_.get());
+ WebContents* web_contents =
+ browser_->tab_strip_model()->GetActiveWebContents();
// GetSelectedTabContents can return NULL for example under Purify when
// the animations are running slowly and this function is called on
// a timer through LoadingAnimationCallback.
@@ -1111,17 +1112,17 @@ void BrowserWindowGtk::ShowCreateChromeAppShortcutsDialog(
void BrowserWindowGtk::Cut() {
gtk_window_util::DoCut(
- window_, chrome::GetActiveWebContents(browser_.get()));
+ window_, browser_->tab_strip_model()->GetActiveWebContents());
}
void BrowserWindowGtk::Copy() {
gtk_window_util::DoCopy(
- window_, chrome::GetActiveWebContents(browser_.get()));
+ window_, browser_->tab_strip_model()->GetActiveWebContents());
}
void BrowserWindowGtk::Paste() {
gtk_window_util::DoPaste(
- window_, chrome::GetActiveWebContents(browser_.get()));
+ window_, browser_->tab_strip_model()->GetActiveWebContents());
}
gfx::Rect BrowserWindowGtk::GetInstantBounds() {
@@ -1157,7 +1158,8 @@ void BrowserWindowGtk::ShowPasswordGenerationBubble(
const gfx::Rect& rect,
const content::PasswordForm& form,
autofill::PasswordGenerator* password_generator) {
- WebContents* web_contents = chrome::GetActiveWebContents(browser_.get());
+ WebContents* web_contents =
+ browser_->tab_strip_model()->GetActiveWebContents();
if (!web_contents || !web_contents->GetContentNativeView()) {
return;
}
@@ -1180,8 +1182,8 @@ void BrowserWindowGtk::Observe(int type,
void BrowserWindowGtk::TabDetachedAt(WebContents* contents, int index) {
// We use index here rather than comparing |contents| because by this time
// the model has already removed |contents| from its list, so
- // chrome::GetActiveWebContents(browser_.get()) will return NULL or something
- // else.
+ // browser_->tab_strip_model()->GetActiveWebContents() will return NULL or
+ // something else.
if (index == browser_->tab_strip_model()->active_index()) {
infobar_container_->ChangeInfoBarService(NULL);
UpdateDevToolsForContents(NULL);
@@ -1979,7 +1981,8 @@ gboolean BrowserWindowGtk::OnKeyPress(GtkWidget* widget, GdkEventKey* event) {
// If a widget besides the native view is focused, we have to try to handle
// the custom accelerators before letting it handle them.
- WebContents* current_web_contents = chrome::GetActiveWebContents(browser());
+ WebContents* current_web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
// The current tab might not have a render view if it crashed.
if (!current_web_contents || !current_web_contents->GetContentNativeView() ||
!gtk_widget_is_focus(current_web_contents->GetContentNativeView())) {
View
16 ui/omnibox/omnibox_view_browsertest.cc
@@ -22,7 +22,6 @@
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/omnibox/location_bar.h"
#include "chrome/browser/ui/omnibox/omnibox_popup_model.h"
@@ -590,9 +589,10 @@ class OmniboxViewTest : public InProcessBrowserTest,
ASSERT_TRUE(SendKeyAndWait(browser(), ui::VKEY_RETURN, ui::EF_CONTROL_DOWN,
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::Source<content::NavigationController>(
- &chrome::GetActiveWebContents(browser())->GetController())));
+ &browser()->tab_strip_model()->GetActiveWebContents()->
+ GetController())));
- GURL url = chrome::GetActiveWebContents(browser())->GetURL();
+ GURL url = browser()->tab_strip_model()->GetActiveWebContents()->GetURL();
EXPECT_STREQ(kDesiredTLDHostname, url.host().c_str());
}
@@ -626,8 +626,9 @@ class OmniboxViewTest : public InProcessBrowserTest,
ASSERT_TRUE(SendKeyAndWait(browser(), ui::VKEY_RETURN, 0,
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::Source<content::NavigationController>(
- &chrome::GetActiveWebContents(browser())->GetController())));
- GURL url = chrome::GetActiveWebContents(browser())->GetURL();
+ &browser()->tab_strip_model()->GetActiveWebContents()->
+ GetController())));
+ GURL url = browser()->tab_strip_model()->GetActiveWebContents()->GetURL();
EXPECT_STREQ(kSearchTextURL, url.spec().c_str());
// Test that entering a single character then Enter performs a search.
@@ -646,8 +647,9 @@ class OmniboxViewTest : public InProcessBrowserTest,
ASSERT_TRUE(SendKeyAndWait(browser(), ui::VKEY_RETURN, 0,
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::Source<content::NavigationController>(
- &chrome::GetActiveWebContents(browser())->GetController())));
- url = chrome::GetActiveWebContents(browser())->GetURL();
+ &browser()->tab_strip_model()->GetActiveWebContents()->
+ GetController())));
+ url = browser()->tab_strip_model()->GetActiveWebContents()->GetURL();
EXPECT_STREQ(kSearchSingleCharURL, url.spec().c_str());
}
View
4 ui/toolbar/wrench_menu_model_unittest.cc
@@ -6,10 +6,10 @@
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/global_error/global_error.h"
#include "chrome/browser/ui/global_error/global_error_service.h"
#include "chrome/browser/ui/global_error/global_error_service_factory.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/base/menu_model_test.h"
#include "chrome/test/base/testing_profile.h"
@@ -201,6 +201,6 @@ class EncodingMenuModelTest : public BrowserWithTestWindowTest,
TEST_F(EncodingMenuModelTest, IsCommandIdCheckedWithNoTabs) {
EncodingMenuModel model(browser());
- ASSERT_EQ(NULL, chrome::GetActiveWebContents(browser()));
+ ASSERT_EQ(NULL, browser()->tab_strip_model()->GetActiveWebContents());
EXPECT_FALSE(model.IsCommandIdChecked(IDC_ENCODING_ISO88591));
}
View
6 ui/views/bookmarks/bookmark_context_menu_controller_views_win.cc
@@ -10,9 +10,9 @@
#include "chrome/browser/ui/bookmarks/bookmark_utils.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/host_desktop.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "content/public/browser/page_navigator.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
@@ -128,11 +128,11 @@ void BookmarkContextMenuControllerViewsWin::ExecuteCommand(int id) {
false,
chrome::HOST_DESKTOP_TYPE_NATIVE);
content::PageNavigator* navigator = NULL;
- if (!browser || !chrome::GetActiveWebContents(browser)) {
+ if (!browser || !browser->tab_strip_model()->GetActiveWebContents()) {
navigator = &navigator_impl;
} else {
browser->window()->Activate();
- navigator = chrome::GetActiveWebContents(browser);
+ navigator = browser->tab_strip_model()->GetActiveWebContents();
}
chrome::OpenAll(parent_widget()->GetNativeWindow(), navigator,
View
8 ui/webui/constrained_web_dialog_ui_browsertest.cc
@@ -7,7 +7,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/web_contents_modal_dialog_manager.h"
#include "chrome/browser/ui/webui/constrained_web_dialog_ui.h"
#include "chrome/common/url_constants.h"
@@ -60,7 +60,8 @@ IN_PROC_BROWSER_TEST_F(ConstrainedWebDialogBrowserTest, BasicTest) {
// The delegate deletes itself.
WebDialogDelegate* delegate = new ui::test::TestWebDialogDelegate(
GURL(chrome::kChromeUIConstrainedHTMLTestURL));
- WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(web_contents);
ConstrainedWebDialogDelegate* dialog_delegate =
@@ -79,7 +80,8 @@ IN_PROC_BROWSER_TEST_F(ConstrainedWebDialogBrowserTest,
// The delegate deletes itself.
WebDialogDelegate* delegate = new ui::test::TestWebDialogDelegate(
GURL(chrome::kChromeUIConstrainedHTMLTestURL));
- WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(web_contents);
ConstrainedWebDialogDelegate* dialog_delegate =
View
5 ui/webui/inspect_ui_browsertest.cc
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -41,7 +41,8 @@ IN_PROC_BROWSER_TEST_F(InspectUITest, DISABLED_SharedWorkersList) {
NEW_FOREGROUND_TAB,
ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
- WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(web_contents != NULL);
std::string result;
View
7 ui/webui/options/options_ui_browsertest.cc
@@ -7,7 +7,7 @@
#include "base/string16.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/web_contents.h"
@@ -28,7 +28,7 @@ void OptionsBrowserTest::NavigateToSettings() {
void OptionsBrowserTest::VerifyNavbar() {
bool navbar_exist = false;
EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
"domAutomationController.send("
" !!document.getElementById('navigation'))",
&navbar_exist));
@@ -36,7 +36,8 @@ void OptionsBrowserTest::VerifyNavbar() {
}
void OptionsBrowserTest::VerifyTitle() {
- string16 title = chrome::GetActiveWebContents(browser())->GetTitle();
+ string16 title =
+ browser()->tab_strip_model()->GetActiveWebContents()->GetTitle();
string16 expected_title = l10n_util::GetStringUTF16(IDS_SETTINGS_TITLE);
EXPECT_NE(title.find(expected_title), string16::npos);
}
View
5 ui/webui/options/preferences_browsertest.cc
@@ -17,7 +17,7 @@
#include "chrome/browser/policy/policy_map.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -74,7 +74,8 @@ PreferencesBrowserTest::~PreferencesBrowserTest() {
void PreferencesBrowserTest::SetUpOnMainThread() {
ui_test_utils::NavigateToURL(browser(),
GURL(chrome::kChromeUISettingsFrameURL));
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(web_contents);
render_view_host_ = web_contents->GetRenderViewHost();
ASSERT_TRUE(render_view_host_);
Please sign in to comment.
Something went wrong with that request. Please try again.