summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/app_controller_mac_browsertest.mm5
-rw-r--r--chrome/browser/chrome_to_mobile_service.cc16
-rw-r--r--chrome/browser/download/save_page_browsertest.cc5
-rw-r--r--chrome/browser/extensions/api/tabs/tabs_api.cc2
-rw-r--r--chrome/browser/extensions/extension_context_menu_browsertest.cc5
-rw-r--r--chrome/browser/extensions/extension_context_menu_model.cc5
-rw-r--r--chrome/browser/extensions/extension_install_ui_default.cc3
-rw-r--r--chrome/browser/extensions/extension_process_manager.cc5
-rw-r--r--chrome/browser/extensions/extension_tab_util.cc3
-rw-r--r--chrome/browser/extensions/subscribe_page_action_browsertest.cc4
-rw-r--r--chrome/browser/extensions/theme_installed_infobar_delegate.cc5
-rw-r--r--chrome/browser/external_extension_browsertest.cc5
-rw-r--r--chrome/browser/first_run/first_run.cc5
-rw-r--r--chrome/browser/geolocation/geolocation_browsertest.cc35
-rw-r--r--chrome/browser/performance_monitor/performance_monitor_browsertest.cc4
-rw-r--r--chrome/browser/policy/policy_browsertest.cc35
-rw-r--r--chrome/browser/policy/policy_prefs_browsertest.cc7
-rw-r--r--chrome/browser/prerender/prerender_browsertest.cc73
-rw-r--r--chrome/browser/printing/printing_layout_browsertest.cc4
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc5
-rw-r--r--chrome/browser/speech/speech_recognition_bubble_browsertest.cc14
-rw-r--r--chrome/browser/ui/ash/user_action_handler.cc4
-rw-r--r--chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc7
-rw-r--r--chrome/browser/ui/bookmarks/bookmark_prompt_controller.cc6
-rw-r--r--chrome/browser/ui/browser_command_controller.cc4
-rw-r--r--chrome/browser/ui/browser_toolbar_model_delegate.cc4
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm7
-rw-r--r--chrome/browser/ui/cocoa/browser_window_cocoa.mm7
-rw-r--r--chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm5
-rw-r--r--chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm5
-rw-r--r--chrome/browser/ui/cocoa/keystone_infobar_delegate.mm6
-rw-r--r--chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm6
-rw-r--r--chrome/browser/ui/extensions/application_launch.cc5
-rw-r--r--chrome/browser/ui/fullscreen/fullscreen_controller.cc10
-rw-r--r--chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc5
-rw-r--r--chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc5
-rw-r--r--chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc5
-rw-r--r--chrome/browser/ui/startup/autolaunch_prompt_win.cc6
-rw-r--r--chrome/browser/ui/startup/bad_flags_prompt.cc5
-rw-r--r--chrome/browser/ui/startup/default_browser_prompt.cc5
-rw-r--r--chrome/browser/ui/startup/startup_browser_creator_impl.cc4
-rw-r--r--chrome/browser/ui/toolbar/action_box_button_controller.cc5
-rw-r--r--chrome/browser/ui/toolbar/action_box_menu_model.cc4
-rw-r--r--chrome/browser/ui/toolbar/back_forward_menu_model.cc4
-rw-r--r--chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc5
-rw-r--r--chrome/browser/ui/toolbar/wrench_menu_model.cc14
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc8
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc7
-rw-r--r--chrome/browser/ui/views/browser_actions_container.cc8
-rw-r--r--chrome/browser/ui/views/frame/browser_frame_win.cc4
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc12
-rw-r--r--chrome/browser/ui/views/location_bar/location_bar_view.cc4
-rw-r--r--chrome/browser/ui/views/tab_contents/render_view_context_menu_win.cc5
-rw-r--r--chrome/browser/ui/webui/ntp/app_launcher_handler.cc2
-rw-r--r--chrome/browser/ui/webui/set_as_default_browser_ui.cc4
-rw-r--r--chrome/test/base/in_process_browser_test.cc3
-rw-r--r--chrome/test/gpu/gpu_pixel_browsertest.cc9
57 files changed, 261 insertions, 193 deletions
diff --git a/chrome/browser/app_controller_mac_browsertest.mm b/chrome/browser/app_controller_mac_browsertest.mm
index b9effff..ff34278 100644
--- a/chrome/browser/app_controller_mac_browsertest.mm
+++ b/chrome/browser/app_controller_mac_browsertest.mm
@@ -10,7 +10,7 @@
#import "chrome/browser/app_controller_mac.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#import "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -66,7 +66,8 @@ IN_PROC_BROWSER_TEST_F(AppControllerWebAppBrowserTest,
EXPECT_EQ(2u, BrowserList::size());
Browser* browser = *(BrowserList::begin());
- GURL current_url = chrome::GetActiveWebContents(browser)->GetURL();
+ GURL current_url =
+ browser->tab_strip_model()->GetActiveWebContents()->GetURL();
EXPECT_EQ(GetAppURL(), current_url.spec());
}
diff --git a/chrome/browser/chrome_to_mobile_service.cc b/chrome/browser/chrome_to_mobile_service.cc
index 5ccbd8e..edb7863 100644
--- a/chrome/browser/chrome_to_mobile_service.cc
+++ b/chrome/browser/chrome_to_mobile_service.cc
@@ -25,7 +25,7 @@
#include "chrome/browser/ui/browser_command_controller.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_navigator.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/chrome_switches.h"
#include "chrome/common/cloud_print/cloud_print_constants.h"
@@ -238,8 +238,10 @@ bool ChromeToMobileService::UpdateAndGetCommandState(Browser* browser) {
const ChromeToMobileService* service =
ChromeToMobileServiceFactory::GetForProfile(browser->profile());
DCHECK(!browser->profile()->IsOffTheRecord() || !service);
- enabled = service && service->HasMobiles() &&
- CanSendURL(chrome::GetActiveWebContents(browser)->GetURL());
+ enabled =
+ service && service->HasMobiles() &&
+ CanSendURL(
+ browser->tab_strip_model()->GetActiveWebContents()->GetURL());
}
browser->command_controller()->command_updater()->
UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled);
@@ -327,7 +329,8 @@ void ChromeToMobileService::SendToMobile(const base::DictionaryValue* mobile,
data->mobile_os = (mobile_os.compare(kTypeAndroid) == 0) ? ANDROID : IOS;
if (!mobile->GetString("id", &data->mobile_id))
NOTREACHED();
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser);
+ content::WebContents* web_contents =
+ browser->tab_strip_model()->GetActiveWebContents();
DCHECK(CanSendURL(web_contents->GetURL()));
data->url = web_contents->GetURL();
data->title = web_contents->GetTitle();
@@ -498,8 +501,9 @@ void ChromeToMobileService::SnapshotFileCreated(
// Generate the snapshot and callback SnapshotGenerated, or signal failure.
Browser* browser = chrome::FindBrowserWithID(browser_id);
- if (!path.empty() && browser && chrome::GetActiveWebContents(browser)) {
- chrome::GetActiveWebContents(browser)->GenerateMHTML(path,
+ if (!path.empty() && browser &&
+ browser->tab_strip_model()->GetActiveWebContents()) {
+ browser->tab_strip_model()->GetActiveWebContents()->GenerateMHTML(path,
base::Bind(&ChromeToMobileService::SnapshotGenerated,
weak_ptr_factory_.GetWeakPtr(), observer));
} else {
diff --git a/chrome/browser/download/save_page_browsertest.cc b/chrome/browser/download/save_page_browsertest.cc
index 43c8781..77bc6ae 100644
--- a/chrome/browser/download/save_page_browsertest.cc
+++ b/chrome/browser/download/save_page_browsertest.cc
@@ -23,8 +23,8 @@
#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/tabs/tab_strip_model.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@@ -309,7 +309,8 @@ class SavePageBrowserTest : public InProcessBrowserTest {
}
WebContents* GetCurrentTab(Browser* browser) const {
- WebContents* current_tab = chrome::GetActiveWebContents(browser);
+ WebContents* current_tab =
+ browser->tab_strip_model()->GetActiveWebContents();
EXPECT_TRUE(current_tab);
return current_tab;
}
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc
index e7e92f7..da60264 100644
--- a/chrome/browser/extensions/api/tabs/tabs_api.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -1642,7 +1642,7 @@ bool TabsCaptureVisibleTabFunction::GetTabToCapture(
if (!GetBrowserFromWindowID(this, window_id, &browser))
return false;
- *web_contents = chrome::GetActiveWebContents(browser);
+ *web_contents = browser->tab_strip_model()->GetActiveWebContents();
if (*web_contents == NULL) {
error_ = keys::kInternalVisibleTabCaptureError;
return false;
diff --git a/chrome/browser/extensions/extension_context_menu_browsertest.cc b/chrome/browser/extensions/extension_context_menu_browsertest.cc
index d6586c6..4fd7451 100644
--- a/chrome/browser/extensions/extension_context_menu_browsertest.cc
+++ b/chrome/browser/extensions/extension_context_menu_browsertest.cc
@@ -13,7 +13,7 @@
#include "chrome/browser/profiles/profile.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/common/chrome_switches.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/common/context_menu_params.h"
@@ -104,7 +104,8 @@ class ExtensionContextMenuBrowserTest : public ExtensionBrowserTest {
const GURL& page_url,
const GURL& link_url,
const GURL& frame_url) {
- WebContents* web_contents = chrome::GetActiveWebContents(browser);
+ WebContents* web_contents =
+ browser->tab_strip_model()->GetActiveWebContents();
WebContextMenuData data;
content::ContextMenuParams params(data);
params.page_url = page_url;
diff --git a/chrome/browser/extensions/extension_context_menu_model.cc b/chrome/browser/extensions/extension_context_menu_model.cc
index cc33dce..35a6adf 100644
--- a/chrome/browser/extensions/extension_context_menu_model.cc
+++ b/chrome/browser/extensions/extension_context_menu_model.cc
@@ -14,8 +14,8 @@
#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/chrome_pages.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/manifest_url_handler.h"
@@ -77,7 +77,8 @@ bool ExtensionContextMenuModel::IsCommandIdEnabled(int command_id) const {
// homepage, we just disable this menu item.
return extensions::ManifestURL::GetHomepageURL(extension).is_valid();
} else if (command_id == INSPECT_POPUP) {
- WebContents* web_contents = chrome::GetActiveWebContents(browser_);
+ WebContents* web_contents =
+ browser_->tab_strip_model()->GetActiveWebContents();
if (!web_contents)
return false;
diff --git a/chrome/browser/extensions/extension_install_ui_default.cc b/chrome/browser/extensions/extension_install_ui_default.cc
index 3afd450..5db7b23 100644
--- a/chrome/browser/extensions/extension_install_ui_default.cc
+++ b/chrome/browser/extensions/extension_install_ui_default.cc
@@ -205,7 +205,8 @@ void ExtensionInstallUIDefault::OnInstallFailure(
Browser* browser = chrome::FindLastActiveWithProfile(profile_,
chrome::GetActiveDesktop());
- WebContents* web_contents = chrome::GetActiveWebContents(browser);
+ WebContents* web_contents =
+ browser->tab_strip_model()->GetActiveWebContents();
if (!web_contents)
return;
ErrorInfobarDelegate::Create(InfoBarService::FromWebContents(web_contents),
diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc
index 8ef6ec1..0163e79 100644
--- a/chrome/browser/extensions/extension_process_manager.cc
+++ b/chrome/browser/extensions/extension_process_manager.cc
@@ -20,8 +20,8 @@
#include "chrome/browser/profiles/profile.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/tabs/tab_strip_model.h"
#include "chrome/browser/view_type_utils.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
@@ -326,7 +326,8 @@ void ExtensionProcessManager::OpenOptionsPage(const Extension* extension,
content::PAGE_TRANSITION_LINK, false);
browser->OpenURL(params);
browser->window()->Show();
- WebContents* web_contents = chrome::GetActiveWebContents(browser);
+ WebContents* web_contents =
+ browser->tab_strip_model()->GetActiveWebContents();
web_contents->GetDelegate()->ActivateContents(web_contents);
}
diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc
index 5d475b0..44cc21a 100644
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -13,7 +13,6 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_list.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -167,7 +166,7 @@ bool ExtensionTabUtil::GetDefaultTab(Browser* browser,
DCHECK(browser);
DCHECK(contents);
- *contents = chrome::GetActiveWebContents(browser);
+ *contents = browser->tab_strip_model()->GetActiveWebContents();
if (*contents) {
if (tab_id)
*tab_id = GetTabId(*contents);
diff --git a/chrome/browser/extensions/subscribe_page_action_browsertest.cc b/chrome/browser/extensions/subscribe_page_action_browsertest.cc
index 2c21944..471ad5c 100644
--- a/chrome/browser/extensions/subscribe_page_action_browsertest.cc
+++ b/chrome/browser/extensions/subscribe_page_action_browsertest.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/extensions/extension_browsertest.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/extensions/extension.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -113,7 +113,7 @@ void NavigateToFeedAndValidate(net::TestServer* server,
ui_test_utils::NavigateToURL(browser,
GetFeedUrl(server, url, true, extension_id));
- WebContents* tab = chrome::GetActiveWebContents(browser);
+ WebContents* tab = browser->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(ValidatePageElement(tab,
"",
kScriptFeedTitle,
diff --git a/chrome/browser/extensions/theme_installed_infobar_delegate.cc b/chrome/browser/extensions/theme_installed_infobar_delegate.cc
index 81bbc39..b2f571e 100644
--- a/chrome/browser/extensions/theme_installed_infobar_delegate.cc
+++ b/chrome/browser/extensions/theme_installed_infobar_delegate.cc
@@ -13,7 +13,7 @@
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/browser_finder.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/extensions/extension.h"
#include "content/public/browser/notification_source.h"
@@ -39,7 +39,8 @@ void ThemeInstalledInfoBarDelegate::Create(
if (!browser)
return;
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser);
+ content::WebContents* web_contents =
+ browser->tab_strip_model()->GetActiveWebContents();
if (!web_contents)
return;
InfoBarService* infobar_service =
diff --git a/chrome/browser/external_extension_browsertest.cc b/chrome/browser/external_extension_browsertest.cc
index c57b42f..65dd884 100644
--- a/chrome/browser/external_extension_browsertest.cc
+++ b/chrome/browser/external_extension_browsertest.cc
@@ -6,7 +6,7 @@
#include "base/string_util.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/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -61,7 +61,8 @@ class SearchProviderTest : public InProcessBrowserTest {
ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB);
// Bundle up information needed to verify the result.
- content::WebContents* tab = chrome::GetActiveWebContents(browser);
+ content::WebContents* tab =
+ browser->tab_strip_model()->GetActiveWebContents();
return IsSearchProviderTestData(tab, host, test_url);
}
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc
index b840908..6b85a8b 100644
--- a/chrome/browser/first_run/first_run.cc
+++ b/chrome/browser/first_run/first_run.cc
@@ -32,9 +32,9 @@
#include "chrome/browser/shell_integration.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/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/browser/ui/webui/ntp/new_tab_ui.h"
#include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h"
#include "chrome/common/chrome_notification_types.h"
@@ -506,7 +506,8 @@ void FirstRunBubbleLauncher::Observe(
return;
}
- content::WebContents* contents = chrome::GetActiveWebContents(browser);
+ content::WebContents* contents =
+ browser->tab_strip_model()->GetActiveWebContents();
// Suppress the first run bubble if a Gaia sign in page is showing.
if (SyncPromoUI::UseWebBasedSigninFlow() &&
diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc
index 5915802..d3964f7 100644
--- a/chrome/browser/geolocation/geolocation_browsertest.cc
+++ b/chrome/browser/geolocation/geolocation_browsertest.cc
@@ -17,7 +17,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/chrome_notification_types.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/content_settings_pattern.h"
@@ -49,7 +49,7 @@ class IFrameLoader : public content::NotificationObserver {
: navigation_completed_(false),
javascript_completed_(false) {
NavigationController* controller =
- &chrome::GetActiveWebContents(browser)->GetController();
+ &browser->tab_strip_model()->GetActiveWebContents()->GetController();
registrar_.Add(this, content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(controller));
registrar_.Add(this, content::NOTIFICATION_DOM_OPERATION_RESPONSE,
@@ -59,7 +59,7 @@ class IFrameLoader : public content::NotificationObserver {
"window.domAutomationController.send(addIFrame(%d, \"%s\"));",
iframe_id,
url.spec().c_str());
- chrome::GetActiveWebContents(browser)->GetRenderViewHost()->
+ browser->tab_strip_model()->GetActiveWebContents()->GetRenderViewHost()->
ExecuteJavascriptInWebFrame(string16(), UTF8ToUTF16(script));
content::RunMessageLoop();
@@ -70,7 +70,7 @@ class IFrameLoader : public content::NotificationObserver {
"window.domAutomationController.send(getIFrameSrc(%d))", iframe_id);
std::string iframe_src;
EXPECT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(browser),
+ browser->tab_strip_model()->GetActiveWebContents(),
script,
&iframe_src));
iframe_url_ = GURL(iframe_src);
@@ -272,7 +272,8 @@ class GeolocationBrowserTest : public InProcessBrowserTest {
void AddGeolocationWatch(bool wait_for_infobar) {
GeolocationNotificationObserver notification_observer(wait_for_infobar);
notification_observer.AddWatchAndWaitForNotification(
- chrome::GetActiveWebContents(current_browser_)->GetRenderViewHost(),
+ current_browser_->tab_strip_model()->GetActiveWebContents()->
+ GetRenderViewHost(),
iframe_xpath_);
if (wait_for_infobar) {
EXPECT_TRUE(notification_observer.infobar_);
@@ -290,7 +291,8 @@ class GeolocationBrowserTest : public InProcessBrowserTest {
}
void SetInfobarResponse(const GURL& requesting_url, bool allowed) {
- WebContents* web_contents = chrome::GetActiveWebContents(current_browser_);
+ WebContents* web_contents =
+ current_browser_->tab_strip_model()->GetActiveWebContents();
TabSpecificContentSettings* content_settings =
TabSpecificContentSettings::FromWebContents(web_contents);
const GeolocationSettingsState& settings_state =
@@ -339,7 +341,8 @@ class GeolocationBrowserTest : public InProcessBrowserTest {
void CheckStringValueFromJavascript(
const std::string& expected, const std::string& function) {
CheckStringValueFromJavascriptForTab(
- expected, function, chrome::GetActiveWebContents(current_browser_));
+ expected, function,
+ current_browser_->tab_strip_model()->GetActiveWebContents());
}
void NotifyGeoposition(double latitude, double longitude) {
@@ -485,7 +488,8 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest,
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(
- &chrome::GetActiveWebContents(current_browser_)->GetController()));
+ &current_browser_->tab_strip_model()->GetActiveWebContents()->
+ GetController()));
NotifyGeoposition(fresh_position_latitude, fresh_position_longitude);
observer.Wait();
CheckGeoposition(fresh_position_latitude, fresh_position_longitude);
@@ -520,7 +524,8 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest,
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(
- &chrome::GetActiveWebContents(current_browser_)->GetController()));
+ &current_browser_->tab_strip_model()->GetActiveWebContents()->
+ GetController()));
NotifyGeoposition(cached_position_latitude, cached_position_lognitude);
observer.Wait();
CheckGeoposition(cached_position_latitude, cached_position_lognitude);
@@ -558,7 +563,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, CancelPermissionForFrame) {
AddGeolocationWatch(true);
InfoBarService* infobar_service = InfoBarService::FromWebContents(
- chrome::GetActiveWebContents(current_browser_));
+ current_browser_->tab_strip_model()->GetActiveWebContents());
size_t num_infobars_before_cancel = infobar_service->GetInfoBarCount();
// Change the iframe, and ensure the infobar is gone.
IFrameLoader change_iframe_1(current_browser_, 1, current_url_);
@@ -571,7 +576,8 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, InvalidUrlRequest) {
// correctly. Also acts as a regression test for http://crbug.com/40478
html_for_tests_ = "files/geolocation/invalid_request_url.html";
ASSERT_TRUE(Initialize(INITIALIZATION_NONE));
- WebContents* original_tab = chrome::GetActiveWebContents(current_browser_);
+ WebContents* original_tab =
+ current_browser_->tab_strip_model()->GetActiveWebContents();
CheckStringValueFromJavascript("1", "requestGeolocationFromInvalidUrl()");
CheckStringValueFromJavascriptForTab("1", "isAlive()", original_tab);
}
@@ -611,7 +617,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, TwoWatchesInOneFrame) {
final_position_latitude, final_position_longitude);
std::string js_result;
EXPECT_TRUE(content::ExecuteScriptAndExtractString(
- chrome::GetActiveWebContents(current_browser_),
+ current_browser_->tab_strip_model()->GetActiveWebContents(),
script,
&js_result));
EXPECT_EQ(js_result, "ok");
@@ -626,7 +632,8 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, TwoWatchesInOneFrame) {
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(
- &chrome::GetActiveWebContents(current_browser_)->GetController()));
+ &current_browser_->tab_strip_model()->GetActiveWebContents()->
+ GetController()));
NotifyGeoposition(final_position_latitude, final_position_longitude);
observer.Wait();
CheckGeoposition(final_position_latitude, final_position_longitude);
@@ -650,7 +657,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, TabDestroyed) {
"window.domAutomationController.send(window.close());";
bool result =
content::ExecuteScript(
- chrome::GetActiveWebContents(current_browser_),
+ current_browser_->tab_strip_model()->GetActiveWebContents(),
script);
EXPECT_EQ(result, true);
}
diff --git a/chrome/browser/performance_monitor/performance_monitor_browsertest.cc b/chrome/browser/performance_monitor/performance_monitor_browsertest.cc
index d54f5b5..2e00715 100644
--- a/chrome/browser/performance_monitor/performance_monitor_browsertest.cc
+++ b/chrome/browser/performance_monitor/performance_monitor_browsertest.cc
@@ -24,8 +24,8 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_navigator.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_constants.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_paths.h"
@@ -603,7 +603,7 @@ IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest,
// base::GetTerminationStatus(), so there's not much we can do.
IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest,
DISABLED_RendererKilledEvent) {
- content::CrashTab(chrome::GetActiveWebContents(browser()));
+ content::CrashTab(browser()->tab_strip_model()->GetActiveWebContents());
Database::EventVector events = GetEvents();
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index 5d8cdba..1cc1fb2 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -215,7 +215,8 @@ class MakeRequestFail {
void CheckCanOpenURL(Browser* browser, const char* spec) {
GURL url(spec);
ui_test_utils::NavigateToURL(browser, url);
- content::WebContents* contents = chrome::GetActiveWebContents(browser);
+ content::WebContents* contents =
+ browser->tab_strip_model()->GetActiveWebContents();
EXPECT_EQ(url, contents->GetURL());
EXPECT_EQ(net::FormatUrl(url, std::string()), contents->GetTitle());
}
@@ -224,7 +225,8 @@ void CheckCanOpenURL(Browser* browser, const char* spec) {
void CheckURLIsBlocked(Browser* browser, const char* spec) {
GURL url(spec);
ui_test_utils::NavigateToURL(browser, url);
- content::WebContents* contents = chrome::GetActiveWebContents(browser);
+ content::WebContents* contents =
+ browser->tab_strip_model()->GetActiveWebContents();
EXPECT_EQ(url, contents->GetURL());
string16 title = UTF8ToUTF16(url.spec() + " is not available");
EXPECT_EQ(title, contents->GetTitle());
@@ -707,7 +709,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DefaultSearchProvider) {
ui_test_utils::SendToOmniboxAndSubmit(location_bar, "stuff to search for");
OmniboxEditModel* model = location_bar->GetLocationEntry()->model();
EXPECT_TRUE(model->CurrentMatch().destination_url.is_valid());
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
GURL expected("http://search.example/search?q=stuff+to+search+for");
EXPECT_EQ(expected, web_contents->GetURL());
@@ -744,7 +747,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, ForceSafeSearch) {
OmniboxEditModel* model = location_bar->GetLocationEntry()->model();
no_safesearch_observer.Wait();
EXPECT_TRUE(model->CurrentMatch().destination_url.is_valid());
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
GURL expected_without("http://google.com/");
EXPECT_EQ(expected_without, web_contents->GetURL());
@@ -771,7 +775,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, ForceSafeSearch) {
safesearch_observer.Wait();
model = location_bar->GetLocationEntry()->model();
EXPECT_TRUE(model->CurrentMatch().destination_url.is_valid());
- web_contents = chrome::GetActiveWebContents(browser());
+ web_contents = browser()->tab_strip_model()->GetActiveWebContents();
std::string expected_url("http://google.com/?");
expected_url += std::string(chrome::kSafeSearchSafeParameter) + "&" +
chrome::kSafeSearchSsuiParameter;
@@ -883,7 +887,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, ReplaceSearchTerms) {
IN_PROC_BROWSER_TEST_F(PolicyTest, Disable3DAPIs) {
ui_test_utils::NavigateToURL(browser(), GURL(chrome::kAboutBlankURL));
// WebGL is enabled by default.
- content::WebContents* contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
EXPECT_TRUE(IsWebGLEnabled(contents));
// Disable with a policy.
PolicyMap policies;
@@ -1042,7 +1047,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, AlwaysAuthorizePlugins) {
// No plugins at startup.
EXPECT_EQ(0, CountPlugins());
- content::WebContents* contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(contents);
InfoBarService* infobar_service = InfoBarService::FromWebContents(contents);
ASSERT_TRUE(infobar_service);
@@ -1076,7 +1082,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DeveloperToolsDisabled) {
// Open devtools.
EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_DEV_TOOLS));
- content::WebContents* contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
EXPECT_TRUE(DevToolsWindow::GetDockedInstanceForInspectedTab(contents));
// Disable devtools via policy.
@@ -1257,7 +1264,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, HomepageLocation) {
prefs::kHomePageIsNewTabPage, false);
EXPECT_EQ(GURL(chrome::kChromeUIPolicyURL),
browser()->profile()->GetHomePage());
- content::WebContents* contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
EXPECT_EQ(GURL(chrome::kAboutBlankURL), contents->GetURL());
EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME));
EXPECT_EQ(GURL(chrome::kChromeUIPolicyURL), contents->GetURL());
@@ -1306,7 +1314,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, IncognitoEnabled) {
IN_PROC_BROWSER_TEST_F(PolicyTest, Javascript) {
// Verifies that Javascript can be disabled.
- content::WebContents* contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
EXPECT_TRUE(IsJavascriptEnabled(contents));
EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_DEV_TOOLS));
EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_DEV_TOOLS_CONSOLE));
@@ -1366,7 +1375,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, TranslateEnabled) {
// Verifies that translate can be forced enabled or disabled by policy.
// Get the InfoBarService, and verify that there are no infobars on startup.
- content::WebContents* contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(contents);
InfoBarService* infobar_service = InfoBarService::FromWebContents(contents);
ASSERT_TRUE(infobar_service);
@@ -1731,7 +1741,8 @@ IN_PROC_BROWSER_TEST_F(PolicyStatisticsCollectorTest, Startup) {
std::string(content::kStandardSchemeSeparator) +
std::string(chrome::kChromeUIHistogramHost));
ui_test_utils::NavigateToURL(browser(), kAboutHistograms);
- content::WebContents* contents = chrome::GetActiveWebContents(browser());
+ content::WebContents* contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
std::string text;
ASSERT_TRUE(content::ExecuteScriptAndExtractString(
contents,
diff --git a/chrome/browser/policy/policy_prefs_browsertest.cc b/chrome/browser/policy/policy_prefs_browsertest.cc
index 700a5b7..c15c442 100644
--- a/chrome/browser/policy/policy_prefs_browsertest.cc
+++ b/chrome/browser/policy/policy_prefs_browsertest.cc
@@ -27,7 +27,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.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"
@@ -328,7 +328,8 @@ void VerifyControlledSettingIndicators(Browser* browser,
<< " indicators.push(indicator)"
<< "}"
<< "domAutomationController.send(JSON.stringify(indicators));";
- content::WebContents* contents = chrome::GetActiveWebContents(browser);
+ content::WebContents* contents =
+ browser->tab_strip_model()->GetActiveWebContents();
std::string json;
// Retrieve the state of all controlled setting indicators matching the
// |selector| as JSON.
@@ -499,7 +500,7 @@ IN_PROC_BROWSER_TEST_P(PolicyPrefsTest, CheckPolicyIndicators) {
ui_test_utils::NavigateToURL(browser(), GURL(kMainSettingsPage));
if (!(*pref_mapping)->indicator_test_setup_js().empty()) {
ASSERT_TRUE(content::ExecuteScript(
- chrome::GetActiveWebContents(browser()),
+ browser()->tab_strip_model()->GetActiveWebContents(),
(*pref_mapping)->indicator_test_setup_js()));
}
diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc
index 9c28791..10019ed 100644
--- a/chrome/browser/prerender/prerender_browsertest.cc
+++ b/chrome/browser/prerender/prerender_browsertest.cc
@@ -34,7 +34,6 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.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/tabs/tab_strip_model.h"
#include "chrome/common/chrome_notification_types.h"
@@ -747,8 +746,8 @@ class PrerenderBrowserTest : virtual public InProcessBrowserTest {
}
void RemoveLinkElement(int i) const {
- chrome::GetActiveWebContents(current_browser())->GetRenderViewHost()->
- ExecuteJavascriptInWebFrame(
+ current_browser()->tab_strip_model()->GetActiveWebContents()->
+ GetRenderViewHost()->ExecuteJavascriptInWebFrame(
string16(),
ASCIIToUTF16(base::StringPrintf("RemoveLinkElement(%d)", i)));
}
@@ -757,8 +756,8 @@ class PrerenderBrowserTest : virtual public InProcessBrowserTest {
content::WindowedNotificationObserver new_page_observer(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::NotificationService::AllSources());
- RenderViewHost* render_view_host =
- chrome::GetActiveWebContents(current_browser())->GetRenderViewHost();
+ RenderViewHost* render_view_host = current_browser()->tab_strip_model()->
+ GetActiveWebContents()->GetRenderViewHost();
render_view_host->ExecuteJavascriptInWebFrame(
string16(),
ASCIIToUTF16("ClickOpenLink()"));
@@ -790,7 +789,7 @@ class PrerenderBrowserTest : virtual public InProcessBrowserTest {
back_nav_observer.Wait();
bool original_prerender_page = false;
ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
- chrome::GetActiveWebContents(current_browser()),
+ current_browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(IsOriginalPrerenderPage())",
&original_prerender_page));
EXPECT_TRUE(original_prerender_page);
@@ -800,7 +799,8 @@ class PrerenderBrowserTest : virtual public InProcessBrowserTest {
// in. This must be called when the prerendered page is the current page
// in the active tab.
void GoBackToPageBeforePrerender() {
- WebContents* tab = chrome::GetActiveWebContents(current_browser());
+ WebContents* tab =
+ current_browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(tab);
EXPECT_FALSE(tab->IsLoading());
content::WindowedNotificationObserver back_nav_observer(
@@ -862,7 +862,7 @@ class PrerenderBrowserTest : virtual public InProcessBrowserTest {
"receivedPrerenderStartEvents[%d]))", index);
CHECK(content::ExecuteScriptAndExtractBool(
- chrome::GetActiveWebContents(current_browser()),
+ current_browser()->tab_strip_model()->GetActiveWebContents(),
expression,
&received_prerender_started));
return received_prerender_started;
@@ -875,7 +875,7 @@ class PrerenderBrowserTest : virtual public InProcessBrowserTest {
"receivedPrerenderLoadEvents[%d]))", index);
CHECK(content::ExecuteScriptAndExtractBool(
- chrome::GetActiveWebContents(current_browser()),
+ current_browser()->tab_strip_model()->GetActiveWebContents(),
expression,
&received_prerender_loaded));
return received_prerender_loaded;
@@ -888,7 +888,7 @@ class PrerenderBrowserTest : virtual public InProcessBrowserTest {
"receivedPrerenderStopEvents[%d]))", index);
CHECK(content::ExecuteScriptAndExtractBool(
- chrome::GetActiveWebContents(current_browser()),
+ current_browser()->tab_strip_model()->GetActiveWebContents(),
expression,
&received_prerender_stopped));
return received_prerender_stopped;
@@ -897,7 +897,7 @@ class PrerenderBrowserTest : virtual public InProcessBrowserTest {
bool HadPrerenderEventErrors() const {
bool had_prerender_event_errors;
CHECK(content::ExecuteScriptAndExtractBool(
- chrome::GetActiveWebContents(current_browser()),
+ current_browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(Boolean("
" hadPrerenderEventErrors))",
&had_prerender_event_errors));
@@ -1034,7 +1034,8 @@ class PrerenderBrowserTest : virtual public InProcessBrowserTest {
// We construct launch_nav_observer so that we can be certain our loader
// page has finished loading before continuing. This prevents ambiguous
// NOTIFICATION_LOAD_STOP events from making tests flaky.
- WebContents* web_contents = chrome::GetActiveWebContents(current_browser());
+ WebContents* web_contents =
+ current_browser()->tab_strip_model()->GetActiveWebContents();
content::WindowedNotificationObserver loader_nav_observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(
@@ -1140,8 +1141,8 @@ class PrerenderBrowserTest : virtual public InProcessBrowserTest {
TestPrerenderContents* prerender_contents = GetPrerenderContents();
ASSERT_NE(static_cast<PrerenderContents*>(NULL), prerender_contents);
- RenderViewHost* render_view_host =
- chrome::GetActiveWebContents(current_browser())->GetRenderViewHost();
+ RenderViewHost* render_view_host = current_browser()->tab_strip_model()->
+ GetActiveWebContents()->GetRenderViewHost();
render_view_host->ExecuteJavascriptInWebFrame(
string16(), ASCIIToUTF16(javascript_function_name));
@@ -1181,8 +1182,8 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderPage) {
PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1);
ChannelDestructionWatcher channel_close_watcher;
- channel_close_watcher.WatchChannel(
- chrome::GetActiveWebContents(browser())->GetRenderProcessHost());
+ channel_close_watcher.WatchChannel(browser()->tab_strip_model()->
+ GetActiveWebContents()->GetRenderProcessHost());
NavigateToDestURL();
channel_close_watcher.WaitForChannelClose();
@@ -1200,8 +1201,8 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, DISABLED_PrerenderPagePending) {
ChannelDestructionWatcher first_channel_close_watcher;
- first_channel_close_watcher.WatchChannel(
- chrome::GetActiveWebContents(browser())->GetRenderProcessHost());
+ first_channel_close_watcher.WatchChannel(browser()->tab_strip_model()->
+ GetActiveWebContents()->GetRenderProcessHost());
NavigateToDestURL();
// NavigateToDestURL doesn't run a message loop. Normally that's fine, but in
// this case, we need the pending prerenders to start.
@@ -1220,8 +1221,8 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, DISABLED_PrerenderPagePending) {
// Now navigate to our target page.
ChannelDestructionWatcher second_channel_close_watcher;
- second_channel_close_watcher.WatchChannel(
- chrome::GetActiveWebContents(browser())->GetRenderProcessHost());
+ second_channel_close_watcher.WatchChannel(browser()->tab_strip_model()->
+ GetActiveWebContents()->GetRenderProcessHost());
ui_test_utils::NavigateToURLWithDisposition(
current_browser(), prerender_page_url, CURRENT_TAB,
ui_test_utils::BROWSER_TEST_NONE);
@@ -1237,8 +1238,8 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderPageRemovesPending) {
FINAL_STATUS_USED, 1);
ChannelDestructionWatcher channel_close_watcher;
- channel_close_watcher.WatchChannel(
- chrome::GetActiveWebContents(browser())->GetRenderProcessHost());
+ channel_close_watcher.WatchChannel(browser()->tab_strip_model()->
+ GetActiveWebContents()->GetRenderProcessHost());
NavigateToDestURL();
channel_close_watcher.WaitForChannelClose();
@@ -1336,8 +1337,8 @@ IN_PROC_BROWSER_TEST_F(
EXPECT_FALSE(IsEmptyPrerenderLinkManager());
ChannelDestructionWatcher channel_close_watcher;
- channel_close_watcher.WatchChannel(
- chrome::GetActiveWebContents(browser())->GetRenderProcessHost());
+ channel_close_watcher.WatchChannel(browser()->tab_strip_model()->
+ GetActiveWebContents()->GetRenderProcessHost());
NavigateToDestURL();
channel_close_watcher.WaitForChannelClose();
@@ -1435,7 +1436,8 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderNaClPluginDisabled) {
// TODO(mmenke): While this should reliably fail on regressions, the
// reliability depends on the specifics of ppapi plugin
// loading. It would be great if we could avoid that.
- WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
bool display_test_result = false;
ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
web_contents,
@@ -1977,8 +1979,8 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
1);
ChannelDestructionWatcher channel_close_watcher;
- channel_close_watcher.WatchChannel(
- chrome::GetActiveWebContents(browser())->GetRenderProcessHost());
+ channel_close_watcher.WatchChannel(browser()->tab_strip_model()->
+ GetActiveWebContents()->GetRenderProcessHost());
NavigateToDestURL();
channel_close_watcher.WaitForChannelClose();
@@ -2388,7 +2390,8 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, DISABLED_PrerenderUnload) {
PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1);
string16 expected_title = ASCIIToUTF16("Unloaded");
content::TitleWatcher title_watcher(
- chrome::GetActiveWebContents(current_browser()), expected_title);
+ current_browser()->tab_strip_model()->GetActiveWebContents(),
+ expected_title);
NavigateToDestURL();
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
}
@@ -2543,7 +2546,8 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderClickNewBackgroundTab) {
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
NavigateToPrerenderedPageWhenDevToolsAttached) {
DisableJavascriptCalls();
- WebContents* web_contents = chrome::GetActiveWebContents(current_browser());
+ WebContents* web_contents =
+ current_browser()->tab_strip_model()->GetActiveWebContents();
scoped_refptr<DevToolsAgentHost> agent(DevToolsAgentHost::GetFor(
web_contents->GetRenderViewHost()));
DevToolsManager* manager = DevToolsManager::GetInstance();
@@ -2623,7 +2627,8 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTestWithNaCl,
// To avoid any chance of a race, we have to let the script send its response
// asynchronously.
- WebContents* web_contents = chrome::GetActiveWebContents(browser());
+ WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
bool display_test_result = false;
ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents,
"DidDisplayReallyPass()",
@@ -2695,8 +2700,8 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTestWithExtensions, WebNavigation) {
PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1);
ChannelDestructionWatcher channel_close_watcher;
- channel_close_watcher.WatchChannel(
- chrome::GetActiveWebContents(browser())->GetRenderProcessHost());
+ channel_close_watcher.WatchChannel(browser()->tab_strip_model()->
+ GetActiveWebContents()->GetRenderProcessHost());
NavigateToDestURL();
channel_close_watcher.WaitForChannelClose();
@@ -2717,8 +2722,8 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTestWithExtensions, TabsApi) {
PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1);
ChannelDestructionWatcher channel_close_watcher;
- channel_close_watcher.WatchChannel(
- chrome::GetActiveWebContents(browser())->GetRenderProcessHost());
+ channel_close_watcher.WatchChannel(browser()->tab_strip_model()->
+ GetActiveWebContents()->GetRenderProcessHost());
NavigateToDestURL();
channel_close_watcher.WaitForChannelClose();
diff --git a/chrome/browser/printing/printing_layout_browsertest.cc b/chrome/browser/printing/printing_layout_browsertest.cc
index 1c1bbea..df54494 100644
--- a/chrome/browser/printing/printing_layout_browsertest.cc
+++ b/chrome/browser/printing/printing_layout_browsertest.cc
@@ -16,7 +16,7 @@
#include "chrome/browser/printing/print_view_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/tabs/tab_strip_model.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_notification_types.h"
@@ -65,7 +65,7 @@ class PrintingLayoutTest : public PrintingTest<InProcessBrowserTest>,
content::NotificationService::AllSources());
content::WebContents* web_contents =
- chrome::GetActiveWebContents(browser());
+ browser()->tab_strip_model()->GetActiveWebContents();
printing::PrintViewManager::FromWebContents(web_contents)->PrintNow();
content::RunMessageLoop();
registrar_.RemoveAll();
diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
index 252a7d6..8fbd933 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
@@ -30,7 +30,7 @@
#include "chrome/browser/safe_browsing/safe_browsing_util.h"
#include "chrome/browser/safe_browsing/ui_manager.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/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -390,7 +390,8 @@ class SafeBrowsingServiceTest : public InProcessBrowserTest {
}
bool ShowingInterstitialPage() {
- WebContents* contents = chrome::GetActiveWebContents(browser());
+ WebContents* contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
InterstitialPage* interstitial_page = contents->GetInterstitialPage();
return interstitial_page != NULL;
}
diff --git a/chrome/browser/speech/speech_recognition_bubble_browsertest.cc b/chrome/browser/speech/speech_recognition_bubble_browsertest.cc
index c46478e..f211846 100644
--- a/chrome/browser/speech/speech_recognition_bubble_browsertest.cc
+++ b/chrome/browser/speech/speech_recognition_bubble_browsertest.cc
@@ -5,7 +5,7 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/speech/speech_recognition_bubble.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 "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/rect.h"
@@ -24,14 +24,16 @@ class SpeechRecognitionBubbleTest : public SpeechRecognitionBubbleDelegate,
IN_PROC_BROWSER_TEST_F(SpeechRecognitionBubbleTest, CreateAndDestroy) {
gfx::Rect element_rect(100, 100, 100, 100);
scoped_ptr<SpeechRecognitionBubble> bubble(SpeechRecognitionBubble::Create(
- chrome::GetActiveWebContents(browser()), this, element_rect));
+ browser()->tab_strip_model()->GetActiveWebContents(),
+ this, element_rect));
EXPECT_TRUE(bubble.get());
}
IN_PROC_BROWSER_TEST_F(SpeechRecognitionBubbleTest, ShowAndDestroy) {
gfx::Rect element_rect(100, 100, 100, 100);
scoped_ptr<SpeechRecognitionBubble> bubble(SpeechRecognitionBubble::Create(
- chrome::GetActiveWebContents(browser()), this, element_rect));
+ browser()->tab_strip_model()->GetActiveWebContents(),
+ this, element_rect));
EXPECT_TRUE(bubble.get());
bubble->Show();
}
@@ -39,7 +41,8 @@ IN_PROC_BROWSER_TEST_F(SpeechRecognitionBubbleTest, ShowAndDestroy) {
IN_PROC_BROWSER_TEST_F(SpeechRecognitionBubbleTest, ShowAndHide) {
gfx::Rect element_rect(100, 100, 100, 100);
scoped_ptr<SpeechRecognitionBubble> bubble(SpeechRecognitionBubble::Create(
- chrome::GetActiveWebContents(browser()), this, element_rect));
+ browser()->tab_strip_model()->GetActiveWebContents(),
+ this, element_rect));
EXPECT_TRUE(bubble.get());
bubble->Show();
bubble->Hide();
@@ -48,7 +51,8 @@ IN_PROC_BROWSER_TEST_F(SpeechRecognitionBubbleTest, ShowAndHide) {
IN_PROC_BROWSER_TEST_F(SpeechRecognitionBubbleTest, ShowAndHideTwice) {
gfx::Rect element_rect(100, 100, 100, 100);
scoped_ptr<SpeechRecognitionBubble> bubble(SpeechRecognitionBubble::Create(
- chrome::GetActiveWebContents(browser()), this, element_rect));
+ browser()->tab_strip_model()->GetActiveWebContents(),
+ this, element_rect));
EXPECT_TRUE(bubble.get());
bubble->Show();
bubble->Hide();
diff --git a/chrome/browser/ui/ash/user_action_handler.cc b/chrome/browser/ui/ash/user_action_handler.cc
index 49ceab4..c7e61cf 100644
--- a/chrome/browser/ui/ash/user_action_handler.cc
+++ b/chrome/browser/ui/ash/user_action_handler.cc
@@ -7,8 +7,8 @@
#include "ash/wm/window_util.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/tabs/tab_strip_model.h"
#include "content/public/browser/web_contents.h"
// Returns the currently-active WebContents belonging to the active browser, or
@@ -21,7 +21,7 @@ content::WebContents* GetActiveWebContents() {
if (!ash::wm::IsActiveWindow(browser->window()->GetNativeWindow()))
return NULL;
- return chrome::GetActiveWebContents(browser);
+ return browser->tab_strip_model()->GetActiveWebContents();
}
UserActionHandler::UserActionHandler() {}
diff --git a/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc b/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc
index 930fa00..1d4c024 100644
--- a/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc
+++ b/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc
@@ -16,8 +16,8 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/bookmarks/bookmark_utils.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/page_navigator.h"
#include "content/public/browser/user_metrics.h"
@@ -176,8 +176,9 @@ void BookmarkContextMenuController::ExecuteCommand(int id) {
bookmark_utils::GetParentForNewNodes(parent_, selection_, &index);
GURL url;
string16 title;
- chrome::GetURLAndTitleToBookmark(chrome::GetActiveWebContents(browser_),
- &url, &title);
+ chrome::GetURLAndTitleToBookmark(
+ browser_->tab_strip_model()->GetActiveWebContents(),
+ &url, &title);
BookmarkEditor::Show(parent_window_,
profile_,
BookmarkEditor::EditDetails::AddNodeInFolder(
diff --git a/chrome/browser/ui/bookmarks/bookmark_prompt_controller.cc b/chrome/browser/ui/bookmarks/bookmark_prompt_controller.cc
index fe99776..b0a0adc 100644
--- a/chrome/browser/ui/bookmarks/bookmark_prompt_controller.cc
+++ b/chrome/browser/ui/bookmarks/bookmark_prompt_controller.cc
@@ -18,7 +18,6 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_list.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_version_info.h"
@@ -60,7 +59,7 @@ bool CanShowBookmarkPrompt(Browser* browser) {
bool IsActiveWebContents(Browser* browser, WebContents* web_contents) {
if (!browser->window()->IsActive())
return false;
- return chrome::GetActiveWebContents(browser) == web_contents;
+ return browser->tab_strip_model()->GetActiveWebContents() == web_contents;
}
bool IsBookmarked(Browser* browser, const GURL& url) {
@@ -319,7 +318,8 @@ void BookmarkPromptController::SetBrowser(Browser* browser) {
browser_ = browser;
if (browser_)
browser_->tab_strip_model()->AddObserver(this);
- SetWebContents(browser_ ? chrome::GetActiveWebContents(browser_) : NULL);
+ SetWebContents(browser_ ? browser_->tab_strip_model()->GetActiveWebContents()
+ : NULL);
}
void BookmarkPromptController::SetWebContents(WebContents* web_contents) {
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index 291b021..72ce592 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -20,7 +20,6 @@
#include "chrome/browser/ui/bookmarks/bookmark_tab_helper.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/chrome_pages.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -995,7 +994,8 @@ void BrowserCommandController::UpdateCommandsForIncognitoAvailability() {
}
void BrowserCommandController::UpdateCommandsForTabState() {
- WebContents* current_web_contents = chrome::GetActiveWebContents(browser_);
+ WebContents* current_web_contents =
+ browser_->tab_strip_model()->GetActiveWebContents();
if (!current_web_contents) // May be NULL during tab restore.
return;
diff --git a/chrome/browser/ui/browser_toolbar_model_delegate.cc b/chrome/browser/ui/browser_toolbar_model_delegate.cc
index 067f2ca..089064c 100644
--- a/chrome/browser/ui/browser_toolbar_model_delegate.cc
+++ b/chrome/browser/ui/browser_toolbar_model_delegate.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/ui/browser_toolbar_model_delegate.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
BrowserToolbarModelDelegate::BrowserToolbarModelDelegate(Browser* browser)
: browser_(browser) {
@@ -16,5 +16,5 @@ BrowserToolbarModelDelegate::~BrowserToolbarModelDelegate() {
content::WebContents*
BrowserToolbarModelDelegate::GetActiveWebContents() const {
- return chrome::GetActiveWebContents(browser_);
+ return browser_->tab_strip_model()->GetActiveWebContents();
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
index 8701dc6..267a940 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -21,7 +21,6 @@
#include "chrome/browser/ui/bookmarks/bookmark_utils.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/chrome_pages.h"
#import "chrome/browser/ui/cocoa/background_gradient_view.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.h"
@@ -46,6 +45,7 @@
#import "chrome/browser/ui/cocoa/view_resizer.h"
#include "chrome/browser/ui/search/search.h"
#include "chrome/browser/ui/search/search_ui.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/pref_names.h"
@@ -808,8 +808,9 @@ void RecordAppLaunch(Profile* profile, GURL url) {
parent = bookmarkModel_->bookmark_bar_node();
GURL url;
string16 title;
- chrome::GetURLAndTitleToBookmark(chrome::GetActiveWebContents(browser_),
- &url, &title);
+ chrome::GetURLAndTitleToBookmark(
+ browser_->tab_strip_model()->GetActiveWebContents(),
+ &url, &title);
BookmarkEditor::Show([[self view] window],
browser_->profile(),
BookmarkEditor::EditDetails::AddNodeInFolder(
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
index 2099c1e..69da961 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
@@ -22,7 +22,6 @@
#include "chrome/browser/ui/browser_command_controller.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/browser_window_state.h"
#import "chrome/browser/ui/cocoa/browser/avatar_button_controller.h"
#import "chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.h"
@@ -43,6 +42,7 @@
#import "chrome/browser/ui/cocoa/web_dialog_window_controller.h"
#import "chrome/browser/ui/cocoa/website_settings_bubble_controller.h"
#include "chrome/browser/ui/search/search_model.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/web_applications/web_app_ui.h"
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/common/chrome_notification_types.h"
@@ -284,7 +284,7 @@ void BrowserWindowCocoa::BookmarkBarStateChanged(
void BrowserWindowCocoa::UpdateDevTools() {
[controller_ updateDevToolsForContents:
- chrome::GetActiveWebContents(browser_)];
+ browser_->tab_strip_model()->GetActiveWebContents()];
}
void BrowserWindowCocoa::UpdateLoadingAnimations(bool should_animate) {
@@ -684,7 +684,8 @@ void BrowserWindowCocoa::ShowPasswordGenerationBubble(
const gfx::Rect& rect,
const content::PasswordForm& form,
autofill::PasswordGenerator* password_generator) {
- WebContents* web_contents = chrome::GetActiveWebContents(browser_);
+ WebContents* web_contents =
+ browser_->tab_strip_model()->GetActiveWebContents();
// We want to point to the middle of the rect instead of the right side.
NSPoint point = GetPointForBubble(web_contents,
rect.x() + rect.width()/2,
diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
index 0a80115..e32ff54 100644
--- a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
@@ -17,13 +17,13 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_tab_helper.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#import "chrome/browser/ui/cocoa/extensions/browser_action_button.h"
#import "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h"
#import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h"
#import "chrome/browser/ui/cocoa/image_button_cell.h"
#import "chrome/browser/ui/cocoa/menu_button.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/api/extension_action/action_info.h"
#include "chrome/common/pref_names.h"
@@ -854,7 +854,8 @@ class ExtensionServiceObserverBridge : public content::NotificationObserver,
}
- (int)currentTabId {
- content::WebContents* active_tab = chrome::GetActiveWebContents(browser_);
+ content::WebContents* active_tab =
+ browser_->tab_strip_model()->GetActiveWebContents();
if (!active_tab)
return -1;
diff --git a/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm b/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm
index e0d7890..72c50ff 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm
@@ -16,7 +16,6 @@
#include "chrome/browser/profiles/profile.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/chrome_pages.h"
#include "chrome/browser/ui/cocoa/browser_window_cocoa.h"
#include "chrome/browser/ui/cocoa/browser_window_controller.h"
@@ -26,6 +25,7 @@
#include "chrome/browser/ui/cocoa/last_active_browser_cocoa.h"
#import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
#include "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
@@ -248,7 +248,8 @@ enum {
NOTREACHED() << "action_ is not a page action or browser action?";
}
- content::WebContents* active_tab = chrome::GetActiveWebContents(browser_);
+ content::WebContents* active_tab =
+ browser_->tab_strip_model()->GetActiveWebContents();
if (!active_tab)
break;
diff --git a/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm b/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm
index 35e50c4..ee37235 100644
--- a/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm
+++ b/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm
@@ -19,11 +19,12 @@
#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/cocoa/last_active_browser_cocoa.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/navigation_details.h"
+#include "content/public/browser/web_contents.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -76,7 +77,8 @@ class KeystonePromotionInfoBarDelegate : public ConfirmInfoBarDelegate {
void KeystonePromotionInfoBarDelegate::Create() {
Browser* browser = chrome::GetLastActiveBrowser();
if (browser) {
- content::WebContents* webContents = chrome::GetActiveWebContents(browser);
+ content::WebContents* webContents =
+ browser->tab_strip_model()->GetActiveWebContents();
if (webContents) {
InfoBarService* infobar_service =
diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
index e3a8763..f55ddeb 100644
--- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
+++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
@@ -23,7 +23,6 @@
#include "chrome/browser/search_engines/template_url_service.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#import "chrome/browser/ui/cocoa/background_gradient_view.h"
#include "chrome/browser/ui/cocoa/drag_util.h"
@@ -45,6 +44,7 @@
#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/omnibox/omnibox_view.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/toolbar/toolbar_model.h"
#include "chrome/browser/ui/toolbar/wrench_menu_model.h"
#include "chrome/browser/upgrade_detector.h"
@@ -770,7 +770,7 @@ class NotificationBridge
}
OpenURLParams params(
url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false);
- chrome::GetActiveWebContents(browser_)->OpenURL(params);
+ browser_->tab_strip_model()->GetActiveWebContents()->OpenURL(params);
}
// (URLDropTargetController protocol)
@@ -787,7 +787,7 @@ class NotificationBridge
OpenURLParams params(
url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false);
- chrome::GetActiveWebContents(browser_)->OpenURL(params);
+ browser_->tab_strip_model()->GetActiveWebContents()->OpenURL(params);
}
// (URLDropTargetController protocol)
diff --git a/chrome/browser/ui/extensions/application_launch.cc b/chrome/browser/ui/extensions/application_launch.cc
index 0ff128f..e5a50de 100644
--- a/chrome/browser/ui/extensions/application_launch.cc
+++ b/chrome/browser/ui/extensions/application_launch.cc
@@ -188,7 +188,8 @@ WebContents* OpenApplicationTab(Profile* profile,
params.disposition = disposition;
if (disposition == CURRENT_TAB) {
- WebContents* existing_tab = chrome::GetActiveWebContents(browser);
+ WebContents* existing_tab =
+ browser->tab_strip_model()->GetActiveWebContents();
TabStripModel* model = browser->tab_strip_model();
int tab_index = model->GetIndexOfWebContents(existing_tab);
@@ -198,7 +199,7 @@ WebContents* OpenApplicationTab(Profile* profile,
WebKit::WebReferrerPolicyDefault),
disposition, content::PAGE_TRANSITION_LINK, false));
// Reset existing_tab as OpenURL() may have clobbered it.
- existing_tab = chrome::GetActiveWebContents(browser);
+ existing_tab = browser->tab_strip_model()->GetActiveWebContents();
if (params.tabstrip_add_types & TabStripModel::ADD_PINNED) {
model->SetTabPinned(tab_index, true);
// Pinning may have moved the tab.
diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller.cc b/chrome/browser/ui/fullscreen/fullscreen_controller.cc
index 080bfb8..519adcc 100644
--- a/chrome/browser/ui/fullscreen/fullscreen_controller.cc
+++ b/chrome/browser/ui/fullscreen/fullscreen_controller.cc
@@ -11,8 +11,8 @@
#include "chrome/browser/download/download_shelf.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/tabs/tab_strip_model.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
@@ -68,13 +68,13 @@ bool FullscreenController::IsFullscreenForTabOrPending(
const WebContents* web_contents) const {
if (web_contents != fullscreened_tab_)
return false;
- DCHECK(web_contents == chrome::GetActiveWebContents(browser_));
+ DCHECK(web_contents == browser_->tab_strip_model()->GetActiveWebContents());
return true;
}
void FullscreenController::ToggleFullscreenModeForTab(WebContents* web_contents,
bool enter_fullscreen) {
- if (web_contents != chrome::GetActiveWebContents(browser_))
+ if (web_contents != browser_->tab_strip_model()->GetActiveWebContents())
return;
#if defined(OS_WIN)
@@ -520,7 +520,7 @@ void FullscreenController::ToggleFullscreenModeInternal(bool for_tab) {
GURL url;
if (for_tab) {
- url = chrome::GetActiveWebContents(browser_)->GetURL();
+ url = browser_->tab_strip_model()->GetActiveWebContents()->GetURL();
tab_fullscreen_accepted_ = toggled_into_fullscreen_ &&
GetFullscreenSetting(url) == CONTENT_SETTING_ALLOW;
} else {
@@ -559,7 +559,7 @@ void FullscreenController::TogglePresentationModeInternal(bool for_tab) {
toggled_into_fullscreen_ = !window_->IsFullscreenWithoutChrome();
GURL url;
if (for_tab) {
- url = chrome::GetActiveWebContents(browser_)->GetURL();
+ url = browser_->tab_strip_model()->GetActiveWebContents()->GetURL();
tab_fullscreen_accepted_ = toggled_into_fullscreen_ &&
GetFullscreenSetting(url) == CONTENT_SETTING_ALLOW;
}
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc
index 06318c5..7428bbe744 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc
@@ -22,7 +22,6 @@
#include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h"
#include "chrome/browser/ui/bookmarks/bookmark_utils.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_instructions_gtk.h"
#include "chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h"
@@ -39,6 +38,7 @@
#include "chrome/browser/ui/gtk/tabstrip_origin_provider.h"
#include "chrome/browser/ui/gtk/view_id_util.h"
#include "chrome/browser/ui/ntp_background_util.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension_constants.h"
@@ -694,7 +694,8 @@ bool BookmarkBarGtk::GetWebContentsSize(gfx::Size* size) {
NOTREACHED();
return false;
}
- WebContents* web_contents = chrome::GetActiveWebContents(browser);
+ WebContents* web_contents =
+ browser->tab_strip_model()->GetActiveWebContents();
if (!web_contents) {
// It is possible to have a browser but no WebContents while under testing,
// so don't NOTREACHED() and error the program.
diff --git a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc
index 1b7bfd1..cd1f8d7 100644
--- a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc
+++ b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc
@@ -23,7 +23,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_tab_helper.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/gtk/browser_window_gtk.h"
#include "chrome/browser/ui/gtk/custom_button.h"
#include "chrome/browser/ui/gtk/extensions/extension_popup_gtk.h"
@@ -34,6 +33,7 @@
#include "chrome/browser/ui/gtk/hover_controller_gtk.h"
#include "chrome/browser/ui/gtk/menu_gtk.h"
#include "chrome/browser/ui/gtk/view_id_util.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
@@ -586,7 +586,8 @@ BrowserActionsToolbarGtk::~BrowserActionsToolbarGtk() {
}
int BrowserActionsToolbarGtk::GetCurrentTabId() const {
- content::WebContents* active_tab = chrome::GetActiveWebContents(browser_);
+ content::WebContents* active_tab =
+ browser_->tab_strip_model()->GetActiveWebContents();
if (!active_tab)
return -1;
diff --git a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc
index 17792ae..531a8d0 100644
--- a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc
+++ b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc
@@ -21,7 +21,6 @@
#include "chrome/browser/defaults.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/gtk/gtk_theme_service.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
#include "chrome/browser/ui/gtk/location_bar_view_gtk.h"
@@ -31,6 +30,7 @@
#include "chrome/browser/ui/omnibox/omnibox_edit_model.h"
#include "chrome/browser/ui/omnibox/omnibox_popup_model.h"
#include "chrome/browser/ui/search/search.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/toolbar/toolbar_model.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/public/browser/notification_source.h"
@@ -1383,7 +1383,8 @@ void OmniboxViewGtk::HandleDragDataGet(GtkWidget* widget,
break;
}
case ui::CHROME_NAMED_URL: {
- WebContents* current_tab = chrome::GetActiveWebContents(browser_);
+ WebContents* current_tab =
+ browser_->tab_strip_model()->GetActiveWebContents();
string16 tab_title = current_tab->GetTitle();
// Pass an empty string if user has edited the URL.
if (current_tab->GetURL().spec() != dragged_text_)
diff --git a/chrome/browser/ui/startup/autolaunch_prompt_win.cc b/chrome/browser/ui/startup/autolaunch_prompt_win.cc
index d64e8a4..654aa5a 100644
--- a/chrome/browser/ui/startup/autolaunch_prompt_win.cc
+++ b/chrome/browser/ui/startup/autolaunch_prompt_win.cc
@@ -14,13 +14,14 @@
#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_constants.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/installer/util/auto_launch_util.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_details.h"
+#include "content/public/browser/web_contents.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -187,7 +188,8 @@ bool ShowAutolaunchPrompt(Browser* browser) {
return false;
}
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser);
+ content::WebContents* web_contents =
+ browser->tab_strip_model()->GetActiveWebContents();
profile = Profile::FromBrowserContext(web_contents->GetBrowserContext());
AutolaunchInfoBarDelegate::Create(
InfoBarService::FromWebContents(web_contents), profile->GetPrefs(),
diff --git a/chrome/browser/ui/startup/bad_flags_prompt.cc b/chrome/browser/ui/startup/bad_flags_prompt.cc
index 230956e..d1e7d10 100644
--- a/chrome/browser/ui/startup/bad_flags_prompt.cc
+++ b/chrome/browser/ui/startup/bad_flags_prompt.cc
@@ -9,7 +9,7 @@
#include "chrome/browser/api/infobars/infobar_service.h"
#include "chrome/browser/api/infobars/simple_alert_infobar_delegate.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 "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -40,7 +40,8 @@ void ShowBadFlagsPrompt(Browser* browser) {
}
if (bad_flag) {
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser);
+ content::WebContents* web_contents =
+ browser->tab_strip_model()->GetActiveWebContents();
if (!web_contents)
return;
SimpleAlertInfoBarDelegate::Create(
diff --git a/chrome/browser/ui/startup/default_browser_prompt.cc b/chrome/browser/ui/startup/default_browser_prompt.cc
index d2169ee..8f0f5e0 100644
--- a/chrome/browser/ui/startup/default_browser_prompt.cc
+++ b/chrome/browser/ui/startup/default_browser_prompt.cc
@@ -16,7 +16,7 @@
#include "chrome/browser/shell_integration.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/tabs/tab_strip_model.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_details.h"
@@ -180,7 +180,8 @@ void NotifyNotDefaultBrowserCallback(chrome::HostDesktopType desktop_type) {
// In ChromeBot tests, there might be a race. This line appears to get
// called during shutdown and |tab| can be NULL.
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser);
+ content::WebContents* web_contents =
+ browser->tab_strip_model()->GetActiveWebContents();
if (!web_contents)
return;
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index 2b9d0fb..cd42cc1 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -833,7 +833,7 @@ Browser* StartupBrowserCreatorImpl::OpenTabsInBrowser(Browser* browser,
first_tab = false;
}
- if (!chrome::GetActiveWebContents(browser)) {
+ if (!browser->tab_strip_model()->GetActiveWebContents()) {
// TODO: this is a work around for 110909. Figure out why it's needed.
if (!browser->tab_strip_model()->count())
chrome::AddBlankTabAt(browser, -1, true);
@@ -871,7 +871,7 @@ void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary(
if (!command_line_.HasSwitch(switches::kTestType)) {
chrome::ObsoleteOSInfoBar::Create(
InfoBarService::FromWebContents(
- chrome::GetActiveWebContents(browser)));
+ browser->tab_strip_model()->GetActiveWebContents()));
}
if (browser_defaults::kOSSupportsOtherBrowsers &&
diff --git a/chrome/browser/ui/toolbar/action_box_button_controller.cc b/chrome/browser/ui/toolbar/action_box_button_controller.cc
index 396743e..51c8c8f 100644
--- a/chrome/browser/ui/toolbar/action_box_button_controller.cc
+++ b/chrome/browser/ui/toolbar/action_box_button_controller.cc
@@ -14,7 +14,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/browser/ui/toolbar/action_box_menu_model.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
@@ -225,7 +225,8 @@ void ActionBoxButtonController::Observe(
void ActionBoxButtonController::TriggerExplicitShareIntent(
const GURL& share_service_url) {
- const GURL& current_url = chrome::GetActiveWebContents(browser_)->GetURL();
+ const GURL& current_url =
+ browser_->tab_strip_model()->GetActiveWebContents()->GetURL();
webkit_glue::WebIntentData intent_data(
ASCIIToUTF16(kShareIntentAction),
ASCIIToUTF16(kShareIntentMimeType),
diff --git a/chrome/browser/ui/toolbar/action_box_menu_model.cc b/chrome/browser/ui/toolbar/action_box_menu_model.cc
index c27105a..b095792 100644
--- a/chrome/browser/ui/toolbar/action_box_menu_model.cc
+++ b/chrome/browser/ui/toolbar/action_box_menu_model.cc
@@ -17,7 +17,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_command_controller.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/url_constants.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -40,7 +40,7 @@ ActionBoxMenuModel::ActionBoxMenuModel(Browser* browser,
}
BookmarkTabHelper* bookmark_tab_helper = BookmarkTabHelper::FromWebContents(
- chrome::GetActiveWebContents(browser_));
+ browser_->tab_strip_model()->GetActiveWebContents());
bool starred = bookmark_tab_helper->is_starred();
AddItemWithStringId(IDC_BOOKMARK_PAGE_FROM_STAR,
starred ? IDS_TOOLTIP_STARRED : IDS_TOOLTIP_STAR);
diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.cc b/chrome/browser/ui/toolbar/back_forward_menu_model.cc
index 020b477..ae76d4c 100644
--- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc
+++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc
@@ -14,8 +14,8 @@
#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/singleton_tabs.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/favicon_status.h"
@@ -422,7 +422,7 @@ WebContents* BackForwardMenuModel::GetWebContents() const {
// We use the test web contents if the unit test has specified it.
return test_web_contents_ ?
test_web_contents_ :
- chrome::GetActiveWebContents(browser_);
+ browser_->tab_strip_model()->GetActiveWebContents();
}
int BackForwardMenuModel::MenuIndexToNavEntryIndex(int index) const {
diff --git a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc
index abe2419..bfc4081 100644
--- a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc
+++ b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc
@@ -20,7 +20,6 @@
#include "chrome/browser/sync/profile_sync_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/tabs/tab_strip_model.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/time_format.h"
@@ -215,7 +214,7 @@ void RecentTabsSubMenuModel::ExecuteCommand(int command_id, int event_flags) {
return;
TabRestoreServiceDelegate* delegate =
TabRestoreServiceDelegate::FindDelegateForWebContents(
- chrome::GetActiveWebContents(browser_));
+ browser_->tab_strip_model()->GetActiveWebContents());
if (!delegate)
return;
service->RestoreEntryById(delegate, item.tab_id,
@@ -230,7 +229,7 @@ void RecentTabsSubMenuModel::ExecuteCommand(int command_id, int event_flags) {
if (tab->navigations.empty())
return;
SessionRestore::RestoreForeignSessionTab(
- chrome::GetActiveWebContents(browser_), *tab, disposition);
+ browser_->tab_strip_model()->GetActiveWebContents(), *tab, disposition);
}
}
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc
index 228c7ef..d77e397 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc
@@ -28,7 +28,6 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.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/global_error/global_error.h"
#include "chrome/browser/ui/global_error/global_error_service.h"
@@ -124,7 +123,8 @@ void EncodingMenuModel::Build() {
}
bool EncodingMenuModel::IsCommandIdChecked(int command_id) const {
- WebContents* current_tab = chrome::GetActiveWebContents(browser_);
+ WebContents* current_tab =
+ browser_->tab_strip_model()->GetActiveWebContents();
if (!current_tab)
return false;
EncodingMenuController controller;
@@ -275,7 +275,8 @@ string16 WrenchMenuModel::GetLabelForCommandId(int command_id) const {
#elif defined(OS_WIN)
case IDC_PIN_TO_START_SCREEN: {
int string_id = IDS_PIN_TO_START_SCREEN;
- WebContents* web_contents = chrome::GetActiveWebContents(browser_);
+ WebContents* web_contents =
+ browser_->tab_strip_model()->GetActiveWebContents();
MetroPinTabHelper* tab_helper =
web_contents ? MetroPinTabHelper::FromWebContents(web_contents)
: NULL;
@@ -725,9 +726,10 @@ void WrenchMenuModel::UpdateZoomControls() {
bool enable_increment = false;
bool enable_decrement = false;
int zoom_percent = 100;
- if (chrome::GetActiveWebContents(browser_)) {
- zoom_percent = chrome::GetActiveWebContents(browser_)->GetZoomPercent(
- &enable_increment, &enable_decrement);
+ if (browser_->tab_strip_model()->GetActiveWebContents()) {
+ zoom_percent =
+ browser_->tab_strip_model()->GetActiveWebContents()->GetZoomPercent(
+ &enable_increment, &enable_decrement);
}
zoom_label_ = l10n_util::GetStringFUTF16(
IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent));
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index d6d7e9f..b7ffe23 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -29,8 +29,8 @@
#include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
#include "chrome/browser/ui/bookmarks/bookmark_utils.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/bookmarks/bookmark_bar_instructions_view.h"
#include "chrome/browser/ui/views/bookmarks/bookmark_context_menu.h"
@@ -1109,8 +1109,10 @@ void BookmarkBarView::ShowContextMenuForView(views::View* source,
bool close_on_remove =
(parent == BookmarkModelFactory::GetForProfile(profile)->other_node()) &&
(parent->child_count() == 1);
- context_menu_.reset(new BookmarkContextMenu(GetWidget(), browser_, profile,
- chrome::GetActiveWebContents(browser_), parent, nodes, close_on_remove));
+ context_menu_.reset(new BookmarkContextMenu(
+ GetWidget(), browser_, profile,
+ browser_->tab_strip_model()->GetActiveWebContents(),
+ parent, nodes, close_on_remove));
context_menu_->RunMenuAt(point);
}
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc
index c8ed565..22ace3f 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc
@@ -15,8 +15,8 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/bookmarks/bookmark_utils.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/page_navigator.h"
#include "content/public/browser/user_metrics.h"
@@ -115,8 +115,9 @@ void BookmarkContextMenuControllerViews::ExecuteCommand(int id) {
bookmark_utils::GetParentForNewNodes(parent_, selection_, &index);
GURL url;
string16 title;
- chrome::GetURLAndTitleToBookmark(chrome::GetActiveWebContents(browser_),
- &url, &title);
+ chrome::GetURLAndTitleToBookmark(
+ browser_->tab_strip_model()->GetActiveWebContents(),
+ &url, &title);
BookmarkEditor::Show(parent_widget_->GetNativeWindow(),
profile_,
BookmarkEditor::EditDetails::AddNodeInFolder(
diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc
index 212c847..46ee3f6 100644
--- a/chrome/browser/ui/views/browser_actions_container.cc
+++ b/chrome/browser/ui/views/browser_actions_container.cc
@@ -13,7 +13,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_tab_helper.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/view_ids.h"
#include "chrome/browser/ui/views/browser_action_view.h"
#include "chrome/browser/ui/views/extensions/browser_action_drag_data.h"
@@ -474,7 +474,8 @@ void BrowserActionsContainer::InspectPopup(ExtensionAction* action) {
}
int BrowserActionsContainer::GetCurrentTabId() const {
- content::WebContents* active_tab = chrome::GetActiveWebContents(browser_);
+ content::WebContents* active_tab =
+ browser_->tab_strip_model()->GetActiveWebContents();
if (!active_tab)
return -1;
@@ -498,7 +499,8 @@ gfx::Point BrowserActionsContainer::GetViewContentOffset() const {
extensions::ActiveTabPermissionGranter*
BrowserActionsContainer::GetActiveTabPermissionGranter() {
- content::WebContents* web_contents = chrome::GetActiveWebContents(browser_);
+ content::WebContents* web_contents =
+ browser_->tab_strip_model()->GetActiveWebContents();
if (!web_contents)
return NULL;
return extensions::TabHelper::FromWebContents(web_contents)->
diff --git a/chrome/browser/ui/views/frame/browser_frame_win.cc b/chrome/browser/ui/views/frame/browser_frame_win.cc
index e76f01a..f761d8b 100644
--- a/chrome/browser/ui/views/frame/browser_frame_win.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_win.cc
@@ -19,7 +19,7 @@
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_finder.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/system_menu_insertion_delegate_win.h"
#include "chrome/browser/ui/views/tabs/tab_strip.h"
@@ -524,7 +524,7 @@ void BrowserFrameWin::GetMetroCurrentTabInfo(WPARAM w_param) {
current_tab_info->title = base::win::LocalAllocAndCopyString(
browser->GetWindowTitleForCurrentTab());
- WebContents* current_tab = chrome::GetActiveWebContents(browser);
+ WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents();
DCHECK(current_tab);
current_tab_info->url = base::win::LocalAllocAndCopyString(
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 895c2f2..f910da3 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -40,7 +40,6 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_instant_controller.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/ntp_background_util.h"
#include "chrome/browser/ui/omnibox/omnibox_popup_model.h"
@@ -237,7 +236,7 @@ void BookmarkExtensionBackground::Paint(gfx::Canvas* canvas,
if (host_view_->IsDetached()) {
// Draw the background to match the new tab page.
int height = 0;
- WebContents* contents = chrome::GetActiveWebContents(browser_);
+ WebContents* contents = browser_->tab_strip_model()->GetActiveWebContents();
if (contents && contents->GetView())
height = contents->GetView()->GetContainerSize().height();
NtpBackgroundUtil::PaintBackgroundDetachedMode(
@@ -1533,7 +1532,8 @@ bool BrowserView::ShouldShowWindowTitle() const {
gfx::ImageSkia BrowserView::GetWindowAppIcon() {
if (browser_->is_app()) {
- WebContents* contents = chrome::GetActiveWebContents(browser_.get());
+ WebContents* contents =
+ browser_->tab_strip_model()->GetActiveWebContents();
extensions::TabHelper* extensions_tab_helper =
contents ? extensions::TabHelper::FromWebContents(contents) : NULL;
if (extensions_tab_helper && extensions_tab_helper->GetExtensionAppIcon())
@@ -2015,7 +2015,8 @@ void BrowserView::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();
// GetActiveWebContents can return NULL for example under Purify when
// the animations are running slowly and this function is called on a timer
// through LoadingAnimationCallback.
@@ -2544,7 +2545,8 @@ void BrowserView::DoCutCopyPaste(void (content::RenderWidgetHost::*method)(),
int windows_msg_id,
#endif
int command_id) {
- WebContents* contents = chrome::GetActiveWebContents(browser_.get());
+ WebContents* contents =
+ browser_->tab_strip_model()->GetActiveWebContents();
if (!contents)
return;
if (DoCutCopyPasteForWebContents(contents, method))
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 031b4c1..e80cafe 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -27,10 +27,10 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_instant_controller.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/omnibox/alternate_nav_url_fetcher.h"
#include "chrome/browser/ui/omnibox/location_bar_util.h"
#include "chrome/browser/ui/omnibox/omnibox_popup_model.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/bookmarks/bookmark_prompt_view.h"
#include "chrome/browser/ui/views/browser_dialogs.h"
@@ -1116,7 +1116,7 @@ void LocationBarView::RefreshPageActionViews() {
if (!page_action_views_.empty() && contents) {
Browser* browser = chrome::FindBrowserWithWebContents(contents);
- GURL url = chrome::GetActiveWebContents(browser)->GetURL();
+ GURL url = browser->tab_strip_model()->GetActiveWebContents()->GetURL();
for (PageActionViews::const_iterator i(page_action_views_.begin());
i != page_action_views_.end(); ++i) {
diff --git a/chrome/browser/ui/views/tab_contents/render_view_context_menu_win.cc b/chrome/browser/ui/views/tab_contents/render_view_context_menu_win.cc
index 115e103..4c54d5c 100644
--- a/chrome/browser/ui/views/tab_contents/render_view_context_menu_win.cc
+++ b/chrome/browser/ui/views/tab_contents/render_view_context_menu_win.cc
@@ -8,7 +8,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/retargeting_details.h"
#include "chrome/browser/ui/browser_finder.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 "content/public/browser/web_contents.h"
#include "win8/util/win8_util.h"
@@ -71,7 +71,8 @@ void RenderViewContextMenuWin::ExecuteCommand(int command_id,
NEW_FOREGROUND_TAB,
content::PAGE_TRANSITION_LINK,
false);
- WebContents* source_web_contents = chrome::GetActiveWebContents(browser);
+ WebContents* source_web_contents =
+ browser->tab_strip_model()->GetActiveWebContents();
WebContents* new_contents = source_web_contents->OpenURL(url_params);
DCHECK(new_contents);
return;
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index 2fa6568..f583523 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -511,7 +511,7 @@ void AppLauncherHandler::HandleLaunchApp(const ListValue* args) {
web_ui()->GetWebContents());
WebContents* old_contents = NULL;
if (browser)
- old_contents = chrome::GetActiveWebContents(browser);
+ old_contents = browser->tab_strip_model()->GetActiveWebContents();
LaunchParams params(profile, extension,
old_contents ? CURRENT_TAB : NEW_FOREGROUND_TAB);
diff --git a/chrome/browser/ui/webui/set_as_default_browser_ui.cc b/chrome/browser/ui/webui/set_as_default_browser_ui.cc
index 04a6959..9a53766 100644
--- a/chrome/browser/ui/webui/set_as_default_browser_ui.cc
+++ b/chrome/browser/ui/webui/set_as_default_browser_ui.cc
@@ -18,10 +18,10 @@
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_list.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/singleton_tabs.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -337,7 +337,7 @@ void SetAsDefaultBrowserDialogImpl::OnDialogClosed(
// dialog the actual browser window had to remain hidden. Now it's time to
// show it.
BrowserWindow* window = browser_->window();
- WebContents* contents = chrome::GetActiveWebContents(browser_);
+ WebContents* contents = browser_->tab_strip_model()->GetActiveWebContents();
window->Show();
if (contents)
contents->GetView()->SetInitialFocus();
diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc
index 94c6964..0a9c71e 100644
--- a/chrome/test/base/in_process_browser_test.cc
+++ b/chrome/test/base/in_process_browser_test.cc
@@ -333,7 +333,8 @@ void InProcessBrowserTest::RunTestOnMainThreadLoop() {
if (browser_->window()->IsMaximized())
browser_->window()->Restore();
#endif
- content::WaitForLoadStop(chrome::GetActiveWebContents(browser_));
+ content::WaitForLoadStop(
+ browser_->tab_strip_model()->GetActiveWebContents());
}
// Pump any pending events that were created as a result of creating a
diff --git a/chrome/test/gpu/gpu_pixel_browsertest.cc b/chrome/test/gpu/gpu_pixel_browsertest.cc
index 0ae8b44..b70b98a 100644
--- a/chrome/test/gpu/gpu_pixel_browsertest.cc
+++ b/chrome/test/gpu/gpu_pixel_browsertest.cc
@@ -10,8 +10,8 @@
#include "base/string_util.h"
#include "base/stringprintf.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/browser/ui/window_snapshot/window_snapshot.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -188,7 +188,7 @@ class GpuPixelBrowserTest : public InProcessBrowserTest {
js_call << ");";
ASSERT_TRUE(content::ExecuteScript(
- chrome::GetActiveWebContents(browser()), js_call.str()));
+ browser()->tab_strip_model()->GetActiveWebContents(), js_call.str()));
std::string message;
ASSERT_TRUE(message_queue.WaitForMessage(&message));
@@ -427,7 +427,8 @@ class GpuPixelBrowserTest : public InProcessBrowserTest {
// have if the tab contents have the desired size.
gfx::Rect GetNewTabContainerBounds(const gfx::Size& desired_size) {
gfx::Rect container_rect;
- chrome::GetActiveWebContents(browser())->GetContainerBounds(&container_rect);
+ browser()->tab_strip_model()->GetActiveWebContents()->GetContainerBounds(
+ &container_rect);
// Size cannot be negative, so use a point.
gfx::Point correction(
desired_size.width() - container_rect.size().width(),
@@ -447,7 +448,7 @@ class GpuPixelBrowserTest : public InProcessBrowserTest {
gfx::Rect root_bounds = browser()->window()->GetBounds();
gfx::Rect tab_contents_bounds;
- chrome::GetActiveWebContents(browser())->GetContainerBounds(
+ browser()->tab_strip_model()->GetActiveWebContents()->GetContainerBounds(
&tab_contents_bounds);
gfx::Rect snapshot_bounds(tab_contents_bounds.x() - root_bounds.x(),