diff options
Diffstat (limited to 'chrome')
26 files changed, 64 insertions, 113 deletions
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index a5995a8..16e6c8b 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -114,7 +114,6 @@ #include "chrome/browser/ui/omnibox/omnibox_view.h" #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" #include "chrome/browser/ui/startup/startup_types.h" -#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/view_type_utils.h" #include "chrome/common/automation_constants.h" #include "chrome/common/automation_events.h" @@ -3547,8 +3546,8 @@ void TestingAutomationProvider::GetSavedPasswords( namespace { -// Get the TabContents from a dictionary of arguments. -TabContents* GetTabContentsFromDict(const Browser* browser, +// Get the WebContents from a dictionary of arguments. +WebContents* GetWebContentsFromDict(const Browser* browser, const DictionaryValue* args, std::string* error_message) { int tab_index; @@ -3557,13 +3556,13 @@ TabContents* GetTabContentsFromDict(const Browser* browser, return NULL; } - TabContents* tab_contents = - browser->tab_strip_model()->GetTabContentsAt(tab_index); - if (!tab_contents) { + WebContents* web_contents = + browser->tab_strip_model()->GetWebContentsAt(tab_index); + if (!web_contents) { *error_message = StringPrintf("No tab at index %d.", tab_index); return NULL; } - return tab_contents; + return web_contents; } } // namespace @@ -3573,9 +3572,9 @@ void TestingAutomationProvider::FindInPage( DictionaryValue* args, IPC::Message* reply_message) { std::string error_message; - TabContents* tab_contents = - GetTabContentsFromDict(browser, args, &error_message); - if (!tab_contents) { + WebContents* web_contents = + GetWebContentsFromDict(browser, args, &error_message); + if (!web_contents) { AutomationJSONReply(this, reply_message).SendError(error_message); return; } @@ -3603,7 +3602,7 @@ void TestingAutomationProvider::FindInPage( SendError("Must include find_next boolean."); return; } - SendFindRequest(tab_contents->web_contents(), + SendFindRequest(web_contents, true, search_string, forward, diff --git a/chrome/browser/chromeos/extensions/file_manager_util.cc b/chrome/browser/chromeos/extensions/file_manager_util.cc index 149140e..ffc8d9b 100644 --- a/chrome/browser/chromeos/extensions/file_manager_util.cc +++ b/chrome/browser/chromeos/extensions/file_manager_util.cc @@ -36,7 +36,6 @@ #include "chrome/browser/ui/extensions/application_launch.h" #include "chrome/browser/ui/host_desktop.h" #include "chrome/browser/ui/simple_message_box.h" -#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" @@ -431,8 +430,7 @@ bool FileManageTabExists(const FilePath& path, TAB_REUSE_MODE mode) { Browser* browser = *browser_iterator; TabStripModel* tab_strip = browser->tab_strip_model(); for (int idx = 0; idx < tab_strip->count(); idx++) { - content::WebContents* web_contents = - tab_strip->GetTabContentsAt(idx)->web_contents(); + content::WebContents* web_contents = tab_strip->GetWebContentsAt(idx); const GURL& url = web_contents->GetURL(); if (origin == url.GetOrigin()) { if (mode == REUSE_ANY_FILE_MANAGER || ref == url.ref()) { @@ -538,8 +536,7 @@ Browser* GetBrowserForUrl(GURL target_url) { Browser* browser = *browser_iterator; TabStripModel* tab_strip = browser->tab_strip_model(); for (int idx = 0; idx < tab_strip->count(); idx++) { - content::WebContents* web_contents = - tab_strip->GetTabContentsAt(idx)->web_contents(); + content::WebContents* web_contents = tab_strip->GetWebContentsAt(idx); const GURL& url = web_contents->GetURL(); if (url == target_url) return browser; diff --git a/chrome/browser/content_settings/content_settings_browsertest.cc b/chrome/browser/content_settings/content_settings_browsertest.cc index b36eda9..013cc39 100644 --- a/chrome/browser/content_settings/content_settings_browsertest.cc +++ b/chrome/browser/content_settings/content_settings_browsertest.cc @@ -14,7 +14,6 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/browser_tabstrip.h" -#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/render_messages.h" @@ -86,18 +85,16 @@ class ContentSettingsTest : public InProcessBrowserTest { } void PreBasic(const GURL& url) { - TabContents* tab = browser()->tab_strip_model()->GetActiveTabContents(); - ASSERT_TRUE(GetCookies(tab->profile(), url).empty()); + ASSERT_TRUE(GetCookies(browser()->profile(), url).empty()); CookieCheckIncognitoWindow(url, true); ui_test_utils::NavigateToURL(browser(), url); - ASSERT_FALSE(GetCookies(tab->profile(), url).empty()); + ASSERT_FALSE(GetCookies(browser()->profile(), url).empty()); } void Basic(const GURL& url) { - TabContents* tab = browser()->tab_strip_model()->GetActiveTabContents(); - ASSERT_FALSE(GetCookies(tab->profile(), url).empty()); + ASSERT_FALSE(GetCookies(browser()->profile(), url).empty()); } net::TestServer https_server_; diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc index ee99355..e9c28fb 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc @@ -53,7 +53,7 @@ bool TabCaptureCaptureFunction::RunImpl() { TabCapture::Capture::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params.get()); - // Figure out the active WebContents and retrieve the needed id's. + // Figure out the active WebContents and retrieve the needed ids. Browser* target_browser = browser::FindAnyBrowser(profile(), include_incognito(), chrome::GetActiveDesktop()); diff --git a/chrome/browser/extensions/options_page_apitest.cc b/chrome/browser/extensions/options_page_apitest.cc index 6de9be9..1a69328 100644 --- a/chrome/browser/extensions/options_page_apitest.cc +++ b/chrome/browser/extensions/options_page_apitest.cc @@ -41,7 +41,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, DISABLED_OptionsPage) { ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIExtensionsURL)); TabStripModel* tab_strip = browser()->tab_strip_model(); ASSERT_TRUE(content::ExecuteJavaScript( - chrome::GetActiveWebContents(browser())->GetRenderViewHost(), L"", + tab_strip->GetActiveWebContents()->GetRenderViewHost(), L"", jscript_click_option_button)); // If the options page hasn't already come up, wait for it. diff --git a/chrome/browser/fast_shutdown_browsertest.cc b/chrome/browser/fast_shutdown_browsertest.cc index e306f20..9b30c42 100644 --- a/chrome/browser/fast_shutdown_browsertest.cc +++ b/chrome/browser/fast_shutdown_browsertest.cc @@ -9,7 +9,6 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/browser_list.h" -#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_notification_types.h" @@ -44,8 +43,7 @@ IN_PROC_BROWSER_TEST_F(FastShutdown, DISABLED_SlowTermination) { ASSERT_TRUE(test_server()->Start()); // This page has an unload handler. GURL url = test_server()->GetURL("files/fast_shutdown/on_unloader.html"); - TabContents* tab = browser()->tab_strip_model()->GetActiveTabContents(); - EXPECT_EQ("", content::GetCookies(tab->profile(), url)); + EXPECT_EQ("", content::GetCookies(browser()->profile(), url)); content::WindowedNotificationObserver window_observer( chrome::NOTIFICATION_BROWSER_WINDOW_READY, @@ -70,6 +68,6 @@ IN_PROC_BROWSER_TEST_F(FastShutdown, DISABLED_SlowTermination) { chrome::CloseTab(browser()); renderer_shutdown_observer.Wait(); - EXPECT_EQ("unloaded=ohyeah", content::GetCookies(tab->profile(), url)); + EXPECT_EQ("unloaded=ohyeah", content::GetCookies(browser()->profile(), url)); } #endif diff --git a/chrome/browser/history/history_browsertest.cc b/chrome/browser/history/history_browsertest.cc index 1e01117..4eed8a4 100644 --- a/chrome/browser/history/history_browsertest.cc +++ b/chrome/browser/history/history_browsertest.cc @@ -17,7 +17,6 @@ #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/tab_contents/tab_contents.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" @@ -490,10 +489,11 @@ IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, OneHistoryTabPerWindow) { chrome::ExecuteCommand(browser(), IDC_SHOW_HISTORY); content::WebContents* active_web_contents = - chrome::GetActiveWebContents(browser()); + browser()->tab_strip_model()->GetActiveWebContents(); ASSERT_EQ(web_contents, active_web_contents); ASSERT_EQ(history_url, active_web_contents->GetURL()); - TabContents* second_tab = browser()->tab_strip_model()->GetTabContentsAt(1); - ASSERT_NE(history_url, second_tab->web_contents()->GetURL()); + content::WebContents* second_tab = + browser()->tab_strip_model()->GetWebContentsAt(1); + ASSERT_NE(history_url, second_tab->GetURL()); } diff --git a/chrome/browser/lifetime/application_lifetime.cc b/chrome/browser/lifetime/application_lifetime.cc index 0849e1f..b05d711 100644 --- a/chrome/browser/lifetime/application_lifetime.cc +++ b/chrome/browser/lifetime/application_lifetime.cc @@ -18,7 +18,6 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_tabstrip.h" #include "chrome/browser/ui/browser_window.h" -#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" @@ -193,7 +192,7 @@ void CloseAllBrowsers() { // DestroyBrowser to make sure the browser is deleted and cleanup can // happen. while (browser->tab_count()) - delete browser->tab_strip_model()->GetTabContentsAt(0); + delete browser->tab_strip_model()->GetWebContentsAt(0); browser->window()->DestroyBrowser(); i = BrowserList::begin(); if (i != BrowserList::end() && browser == *i) { diff --git a/chrome/browser/metro_viewer/metro_viewer_process_host_win.cc b/chrome/browser/metro_viewer/metro_viewer_process_host_win.cc index 2139eba..1659ad3 100644 --- a/chrome/browser/metro_viewer/metro_viewer_process_host_win.cc +++ b/chrome/browser/metro_viewer/metro_viewer_process_host_win.cc @@ -11,9 +11,9 @@ #include "chrome/browser/ui/browser_list_impl.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/host_desktop.h" -#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/web_contents.h" #include "ipc/ipc_channel_proxy.h" #include "ui/aura/remote_root_window_host_win.h" #include "ui/metro_viewer/metro_viewer_messages.h" @@ -32,7 +32,7 @@ void CloseOpenAshBrowsers() { // If the attempt to Close the browser fails due to unload handlers on // the page or in progress downloads, etc, destroy all tabs on the page. while (browser->tab_count()) - delete browser->tab_strip_model()->GetTabContentsAt(0); + delete browser->tab_strip_model()->GetWebContentsAt(0); } } } @@ -65,7 +65,7 @@ bool MetroViewerProcessHost::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(MetroViewerHostMsg_SetTargetSurface, OnSetTargetSurface) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() - return handled ? true : + return handled ? true : aura::RemoteRootWindowHostWin::Instance()->OnMessageReceived(message); } @@ -89,4 +89,3 @@ void MetroViewerProcessHost::OnSetTargetSurface( any_window->SetNewTargetWindow(hwnd); aura::RemoteRootWindowHostWin::Instance()->Connected(this); } - diff --git a/chrome/browser/net/cookie_policy_browsertest.cc b/chrome/browser/net/cookie_policy_browsertest.cc index a505ea8..1fbec10 100644 --- a/chrome/browser/net/cookie_policy_browsertest.cc +++ b/chrome/browser/net/cookie_policy_browsertest.cc @@ -8,7 +8,6 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/in_process_browser_test.h" @@ -38,13 +37,12 @@ IN_PROC_BROWSER_TEST_F(CookiePolicyBrowserTest, AllowFirstPartyCookies) { GURL url(test_server()->GetURL("set-cookie?cookie1")); - TabContents* tab = browser()->tab_strip_model()->GetActiveTabContents(); - std::string cookie = content::GetCookies(tab->profile(), url); + std::string cookie = content::GetCookies(browser()->profile(), url); ASSERT_EQ("", cookie); ui_test_utils::NavigateToURL(browser(), url); - cookie = content::GetCookies(tab->profile(), url); + cookie = content::GetCookies(browser()->profile(), url); EXPECT_EQ("cookie1", cookie); } @@ -69,8 +67,8 @@ IN_PROC_BROWSER_TEST_F(CookiePolicyBrowserTest, replacements.SetHostStr(new_host); redirected_url = redirected_url.ReplaceComponents(replacements); - TabContents* tab = browser()->tab_strip_model()->GetActiveTabContents(); - std::string cookie = content::GetCookies(tab->profile(), redirected_url); + std::string cookie = + content::GetCookies(browser()->profile(), redirected_url); ASSERT_EQ("", cookie); host_resolver()->AddRule("www.example.com", "127.0.0.1"); @@ -78,7 +76,7 @@ IN_PROC_BROWSER_TEST_F(CookiePolicyBrowserTest, ui_test_utils::NavigateToURL(browser(), GURL(url.spec() + redirected_url.spec())); - cookie = content::GetCookies(tab->profile(), redirected_url); + cookie = content::GetCookies(browser()->profile(), redirected_url); EXPECT_EQ("cookie2", cookie); } diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc index f687cf4..2789aba 100644 --- a/chrome/browser/policy/policy_browsertest.cc +++ b/chrome/browser/policy/policy_browsertest.cc @@ -50,7 +50,6 @@ #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" #include "chrome/browser/ui/omnibox/omnibox_view.h" #include "chrome/browser/ui/search/search.h" -#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" @@ -1628,8 +1627,7 @@ IN_PROC_BROWSER_TEST_P(RestoreOnStartupPolicyTest, RunTest) { int size = static_cast<int>(expected_urls_.size()); EXPECT_EQ(size, model->count()); for (int i = 0; i < size && i < model->count(); ++i) { - EXPECT_EQ(expected_urls_[i], - model->GetTabContentsAt(i)->web_contents()->GetURL()); + EXPECT_EQ(expected_urls_[i], model->GetWebContentsAt(i)->GetURL()); } } diff --git a/chrome/browser/sync/glue/synced_window_delegate.h b/chrome/browser/sync/glue/synced_window_delegate.h index 701e039..07230a0 100644 --- a/chrome/browser/sync/glue/synced_window_delegate.h +++ b/chrome/browser/sync/glue/synced_window_delegate.h @@ -56,7 +56,7 @@ class SyncedWindowDelegate { // Returns true iff the provided tab is currently "pinned" in the tab strip. virtual bool IsTabPinned(const SyncedTabDelegate* tab) const = 0; - // see Browser::GetTabContentsAt + // see TabStripModel::GetWebContentsAt virtual SyncedTabDelegate* GetTabAt(int index) const = 0; // Return the tab id for the tab at |index|. diff --git a/chrome/browser/ui/ash/launcher/browser_launcher_item_controller_unittest.cc b/chrome/browser/ui/ash/launcher/browser_launcher_item_controller_unittest.cc index 54ca078..2a67c46 100644 --- a/chrome/browser/ui/ash/launcher/browser_launcher_item_controller_unittest.cc +++ b/chrome/browser/ui/ash/launcher/browser_launcher_item_controller_unittest.cc @@ -9,6 +9,7 @@ #include "ash/launcher/launcher_model.h" #include "base/memory/scoped_ptr.h" +#include "chrome/browser/favicon/favicon_tab_helper.h" #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" @@ -33,7 +34,7 @@ namespace { const int kExpectedAppIndex = 1; -// Test implementation of AppTabHelper +// Test implementation of AppTabHelper. class AppTabHelperImpl : public ChromeLauncherController::AppTabHelper { public: AppTabHelperImpl() {} @@ -100,6 +101,24 @@ class AppIconLoaderImpl : public ChromeLauncherController::AppIconLoader { DISALLOW_COPY_AND_ASSIGN(AppIconLoaderImpl); }; +// Test implementation of TabStripModelDelegate. +class TabHelperTabStripModelDelegate : public TestTabStripModelDelegate { + public: + TabHelperTabStripModelDelegate() {} + virtual ~TabHelperTabStripModelDelegate() {} + + virtual void WillAddWebContents(content::WebContents* contents) OVERRIDE { + // BrowserLauncherItemController assumes that all WebContents passed to it + // have attached an extensions::TabHelper and a FaviconTabHelper. The + // TestTabStripModelDelegate adds an extensions::TabHelper. + TestTabStripModelDelegate::WillAddWebContents(contents); + FaviconTabHelper::CreateForWebContents(contents); + } + + private: + DISALLOW_COPY_AND_ASSIGN(TabHelperTabStripModelDelegate); +}; + } // namespace class BrowserLauncherItemControllerTest @@ -175,7 +194,7 @@ class BrowserLauncherItemControllerTest BrowserLauncherItemControllerTest* launcher_test; aura::Window window; - TestTabStripModelDelegate tab_strip_delegate; + TabHelperTabStripModelDelegate tab_strip_delegate; TabStripModel tab_strip; BrowserLauncherItemController updater; @@ -241,7 +260,7 @@ TEST_F(BrowserLauncherItemControllerTest, TabbedSetup) { { scoped_ptr<content::WebContents> web_contents(CreateTestWebContents()); - TestTabStripModelDelegate tab_strip_delegate; + TabHelperTabStripModelDelegate tab_strip_delegate; TabStripModel tab_strip(&tab_strip_delegate, profile()); tab_strip.InsertWebContentsAt(0, web_contents.get(), @@ -269,7 +288,7 @@ TEST_F(BrowserLauncherItemControllerTest, PanelItem) { // Add an App panel. { aura::Window window(NULL); - TestTabStripModelDelegate tab_strip_delegate; + TabHelperTabStripModelDelegate tab_strip_delegate; TabStripModel tab_strip(&tab_strip_delegate, profile()); scoped_ptr<content::WebContents> panel_tab(CreateTestWebContents()); app_tab_helper_->SetAppID(panel_tab.get(), "1"); // Panels are apps. @@ -289,7 +308,7 @@ TEST_F(BrowserLauncherItemControllerTest, PanelItem) { // Add an Extension panel. { aura::Window window(NULL); - TestTabStripModelDelegate tab_strip_delegate; + TabHelperTabStripModelDelegate tab_strip_delegate; TabStripModel tab_strip(&tab_strip_delegate, profile()); scoped_ptr<content::WebContents> panel_tab(CreateTestWebContents()); app_tab_helper_->SetAppID(panel_tab.get(), "1"); // Panels are apps. diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc index 8876123..f91ef9c 100644 --- a/chrome/browser/ui/browser_commands.cc +++ b/chrome/browser/ui/browser_commands.cc @@ -50,7 +50,6 @@ #include "chrome/browser/ui/search/search.h" #include "chrome/browser/ui/search/search_model.h" #include "chrome/browser/ui/status_bubble.h" -#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" #include "chrome/browser/web_applications/web_app.h" @@ -331,13 +330,12 @@ bool CanGoBack(const Browser* browser) { void GoBack(Browser* browser, WindowOpenDisposition disposition) { content::RecordAction(UserMetricsAction("Back")); - TabContents* current_tab = browser->tab_strip_model()->GetActiveTabContents(); + WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents(); if (CanGoBack(browser)) { WebContents* new_tab = GetOrCloneTabForDisposition(browser, disposition); // If we are on an interstitial page and clone the tab, it won't be copied // to the new tab, so we don't need to go back. - if (current_tab->web_contents()->ShowingInterstitialPage() && - (new_tab != current_tab->web_contents())) + if (current_tab->ShowingInterstitialPage() && new_tab != current_tab) return; new_tab->GetController().GoBack(); } diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm index 3081eaf..5f2259d 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm @@ -1950,7 +1950,7 @@ private: content::RecordAction(UserMetricsAction("Tab_DropURLOnTab")); OpenURLParams params( *url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false); - tabStripModel_->GetTabContentsAt(index)->web_contents()->OpenURL(params); + tabStripModel_->GetWebContentsAt(index)->OpenURL(params); tabStripModel_->ActivateTabAt(index, true); break; } diff --git a/chrome/browser/ui/tab_contents/tab_contents.h b/chrome/browser/ui/tab_contents/tab_contents.h index 254103b..bcd3501 100644 --- a/chrome/browser/ui/tab_contents/tab_contents.h +++ b/chrome/browser/ui/tab_contents/tab_contents.h @@ -13,7 +13,6 @@ class Browser; class Profile; -class TestTabStripModelDelegate; // Wraps WebContents and all of its supporting objects in order to control // their ownership and lifetime. @@ -41,7 +40,6 @@ class TabContents : public content::WebContentsObserver { friend class Browser; // See crbug.com/153587 friend class TabAndroid; - friend class TestTabStripModelDelegate; static TabContents* CreateTabContents(content::WebContents* contents); }; diff --git a/chrome/browser/ui/tabs/pinned_tab_codec.cc b/chrome/browser/ui/tabs/pinned_tab_codec.cc index 45895213..3fe52f3 100644 --- a/chrome/browser/ui/tabs/pinned_tab_codec.cc +++ b/chrome/browser/ui/tabs/pinned_tab_codec.cc @@ -11,7 +11,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" -#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/pref_names.h" @@ -52,8 +51,7 @@ static void EncodePinnedTab(TabStripModel* model, ListValue* values) { scoped_ptr<DictionaryValue> value(new DictionaryValue()); - content::WebContents* web_contents = - model->GetTabContentsAt(index)->web_contents(); + content::WebContents* web_contents = model->GetWebContentsAt(index); if (model->IsAppTab(index)) { const extensions::Extension* extension = extensions::TabHelper::FromWebContents(web_contents)->extension_app(); diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc index 349f5ad..3439a1a 100644 --- a/chrome/browser/ui/tabs/tab_strip_model.cc +++ b/chrome/browser/ui/tabs/tab_strip_model.cc @@ -16,7 +16,6 @@ #include "chrome/browser/extensions/tab_helper.h" #include "chrome/browser/ui/tab_contents/core_tab_helper.h" #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" -#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" #include "chrome/browser/ui/tabs/tab_strip_model_order_controller.h" #include "chrome/common/url_constants.h" @@ -310,30 +309,16 @@ void TabStripModel::MoveSelectedTabsTo(int index) { selected_count - selected_mini_count); } -TabContents* TabStripModel::GetActiveTabContents() const { - return GetTabContentsAt(active_index()); -} - WebContents* TabStripModel::GetActiveWebContents() const { return GetWebContentsAt(active_index()); } -TabContents* TabStripModel::GetTabContentsAt(int index) const { - if (ContainsIndex(index)) - return GetTabContentsAtImpl(index); - return NULL; -} - WebContents* TabStripModel::GetWebContentsAt(int index) const { if (ContainsIndex(index)) return GetWebContentsAtImpl(index); return NULL; } -int TabStripModel::GetIndexOfTabContents(const TabContents* contents) const { - return GetIndexOfWebContents(contents->web_contents()); -} - int TabStripModel::GetIndexOfWebContents(const WebContents* contents) const { for (size_t i = 0; i < contents_data_.size(); ++i) { if (contents_data_[i]->contents == contents) @@ -1099,12 +1084,6 @@ void TabStripModel::InternalCloseTab(WebContents* contents, delete contents; } -TabContents* TabStripModel::GetTabContentsAtImpl(int index) const { - CHECK(ContainsIndex(index)) << - "Failed to find: " << index << " in: " << count() << " entries."; - return TabContents::FromWebContents(contents_data_[index]->contents); -} - WebContents* TabStripModel::GetWebContentsAtImpl(int index) const { CHECK(ContainsIndex(index)) << "Failed to find: " << index << " in: " << count() << " entries."; diff --git a/chrome/browser/ui/tabs/tab_strip_model.h b/chrome/browser/ui/tabs/tab_strip_model.h index 94a9122..aa32d68 100644 --- a/chrome/browser/ui/tabs/tab_strip_model.h +++ b/chrome/browser/ui/tabs/tab_strip_model.h @@ -16,7 +16,6 @@ #include "content/public/common/page_transition_types.h" class Profile; -class TabContents; class TabStripModelDelegate; class TabStripModelOrderController; @@ -246,17 +245,14 @@ class TabStripModel : public content::NotificationObserver { void MoveSelectedTabsTo(int index); // Returns the currently active WebContents, or NULL if there is none. - TabContents* GetActiveTabContents() const; content::WebContents* GetActiveWebContents() const; // Returns the WebContents at the specified index, or NULL if there is // none. - TabContents* GetTabContentsAt(int index) const; content::WebContents* GetWebContentsAt(int index) const; // Returns the index of the specified WebContents, or TabStripModel::kNoTab // if the WebContents is not in this TabStripModel. - int GetIndexOfTabContents(const TabContents* contents) const; int GetIndexOfWebContents(const content::WebContents* contents) const; // Notify any observers that the WebContents at the specified index has @@ -506,7 +502,6 @@ class TabStripModel : public content::NotificationObserver { bool create_historical_tabs); // Gets the WebContents at an index. Does no bounds checking. - TabContents* GetTabContentsAtImpl(int index) const; content::WebContents* GetWebContentsAtImpl(int index) const; // Notifies the observers if the active tab is being deactivated. diff --git a/chrome/browser/ui/tabs/tab_strip_model_order_controller.cc b/chrome/browser/ui/tabs/tab_strip_model_order_controller.cc index d83ca2d..c009349 100644 --- a/chrome/browser/ui/tabs/tab_strip_model_order_controller.cc +++ b/chrome/browser/ui/tabs/tab_strip_model_order_controller.cc @@ -4,7 +4,6 @@ #include "chrome/browser/ui/tabs/tab_strip_model_order_controller.h" -#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "content/public/browser/web_contents.h" /////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/ui/tabs/tab_strip_model_order_controller.h b/chrome/browser/ui/tabs/tab_strip_model_order_controller.h index b94cd00..96a3af5 100644 --- a/chrome/browser/ui/tabs/tab_strip_model_order_controller.h +++ b/chrome/browser/ui/tabs/tab_strip_model_order_controller.h @@ -8,8 +8,6 @@ #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "content/public/common/page_transition_types.h" -class TabContents; - /////////////////////////////////////////////////////////////////////////////// // TabStripModelOrderController // diff --git a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc index 7b042f9..a211d84 100644 --- a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc +++ b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc @@ -21,7 +21,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_tabstrip.h" -#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" #include "chrome/browser/ui/tabs/tab_strip_model_order_controller.h" #include "chrome/browser/ui/tabs/test_tab_strip_model_delegate.h" diff --git a/chrome/browser/ui/tabs/test_tab_strip_model_delegate.cc b/chrome/browser/ui/tabs/test_tab_strip_model_delegate.cc index 4cc4b3f..ddebe4c 100644 --- a/chrome/browser/ui/tabs/test_tab_strip_model_delegate.cc +++ b/chrome/browser/ui/tabs/test_tab_strip_model_delegate.cc @@ -6,7 +6,6 @@ #include "chrome/browser/extensions/tab_helper.h" #include "chrome/browser/ui/tab_contents/core_tab_helper.h" -#include "chrome/browser/ui/tab_contents/tab_contents.h" TestTabStripModelDelegate::TestTabStripModelDelegate() { } @@ -27,11 +26,6 @@ Browser* TestTabStripModelDelegate::CreateNewStripWithContents( void TestTabStripModelDelegate::WillAddWebContents( content::WebContents* contents) { - // TEMPORARY: Until TabStripModel is fully de-TabContents-ed, it requires all - // items in it to be TabContentses. - if (!TabContents::FromWebContents(contents)) - TabContents::Factory::CreateTabContents(contents); - // Required to determine reloadability of tabs. CoreTabHelper::CreateForWebContents(contents); // Required to determine if tabs are app tabs. diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h index 0e0503d..2f7da2f 100644 --- a/chrome/browser/ui/views/frame/browser_view.h +++ b/chrome/browser/ui/views/frame/browser_view.h @@ -183,7 +183,7 @@ class BrowserView : public BrowserWindow, // otherwise. bool GetAccelerator(int cmd_id, ui::Accelerator* accelerator); - // Returns the selected WebContents. Used by our NonClientView's + // Returns the active WebContents. Used by our NonClientView's // TabIconView::TabContentsProvider implementations. // TODO(beng): exposing this here is a bit bogus, since it's only used to // determine loading state. It'd be nicer if we could change this to be diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest_win.cc b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest_win.cc index bca4a2b..45e7680 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest_win.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest_win.cc @@ -219,17 +219,6 @@ IN_PROC_BROWSER_TEST_F(TabDragControllerTest, DeleteTabWhileDetached) { EXPECT_EQ("1", IDString(browser()->tab_strip_model())); } -namespace { - -void DeleteSourceDetachedStep2(WebContents* tab) { - // This ends up closing the source window. - delete tab; - // Cancel the drag. - ui_controls::SendKeyPress(NULL, ui::VKEY_ESCAPE, false, false, false, false); -} - -} // namespace - // Detaches a tab and while detached deletes a tab from the source and releases // the mouse. IN_PROC_BROWSER_TEST_F(TabDragControllerTest, DeleteSourceDetached) { diff --git a/chrome/test/base/browser_with_test_window_test.h b/chrome/test/base/browser_with_test_window_test.h index e36316d..2475c14 100644 --- a/chrome/test/base/browser_with_test_window_test.h +++ b/chrome/test/base/browser_with_test_window_test.h @@ -41,7 +41,7 @@ class WebContents; // // Add a new tab and navigate it. This will be at index 0. // AddTab(browser(), GURL("http://foo/1")); // NavigationController* controller = -// &browser()->tab_strip_model()->GetTabContentsAt(0)->GetController(); +// &browser()->tab_strip_model()->GetWebContentsAt(0)->GetController(); // // // Navigate somewhere else. // GURL url2("http://foo/2"); |