Commit 9f2a9d72 authored by avi@chromium.org's avatar avi@chromium.org

TabContents -> WebContentsImpl, part 13.

Remove the TabContents typedef.

BUG=105875
TEST=no change


Review URL: http://codereview.chromium.org/10082021

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132410 0039d316-1c4b-4281-b951-d872f2087c98
parent 2487c453
...@@ -23,14 +23,14 @@ ...@@ -23,14 +23,14 @@
namespace content { namespace content {
BrowserPluginWebContentsObserver::BrowserPluginWebContentsObserver( BrowserPluginWebContentsObserver::BrowserPluginWebContentsObserver(
TabContents* tab_contents) WebContentsImpl* web_contents)
: WebContentsObserver(tab_contents), : WebContentsObserver(web_contents),
host_(NULL), host_(NULL),
instance_id_(0) { instance_id_(0) {
registrar_.Add(this, registrar_.Add(this,
NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED, NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED,
Source<RenderViewHost>( Source<RenderViewHost>(
tab_contents->GetRenderViewHost())); web_contents->GetRenderViewHost()));
} }
BrowserPluginWebContentsObserver::~BrowserPluginWebContentsObserver() { BrowserPluginWebContentsObserver::~BrowserPluginWebContentsObserver() {
...@@ -89,8 +89,8 @@ void BrowserPluginWebContentsObserver::OnOpenChannelToBrowserPlugin( ...@@ -89,8 +89,8 @@ void BrowserPluginWebContentsObserver::OnOpenChannelToBrowserPlugin(
SiteInstance* site_instance = SiteInstance* site_instance =
SiteInstance::CreateForURL( SiteInstance::CreateForURL(
browser_context, url); browser_context, url);
TabContents* guest_tab_contents = WebContentsImpl* guest_web_contents =
static_cast<TabContents*>( static_cast<WebContentsImpl*>(
WebContents::Create( WebContents::Create(
browser_context, browser_context,
site_instance, site_instance,
...@@ -101,7 +101,7 @@ void BrowserPluginWebContentsObserver::OnOpenChannelToBrowserPlugin( ...@@ -101,7 +101,7 @@ void BrowserPluginWebContentsObserver::OnOpenChannelToBrowserPlugin(
// TODO(fsamuel): Set the WebContentsDelegate here. // TODO(fsamuel): Set the WebContentsDelegate here.
RenderViewHostImpl* guest_render_view_host = RenderViewHostImpl* guest_render_view_host =
static_cast<RenderViewHostImpl*>( static_cast<RenderViewHostImpl*>(
guest_tab_contents->GetRenderViewHost()); guest_web_contents->GetRenderViewHost());
// We need to make sure that the RenderViewHost knows that it's // We need to make sure that the RenderViewHost knows that it's
// hosting a guest RenderView so that it informs the RenderView // hosting a guest RenderView so that it informs the RenderView
...@@ -109,7 +109,7 @@ void BrowserPluginWebContentsObserver::OnOpenChannelToBrowserPlugin( ...@@ -109,7 +109,7 @@ void BrowserPluginWebContentsObserver::OnOpenChannelToBrowserPlugin(
// until a guest-to-host channel has been initialized. // until a guest-to-host channel has been initialized.
guest_render_view_host->set_guest(true); guest_render_view_host->set_guest(true);
guest_tab_contents->GetController().LoadURL( guest_web_contents->GetController().LoadURL(
url, url,
Referrer(), Referrer(),
PAGE_TRANSITION_HOME_PAGE, PAGE_TRANSITION_HOME_PAGE,
...@@ -117,11 +117,11 @@ void BrowserPluginWebContentsObserver::OnOpenChannelToBrowserPlugin( ...@@ -117,11 +117,11 @@ void BrowserPluginWebContentsObserver::OnOpenChannelToBrowserPlugin(
guest_render_view_host->GetView()->SetSize(size); guest_render_view_host->GetView()->SetSize(size);
BrowserPluginWebContentsObserver* guest_observer = BrowserPluginWebContentsObserver* guest_observer =
guest_tab_contents->browser_plugin_web_contents_observer(); guest_web_contents->browser_plugin_web_contents_observer();
guest_observer->set_host(static_cast<TabContents*>(web_contents())); guest_observer->set_host(static_cast<WebContentsImpl*>(web_contents()));
guest_observer->set_instance_id(instance_id); guest_observer->set_instance_id(instance_id);
AddGuest(guest_tab_contents, frame_id); AddGuest(guest_web_contents, frame_id);
} }
void BrowserPluginWebContentsObserver::OnRendererPluginChannelCreated( void BrowserPluginWebContentsObserver::OnRendererPluginChannelCreated(
...@@ -153,21 +153,20 @@ void BrowserPluginWebContentsObserver::OnRendererPluginChannelCreated( ...@@ -153,21 +153,20 @@ void BrowserPluginWebContentsObserver::OnRendererPluginChannelCreated(
channel_handle)); channel_handle));
} }
void BrowserPluginWebContentsObserver::AddGuest( void BrowserPluginWebContentsObserver::AddGuest(WebContentsImpl* guest,
TabContents* guest, int64 frame_id) {
int64 frame_id) {
guests_[guest] = frame_id; guests_[guest] = frame_id;
} }
void BrowserPluginWebContentsObserver::RemoveGuest(TabContents* guest) { void BrowserPluginWebContentsObserver::RemoveGuest(WebContentsImpl* guest) {
guests_.erase(guest); guests_.erase(guest);
} }
void BrowserPluginWebContentsObserver::DestroyGuests() { void BrowserPluginWebContentsObserver::DestroyGuests() {
for (GuestMap::const_iterator it = guests_.begin(); for (GuestMap::const_iterator it = guests_.begin();
it != guests_.end(); ++it) { it != guests_.end(); ++it) {
const TabContents* contents = it->first; const WebContentsImpl* web_contents = it->first;
delete contents; delete web_contents;
} }
guests_.clear(); guests_.clear();
} }
...@@ -177,13 +176,13 @@ void BrowserPluginWebContentsObserver::DidCommitProvisionalLoadForFrame( ...@@ -177,13 +176,13 @@ void BrowserPluginWebContentsObserver::DidCommitProvisionalLoadForFrame(
bool is_main_frame, bool is_main_frame,
const GURL& url, const GURL& url,
PageTransition transition_type) { PageTransition transition_type) {
typedef std::set<TabContents*> GuestSet; typedef std::set<WebContentsImpl*> GuestSet;
GuestSet guests_to_delete; GuestSet guests_to_delete;
for (GuestMap::const_iterator it = guests_.begin(); for (GuestMap::const_iterator it = guests_.begin();
it != guests_.end(); ++it) { it != guests_.end(); ++it) {
TabContents* contents = it->first; WebContentsImpl* web_contents = it->first;
if (it->second == frame_id) { if (it->second == frame_id) {
guests_to_delete.insert(contents); guests_to_delete.insert(web_contents);
} }
} }
for (GuestSet::const_iterator it = guests_to_delete.begin(); for (GuestSet::const_iterator it = guests_to_delete.begin();
...@@ -218,11 +217,11 @@ void BrowserPluginWebContentsObserver::Observe( ...@@ -218,11 +217,11 @@ void BrowserPluginWebContentsObserver::Observe(
// If the host is hidden we need to hide the guests as well. // If the host is hidden we need to hide the guests as well.
for (GuestMap::const_iterator it = guests_.begin(); for (GuestMap::const_iterator it = guests_.begin();
it != guests_.end(); ++it) { it != guests_.end(); ++it) {
TabContents* contents = it->first; WebContentsImpl* web_contents = it->first;
if (visible) if (visible)
contents->ShowContents(); web_contents->ShowContents();
else else
contents->HideContents(); web_contents->HideContents();
} }
} }
......
...@@ -166,9 +166,9 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, ...@@ -166,9 +166,9 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest,
// Wait for the cross-site transition in the new tab to finish. // Wait for the cross-site transition in the new tab to finish.
ui_test_utils::WaitForLoadStop(browser()->GetSelectedWebContents()); ui_test_utils::WaitForLoadStop(browser()->GetSelectedWebContents());
TabContents* tab_contents = static_cast<TabContents*>( WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
browser()->GetSelectedWebContents()); browser()->GetSelectedWebContents());
EXPECT_FALSE(tab_contents->GetRenderManagerForTesting()-> EXPECT_FALSE(web_contents->GetRenderManagerForTesting()->
pending_render_view_host()); pending_render_view_host());
// Should have a new SiteInstance. // Should have a new SiteInstance.
...@@ -224,9 +224,9 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, ...@@ -224,9 +224,9 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest,
// Wait for the cross-site transition in the new tab to finish. // Wait for the cross-site transition in the new tab to finish.
ui_test_utils::WaitForLoadStop(browser()->GetSelectedWebContents()); ui_test_utils::WaitForLoadStop(browser()->GetSelectedWebContents());
TabContents* tab_contents = static_cast<TabContents*>( WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
browser()->GetSelectedWebContents()); browser()->GetSelectedWebContents());
EXPECT_FALSE(tab_contents->GetRenderManagerForTesting()-> EXPECT_FALSE(web_contents->GetRenderManagerForTesting()->
pending_render_view_host()); pending_render_view_host());
// Should have a new SiteInstance (in a new BrowsingInstance). // Should have a new SiteInstance (in a new BrowsingInstance).
......
...@@ -249,11 +249,11 @@ TEST_F(SiteInstanceTest, SiteInstanceDestructor) { ...@@ -249,11 +249,11 @@ TEST_F(SiteInstanceTest, SiteInstanceDestructor) {
&site_delete_counter, &site_delete_counter,
&browsing_delete_counter); &browsing_delete_counter);
{ {
TabContents contents(browser_context.get(), WebContentsImpl web_contents(browser_context.get(),
instance, instance,
MSG_ROUTING_NONE, MSG_ROUTING_NONE,
NULL, NULL,
NULL); NULL);
EXPECT_EQ(1, site_delete_counter); EXPECT_EQ(1, site_delete_counter);
EXPECT_EQ(1, browsing_delete_counter); EXPECT_EQ(1, browsing_delete_counter);
} }
......
...@@ -111,7 +111,7 @@ void SSLPolicy::OnRequestStarted(SSLRequestInfo* info) { ...@@ -111,7 +111,7 @@ void SSLPolicy::OnRequestStarted(SSLRequestInfo* info) {
} }
void SSLPolicy::UpdateEntry(NavigationEntryImpl* entry, void SSLPolicy::UpdateEntry(NavigationEntryImpl* entry,
TabContents* tab_contents) { WebContentsImpl* web_contents) {
DCHECK(entry); DCHECK(entry);
InitializeEntryIfNeeded(entry); InitializeEntryIfNeeded(entry);
...@@ -158,7 +158,7 @@ void SSLPolicy::UpdateEntry(NavigationEntryImpl* entry, ...@@ -158,7 +158,7 @@ void SSLPolicy::UpdateEntry(NavigationEntryImpl* entry,
return; return;
} }
if (tab_contents->DisplayedInsecureContent()) if (web_contents->DisplayedInsecureContent())
entry->GetSSL().content_status |= SSLStatus::DISPLAYED_INSECURE_CONTENT; entry->GetSSL().content_status |= SSLStatus::DISPLAYED_INSECURE_CONTENT;
} }
......
...@@ -1772,9 +1772,9 @@ void WebContentsImpl::OnSetSelectedColorInColorChooser(int color_chooser_id, ...@@ -1772,9 +1772,9 @@ void WebContentsImpl::OnSetSelectedColorInColorChooser(int color_chooser_id,
color_chooser_->SetSelectedColor(color); color_chooser_->SetSelectedColor(color);
} }
void TabContents::OnPepperPluginHung(int plugin_child_id, void WebContentsImpl::OnPepperPluginHung(int plugin_child_id,
const FilePath& path, const FilePath& path,
bool is_hung) { bool is_hung) {
if (delegate_) if (delegate_)
delegate_->PluginHungStatusChanged(this, plugin_child_id, path, is_hung); delegate_->PluginHungStatusChanged(this, plugin_child_id, path, is_hung);
} }
......
...@@ -697,6 +697,4 @@ class CONTENT_EXPORT WebContentsImpl ...@@ -697,6 +697,4 @@ class CONTENT_EXPORT WebContentsImpl
DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); DISALLOW_COPY_AND_ASSIGN(WebContentsImpl);
}; };
typedef class WebContentsImpl TabContents;
#endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
...@@ -102,9 +102,9 @@ void RenderViewHostTester::EnableAccessibilityUpdatedNotifications( ...@@ -102,9 +102,9 @@ void RenderViewHostTester::EnableAccessibilityUpdatedNotifications(
// static // static
RenderViewHost* RenderViewHostTester::GetPendingForController( RenderViewHost* RenderViewHostTester::GetPendingForController(
NavigationController* controller) { NavigationController* controller) {
TabContents* tab_contents = static_cast<TabContents*>( WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
controller->GetWebContents()); controller->GetWebContents());
return tab_contents->GetRenderManagerForTesting()->pending_render_view_host(); return web_contents->GetRenderManagerForTesting()->pending_render_view_host();
} }
// static // static
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment