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